Artificial microswimmers powered by magnetic fields have numerous applications, such as drug delivery, biosensing for minimally invasive medicine and environmental remediation. Recently, a Janus microdimer surface walker that can be propelled by an oscillating magnetic field near a surface was reported by Li
et al.
(
Adv. Funct. Mater.
28
, 1706066. (
doi:10.1002/adfm.201706066
)). To clarify the mechanism for the surface walker, we numerically studied in detail a Janus microdimer swimming near a wall actuated by an oscillating magnetic field. The results showed that a Janus microdimer in an oscillating magnetic field can produce magnetic torque in the
y
-direction, which eventually propels the Janus microdimer along the
x
-direction near a wall. Furthermore, we found that the Janus microdimer can also move along a special direction in an oscillating magnetic field with two orientations without a wall. The knowledge obtained in this study is fundamental for understanding the interactions between a Janus microdimer and surfaces in an oscillating magnetic field and is useful for controlling Janus microdimer motion with or without a wall.