简体   繁体   English

为什么在Xcode 5 / iOS 7的iPhone上测试应用程序会因调用NSLog而崩溃?

[英]Why does testing an app on an iPhone in Xcode 5/iOS 7 crash with calls to NSLog?

I've completed adapting my app for iOS 7 in Xcode 5, and it has tested fine in the simulator (for both iOS 7 and 6.1). 我已经完成了将我的应用程序适应Xcode 5中的iOS 7的操作,并且已经在模拟器中(对于iOS 7和6.1)进行了良好的测试。 Before deploying for testing, I've run it a few times on my iPhone from Xcode 5, but the app frequently crashes with the error message: 在部署测试之前,我已经在Xcode 5的iPhone上运行了几次,但是该应用经常崩溃并显示错误消息:

error: failed to launch 'app name/path' -- failed to get the task for process #### 错误:无法启动“应用名称/路径”-无法获取进程####的任务

I narrowed this down to NSLog calls. 我将其范围缩小到NSLog调用。 This never happened before using the iOS 6 SDK. 在使用iOS 6 SDK之前,这从未发生过。 Anyone know why this is the case? 有人知道为什么会这样吗? Is it not good practice to have a few NSLogs in an app (even for reporting errors/warnings to the user's console)? 在应用程序中包含一些NSLogs(甚至用于向用户控制台报告错误/警告)不是一种好习惯吗?

Calling NSLog should not be a problem. 调用NSLog应该没有问题。

Cleaning Derived Data and changing my provisioning profile has helped for me. 清理派生数据并更改我的配置文件对我有所帮助。

Try to see this thread: Xcode 5: failed to get the task for process 尝试查看此线程: Xcode 5:无法获取进程任务

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM