iPhone 设备调试

iPhone Device Debugging(iPhone 设备调试)

本文介绍了iPhone 设备调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在设备上而不是模拟器上运行 iPhone 应用程序时,是否可以实际使用 Xcode 调试器?即,我可以让设备在我在代码中设置的断点处停止,并在代码在设备上运行时单步执行吗?

Is it possible to actually use the Xcode debugger when running an iPhone app on the device rather than the simulator? i.e., can I have the device stop at breakpoints that I set in my code and step through the code as it runs on the device?

我应该提到我是 Apple 的注册开发人员并且拥有有效的证书.事实上,我可以很好地在我的设备上构建和运行 iPhone 应用程序.但是,即使在调试模式下,当我在设备上运行应用程序时,它也不会在断点处停止或输出到控制台.如果有帮助,当我在模拟器中运行时,我的应用程序在调试模式下正常运行(例如,在断点处停止).

I should mention that I am a registered developer with Apple and have a valid certificate. In fact, I can build and run iPhone applications on my device just fine. However, even in Debug mode, my application will not stop on breakpoints or output to the console when I run it on my device. If it helps, my application will function normally in debug mode (e.g., stopping at breakpoints) when I run in the simulator.

编辑 2:我尝试过重置我的手机,完全删除并重新安装 Xcode,创建一个新项目,更改本页答案中提到的所有设置(以及其他设置),清理和构建我的项目,构建和调试...如果我单击暂停,它会显示来自调试器的错误:退出".:( 也许我会尝试在另一台计算机上使用 Xcode 在此设备上进行调试,看看会发生什么.

EDIT 2: I've tried resetting my phone, completely removing and reinstalling Xcode, creating a new project, changing all the settings mentioned in the answers on this page (as well as others), cleaning and building my project, Build and Debug... If I click Pause, it says "Error from Debugger: Quit". :( Maybe I'll try to debug on this device using Xcode on another computer and see what happens.

编辑 3:好吧,我尝试使用另一台计算机在新项目中使用全新安装的 Xcode,但我仍然无法进行设备调试.我怀疑它可能是我的 iPhone 或电缆?我想我并没有那么无能,以至于我错过了一些如此令人尴尬的显而易见的事情,但我已经仔细检查了这里提到的所有建议.

EDIT 3: Well, I tried using another computer using a fresh install of Xcode in a new project, and I still can't get device debugging to work. I have a suspicion that it's my iPhone or cable perhaps? I'd like to think that I'm not so incompetent that I've missed something so embarrassingly obvious, but I've double- and triple-checked all of the suggestions mentioned here.

编辑 4:终于让设备调试工作.我感觉我的设备上的一些低级别的东西导致了问题……我在我的系统上没有做任何事情.但是,我在另一个系统上安装了 Xcode,并且在同一设备(使用同一根电缆)上进行的设备调试工作完美无缺.紧接着,设备调试开始在我原来的机器上工作,让我相信一些奇怪的硬件标志被搞砸了,并以某种方式在第二台机器上重置".无论如何,它现在可以工作了......感谢所有帮助.:)

EDIT 4: FINALLY got device debugging to work. I have a feeling that something low-level on my device was causing issues...nothing I did worked on my system. However, I installed Xcode on another system and device debugging on the same device (with the same cable) worked flawlessly. Directly after that, device debugging began working on my original machine, leading me to believe that some strange hardware flag was screwed up and somehow "reset" on the second machine. In any case, it works now... Thanks for all the help. :)

另外,我不确定是不回答这个问题还是选择最有用"的答案更好...

Also, I'm unsure if it's better to leave this question unanswered or pick the most "helpful" answer...

推荐答案

是的——只需使用设备构建.您必须获得证书并提供它.

Yes -- just use a device build. You have to get certificates and provision it.

这是一个很好的描述:

http://boga.wordpress.com/2008/07/16/debugging-ipod-provision-profilescertificates/

这篇关于iPhone 设备调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:iPhone 设备调试

基础教程推荐