iPhone 应用程序在从 Xcode 启动时崩溃,但不是从 iPhone 启动 [英] iPhone app crashes when launched from Xcode, but not from iPhone

查看:15
本文介绍了iPhone 应用程序在从 Xcode 启动时崩溃,但不是从 iPhone 启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序在 iPhone 上崩溃,但只有当它通过 Xcode 启动时才崩溃.

I have an app that is crashing on the iPhone, but only when it launched via Xcode.

我可以在 iPhone 控制台日志中看到该应用收到内存警告,然后出现一些奇怪的事件,例如:

I can see in the iPhone console log that the app receives a memory warning, and then there are some strange events like these:

Sun Jul 11 00:03:43 Matts-iPhone com.apple.launchd[1] (UIKitApplication:com.mycom.myapp[0x3f60][5591]) <Notice>: (UIKitApplication:com.mycom.myapp[0x3f60]) Bug: launchd_core_logic.c:3270 (24132):0
Sun Jul 11 00:03:43 Matts-iPhone com.apple.debugserver-48[5590] <Warning>: 1 [15d6/1403]: error: ::read ( 6, 0x3809f4, 1024 ) => -1 err = Bad file descriptor (0x00000009)
Sun Jul 11 00:03:43 Matts-iPhone com.apple.launchd[1] (UIKitApplication:com.mycom.myapp[0x3f60][5591]) <Notice>: (UIKitApplication:com.mycom.myapp[0x3f60]) Bug: launchd_core_logic.c:2688 (24132):10
Sun Jul 11 00:03:43 Matts-iPhone com.apple.launchd[1] (UIKitApplication:com.mycom.myapp[0x3f60][5591]) <Notice>: (UIKitApplication:com.mycom.myapp[0x3f60]) Working around 5020256. Assuming the job crashed.
Sun Jul 11 00:03:43 Matts-iPhone com.apple.launchd[1] (UIKitApplication:com.mycom.myapp[0x3f60][5591]) <Warning>: (UIKitApplication:com.mycom.myapp[0x3f60]) Job appears to have crashed: Segmentation fault
Sun Jul 11 00:03:43 Matts-iPhone SpringBoard[40] <Warning>: Application 'Phone' exited abnormally with signal 9: Killed
Sun Jul 11 00:03:45 Matts-iPhone SpringBoard[40] <Warning>: Application 'myapp' exited abnormally with signal 11: Segmentation fault

但是,当我从手机(而不是通过 Xcode)启动应用程序时,它会按预期工作.(启动过程中出现内存警告.我知道它运行紧张,但它会恢复并且不会崩溃).

However, when I launch the app from the phone (not via Xcode) then it works as expected. (There is a memory warning during launch. I know it's running tight, but it recovers and doesn't crash).

这使得调试其他问题变得特别困难.

This is making it particularly hard to debug other issues.

我是否偶然发现了一些 iOS 错误?

Have I stumbled across some iOS bug?

有什么想法吗?

推荐答案

在我的情况下,我忘记了我仍然设置了NSZombiesEnabled"环境变量,这增加了实际内存使用量(导致崩溃) 从 Xcode 启动时.当直接从 Springboard 启动时,没有设置该环境变量,并且应用程序使用的内存要少得多.

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 :)

这篇关于iPhone 应用程序在从 Xcode 启动时崩溃,但不是从 iPhone 启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆