Global particle-in-cell (PIC) simulations of pulsar magnetospheres are performed with volume-, surface-, and pair-production-based plasma injection schemes to systematically investigate the transition between electrosphere and force-free pulsar magnetospheric regimes. We present a new extension of the PIC code OSIRIS that can be used to model pulsar magnetospheres with a two-dimensional axisymmetric spherical grid. The subalgorithms of the code and thorough benchmarks are presented in detail, including a new first-order current deposition scheme that conserves charge to machine precision. We show that all plasma injection schemes produce a range of magnetospheric regimes. Active solutions can be obtained with surface and volume injection schemes when using artificially large plasma-injection rates, and with pair-production-based plasma injection for sufficiently large separation between kinematic and pair-production energy scales.