[英]My iPhone app works on the device, but not the simulator
My app works okay on the device, but not the simulator. 我的应用程序可以在设备上正常运行,但不能在模拟器上运行。 When I run it on the simulator I get no errors or anything.
当我在模拟器上运行它时,我没有收到任何错误或任何提示。 The app just dies a second after being launched.
该应用程序在启动后仅死掉一秒钟。 Does this really matter?
这真的重要吗? Should I be concerned?
我应该担心吗?
In fact, the only reason I wanted to run the simulator is to get an idea of how my app runs on the iPad (of which I don't physically own). 实际上,我想运行模拟器的唯一原因是想知道我的应用程序如何在iPad上运行(我并不真正拥有它)。 What do we think?
我们怎么看?
If there are no obvious logs, one thing you can do is to add some NSLog statements to each method. 如果没有明显的日志,您可以做的一件事是向每个方法添加一些NSLog语句。
I use these: 我用这些:
NSLog(@"%s", __FUNCTION__);
Then, when I'm done debugging, I comment them out. 然后,当我完成调试后,将其注释掉。 That way I can see what was the last method the app entered before it stopped.
这样,我可以看到应用程序停止之前输入的最后一种方法是什么。
您应始终调试应用程序运行不正常的原因,因为这可能是更严重问题的根本原因,例如内存损坏,这将导致该应用程序在登月后一直对每个客户崩溃相位变化只是一点点。
NSZombiesEnabled参数还有助于查找错误: http : //iosdevelopertips.com/debugging/tracking-down-exc_bad_access-errors-with-nszombieenabled.html
Sometimes the simulator gets confused. 有时模拟器会变得混乱。 Delete the content of ~/Library/Application Support/iPhone Simulator/6.1/Applications or thereabouts and try it again.
删除〜/ Library / Application Support / iPhone Simulator / 6.1 / Applications或附近的内容,然后重试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.