4

All of a sudden any app I build and send to my phone crashes immediately when I disconnect the wire connecting my iMac to my iPhone and nothing gets sent to the console either. The only thing that I get on the computer screen is the standard warning about the disconnection and that it should be restored again & how.

Don't know what I did wrong. Everything is up to date. Upgraded recently from Swift 1.2 to 2.0, the phone is running iOS 9.1, the iMac (although old) is also on OS X El Capitan. Everything worked fine for a few days after the upgrade as well. I already tried restarting Xcode, restarting the computer and the phone, deleting and rebuilding the process, deleting the app and reloading it again, cleaning the project and changing both the wire and the phone. Also, this doesn't have anything to do with existing projects necessarily, I just created a brand new silly one page view with a single text field on it and the thing crashes on me as soon as I disconnect the wire. I think I may have tripped a setting or something similar. HELP!!

Chaim Friedman
  • 720
  • 6
  • 24

1 Answers1

6

any app I build and send to my phone crashes immediately when I disconnect the wire connecting my iMac to my iPhone

This is normal behavior. When you build and run on the device, you are still running in Xcode; when you pull the wire, you break the connection between Xcode and the app that it is running.

The correct thing to do is build-and-run on the device, in order to get the app onto the device, and then stop (Product > Stop). Now disconnect; this is safe because the app is not running. Now launch the app from the device, by tapping its icon in the springboard.

matt
  • 515,959
  • 87
  • 875
  • 1,141