iPhone app crashes when launched from Xcode, but not from iPhone

老子叫甜甜 提交于 2019-12-03 17:31:06

Turns out in my case that I'd forgotten that I still had the "NSZombiesEnabled" environment variable set, which was increasing the real memory usage (causing the crash) when launched from Xcode. When launched directly from Springboard, that environment variable wasn't set, and the app used lots less memory.

It's very useful for debugging... until you run out of memory and forget it's there :)

This happened to me and was also due to the NSZombiesEnabled being set. In my case it was being set in a ~/.gdbinit file which I had forgotten existed. In Xcode the NSZombieEnabled checkbox was off and there was nothing set in the scheme's environment variables so it was driving me crazy trying to figure out the issue. Moral of the story is to make sure it's not set in the .gdbinit as well as in XCode.

I had this issue also and it was caused by having Resupported 4 installed from Cydia. After I removed it, my app launched perfectly.

Usually, when you see a crash on simulator but not device or vice versa it indicates a fault with a library that is compiled for one hardware but not the other.

However, if your memory is tight, then you're probably seeing a crash caused by the subtle differences between code compiled for Intel versus code compiled for ARM. The Intel code is likely just more sensitive for some reason. The same problem will eventually occur on device if you leave it running long enough under tight memory.

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