简体   繁体   English

使用XCode进行调试时,应用可以正常运行,在设备或模拟器上运行时,应用会崩溃

[英]When debugging with XCode, app works fine, when running it on device or simulator, app crashes

My application crashes when freely running it on a real device or in the simulator. 在真实设备或模拟器中自由运行时,我的应用程序崩溃。 When I'm running it with XCode attached, the app works fine. 当我在附加了XCode的情况下运行它时,该应用程序可以正常运行。

The app doesn't give me any errors and since I'm not running it with XCode attached, there is no message sent to the logger. 该应用程序没有给我任何错误,并且由于我没有在附加XCode的情况下运行它,因此没有消息发送到记录器。

Any idea of what could be wrong or how I could find out what causes this crash? 关于什么可能是错误的或我如何找出导致此崩溃的原因的任何想法?

Thanks! 谢谢!

If you just want to test in a device why don't you try through iTunes. 如果您只想在设备中进行测试,为什么不尝试通过iTunes。 Find the Target of your project in the Finder, then drag it to iTunes. 在Finder中找到项目的目标,然后将其拖动到iTunes。 You can then sync the applications. 然后,您可以同步应用程序。 This is not a solution but an alternative to run the app on your device. 这不是解决方案,而是在设备上运行应用程序的替代方法。

Thanks Aditya, 感谢Aditya,

The crash logs in the Organizer are actually very well detailed and they even include the line of code in the implementation file where the app crashed. 实际上,管理器中的崩溃日志非常详细,它们甚至在应用程序崩溃的实现文件中包含代码行。 When going to that line of code it seemed that I was CFRelease -ing a ABRecordRef, which is an integer of some kind...therefore I shouldn't release it 当转到那行代码时,似乎我是CFRelease-一个ABRecordRef,这是某种整数...因此,我不应该释放它

The weird thing is that it didn't crash or complain while debugging, but when running it on the device it did. 奇怪的是,它在调试时没有崩溃或抱怨,但是在设备上运行时却崩溃了。

You can read about CFRelease in detail in the following thread 您可以在以下线程中详细了解CFRelease

Cheers 干杯

暂无
暂无

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

相关问题 应用程式在装置上当机,但在Simulator上运作正常 - App crashes on device, however works fine on Simulator iOS 应用程序在设备上自行运行时崩溃,在使用调试器或在模拟器中通过 Xcode 运行时不会崩溃 - iOS App Crashes when running by itself on device, does not crash when running through Xcode using debugger, or in simulator 应用程序在模拟器上崩溃,但升级到狮子后在设备上运行正常 - App crashes on simulator but works fine in device after upgrading to lion Xamarin应用程序在设备启动时崩溃,在模拟器中运行良好 - Xamarin app crashes on startup on device, works fine in simulator 当应用程序在设备上的 Xcode 中运行时,MKMapView 使应用程序崩溃,但如果通过应用程序图标点击在设备上运行则不会 - MKMapView crashes the app when app is run in Xcode on a device but not if running on device by application icon tap 在设备上启动app的例外,在模拟器中工作正常 - Exception on app startup in device,works fine in simulator 应用在模拟器上崩溃。 适用于iPhone设备 - App crashes on simulator. Works on iphone device 在iPhone vs模拟器上运行应用程序时,应用程序崩溃 - App crashes when running app on iphone vs simulator 按下按钮时,iPhone 模拟器中的应用程序崩溃。 Xcode 3.2.5 - App crashes in iPhone simulator when button is pressed. Xcode 3.2.5 不从Xcode运行时应用程序崩溃,但从Xcode运行时运行正常 - Application crashes when not running from Xcode but works fine when run from Xcode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM