在真实设备上测试时如何将数据从 iPhone 输出到控制台
我现在安静地使用 iPhone 模拟器一段时间,一切都很棒。但现在我想做下一步,将我的软件直接传输到我的 iPhone/iPad。所以我打算购买开发者许可证来这样做。但仍然存在一个问题:当使用 sim 时,我的控制台输出通过使用 NSLog 等显示在 Xcode 中。
例如:我想接收使用 MapKit 时获得的当前 GPS 数据。在模拟中,很容易将一些“假数据”记录到控制台。但是,在使用真实设备时,如何接收不断更新的 GPS 位置呢?当它不在 sim 中运行时,如何获取控制台输出?这可能吗?
I work with the iPhone simulator for quiet a while now and it's all great. But now I want to do the next step and transfer my software directly to my iPhone/iPad. So I am about to buy the developer license to do so. But one question still remains: When using the sim my console output is shown in Xcode by using NSLog for example.
So for example: I want to receive the current GPS data I get, when using the MapKit. In the sim it's quite easy to log to the console some "fake data". But how do I receive a constantly updating GPS position when using my real device? How do I get the console output when it is not run in the sim? Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 iDevice 上运行应用程序时,您仍然可以附加 XCode 作为调试器。您将能够使用控制台并逐步执行代码,就像它在模拟器中运行一样。
You can still attach XCode as a debugger when running your application on an iDevice. You'll be able to use the console and step through the code, just as if it was running in the simulator.
还有一个(免费)应用程序可以显示 iPhone 上的所有调试输出 - 请查看
http://itunes.apple.com/nl/app/console/id317676250?mt=8
它有时非常有用 - 我想当你想获得 GPS 输出时当您外出时,您的 Mac 不会在身边;-)。
There is also a (free) app that shows all debugging output on your iPhone - check out
http://itunes.apple.com/nl/app/console/id317676250?mt=8
It's sometimes quite useful - and I suppose when you want to get GPS output you won't have your Mac around when you're on the go ;-).
只需在调试模式下运行 iPhone 并保持连接即可。然后你应该在控制台中看到反馈!
Just run the iphone in debug mode and keep it connected. Then u should see the feedback in the console!