如果我没有在Xcode中测试应用程序,我想看看iOS模拟器中会发生什么。
例如,如果我在Safari模拟器中打开链接,请查看控制台中发生的情况,或者如果我安装了Web应用程序,请查看我在控制台中按的链接。
我怎样才能做到这一点?
我想在Xcode或Terminal中看到它,但是如果我需要使用其他软件也不是问题。
iOS模拟器>菜单栏>调试>打开系统日志
老办法:
iOS Simulator将其日志直接打印到stdout,因此你可以看到日志与系统日志混合在一起。
打开终端并输入: tail -f /var/log/system.log
然后运行模拟器。
编辑:
这停止了在Mavericks / Xcode 5上的工作。现在,你可以在其自己的文件夹中访问模拟器日志: ~/Library/Logs/iOS Simulator/<sim-version>/system.log
你可以使用Console.app查看此内容,也可以只做一条尾巴(例如iOS 7.0.3 64位):
tail -f ~/Library/Logs/iOS\ Simulator/7.0.3-64/system.log
编辑2:
他们现在位于 ~/Library/Logs/CoreSimulator/<simulator-hash>/system.log
tail -f ~/Library/Logs/CoreSimulator/<simulator-hash>/system.log
这仍然准确吗?我没有
console.log
在这些日志中使用tail
或看到任何内容Console.app
iOS模拟器>菜单栏>调试>打开系统日志
谢谢!但这几天它的〜/ Library / Logs / CoreSimulator / <simulator-hash> /system.log。
BYossarian的答案是“正确”的答案。“桌面浏览器中的“开发”菜单,可让您查看iOS模拟器控制台:“开发”->“ iPhone模拟器”->“站点名称””
如果您不确定
<simulator-hash>
要使用的是什么(我曾经使用过),也可以简单地执行:tail -f ~/Library/Logs/CoreSimulator/*/system.log
这将呈现所有内容,但仅保留更新后的内容(很可能是正在运行的内容)。