Formation, integration, and control of semiconductor spin-defects in electronic and photonic devices