  Abridged. It is important for the star formation process to understand the
collapse of a prestellar dense core. We investigate the effect of the magnetic
field during the first collapse up to the formation of the firstcore, focusing
particularly on the magnetic braking and the launching of outflows. We perform
3D AMR high resolution numerical simulations of a magnetically supercritical
collapsing dense core using the RAMSES MHD code and develop semi-analytical
models that we compare with the numerical results. We study in detail the
various profiles within the envelope of the collapsing core for various
magnetic field strengths. Even modest values of magnetic field strength modify
the collapse significantly. This is largely due to the amplification of the
radial and toroidal components of the magnetic field by the differential
motions within the collapsing core. For a weak magnetic intensity corresponding
to an initial mass-to-flux over critical mass-to-flux ratio, $\mu$ equals to
20, a centrifugally supported disk forms. The strong differential rotation
triggers the growth of a slowly expanding magnetic tower. For a higher magnetic
field strengths corresponding to $\mu=2$, the collapse occurs primarily along
the field lines, therefore delivering weaker angular momentum in the inner part
whereas at the same time, strong magnetic braking occurs. As a consequence no
centrifugally supported disk forms. An outflow is launched from the central
thermally supported core. Detailed comparisons with existing analytical
predictions indicate that it is magneto-centrifugally driven. For cores having
a mass-to-flux over critical mass-to-flux radio $\mu < 5$, the magnetic field
appears to have a significant impact.....
