Man accused of beating girlfriend’s son appears in court