如何从iOS模拟器获取控制台日志? [英] How can I get the console logs from the iOS Simulator?

查看:150
本文介绍了如何从iOS模拟器获取控制台日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我没有在Xcode中测试应用程序,我想看看iOS模拟器中会发生什么。

I want to see what happens in the iOS Simulator if I'm not testing the app in Xcode.

例如,如果我在Safari中打开一个链接模拟器,看看控制台发生了什么,
或者如果我安装了一个网络应用程序,请参阅我在控制台中按下的链接。

For example, if I open a link in the Safari simulator, see what happens in the console, or if I install a web-app, see the links that I'm pressing in console.

怎么能我这样做了吗?

我想在Xcode或Terminal中看到它,但如果我需要使用另一部分软件,这不是问题。

I want to see it in Xcode or Terminal, but it's not a problem if I need to use another bit of software.

推荐答案

iOS模拟器>菜单栏>调试>打开系统日志

iOS Simulator > Menu Bar > Debug > Open System Log

旧方式:

iOS模拟器将其日志直接打印到stdout,因此您可以看到与系统日志混淆的日志。

iOS Simulator prints its logs directly to stdout, so you can see the logs mixed up with system logs.

打开终端并输入: tail -f /var/log/system.log

然后运行模拟器。

编辑:

这停止了工作在Mavericks / Xcode 5.现在您可以在自己的文件夹中访问模拟器日志:〜/ Library / Logs / iOS Simulator /< sim-version> /system.log

This stopped working on Mavericks/Xcode 5. Now you can access the simulator logs in its own folder: ~/Library/Logs/iOS Simulator/<sim-version>/system.log

你可以使用Console.app看到这个,或者只是做尾巴(例如iOS 7.0.3 64位):

You can either use the Console.app to see this, or just do a tail (iOS 7.0.3 64 bits for example):

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

这篇关于如何从iOS模拟器获取控制台日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆