If the phone does not detect initially detect, while the phone is plugged in, redial ##8778#
Select "AP", then Exit to Home Screen
Then Redial ##8778# and select "CP" or "ALL"
If the phone still fails to detect, retry these settings again with USB debugging mode on.
(If the phone was flashed before, and you are asked for an SPC during the pre-provisioning process, try 555555)