Grepping 或过滤 Xcode“设备”控制台
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29197608/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Grepping or filtering Xcode "Devices" console
提问by Julian
I'm debugging a Corona SDK app that I'm running on my iPhone. As I run the app it sends debug info that I can see in the Xcode "Devices" panel. Unfortunately that same console is littered with OS logs which make my own app's logs offscreen very fast. I can copy those into a file and grep them after I'm done but I would like to do so realtime so that I onlysee my own app's logs.
我正在调试在我的 iPhone 上运行的 Corona SDK 应用程序。当我运行应用程序时,它会发送调试信息,我可以在 Xcode“设备”面板中看到这些信息。不幸的是,同一个控制台上到处都是操作系统日志,这使得我自己的应用程序的日志在屏幕外的速度非常快。我可以将它们复制到一个文件中并在完成后 grep 它们,但我想实时这样做,以便我只能看到我自己的应用程序日志。
Is this possible? If so, how?
这可能吗?如果是这样,如何?
回答by Warren Stringer
As per https://developer.apple.com/documentation/os/logging?language=objc
根据https://developer.apple.com/documentation/os/logging?language=objc
Open /Applications/Utilities/Console.app
MacOS 10.12 and above. Works with AppleWatch.
MacOS 10.12 及更高版本。适用于 AppleWatch。
回答by Fabian
Just found this tool:
刚刚找到这个工具:
I have nothing to do with that company, just thought I post it here, because I wish I had found it earlier!
我与那家公司无关,只是想把它贴在这里,因为我希望我早点找到它!
Just install and you can live filter the device console - awesome :)!
只需安装,您就可以实时过滤设备控制台 - 太棒了 :)!
回答by Julian
After a few months of searching I found this:
经过几个月的搜索,我发现了这个:
https://github.com/benvium/libimobiledevice-macosx
https://github.com/benvium/libimobiledevice-macosx
It's a set of terminal commands that let you tail the device's logs and grep them to your heart's content.
它是一组终端命令,可让您跟踪设备的日志并将它们搜索到您想要的内容。
EDIT: A couple of years after posting this question it seems Apple did include this feature not in Xcode but in the Console app. I've changed the accepted answer to Warren Stringer's to keep this question current.
编辑:发布此问题几年后,Apple 似乎并未在 Xcode 中而是在控制台应用程序中包含此功能。我已经更改了 Warren Stringer 的公认答案,以保持这个问题的最新状态。