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

查看:276
本文介绍了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天全站免登陆