All Apps Crash Upon Disconnect [closed]

心已入冬 提交于 2019-12-10 17:24:15

问题


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!!


回答1:


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.



来源:https://stackoverflow.com/questions/33862458/all-apps-crash-upon-disconnect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!