2D semiconductors show promise as a competitive candidate for developing future integrated circuits due to their immunity to short-channel effects and high carrier mobility at atomic layer thicknesses. The inherent defects and Fermi level pinning effect lead to n-type transport characteristics in most 2D semiconductors, while unstable and unsustainable p-type doping by various strategies hinders their application in many areas, such as complementary metal-oxide-semiconductor (CMOS) devices. In this study, an intralayer/interlayer codoping strategy is introduced that stabilizes p-type doping in 2D semiconductors. By incorporating oppositely charged ions (F and Li) with the intralayer/interlayer of 2D semiconductors, remarkable p-type doping in WSe2 and MoTe2 with air stability up to 9 months is achieved. Notably, the hole mobility presents a 100-fold enhancement (0.7 to 92 cm2 V-1 s-1) with the codoping procedure. Structural and elemental characterizations, combined with theoretical calculations validate the codoping mechanism. Moreover, a CMOS inverter and more complex logic functions such as NOR and XNOR, as well as large-area device arrays are demonstrated to showcase its applications and scalability. These findings suggest that stable and straightforward intralayer/interlayer codoping strategy with charge-space synergy holds the key to unlocking the potential of 2D semiconductors in complex and scalable device applications.