ios iphone 将log在终端输出

对于模拟器,其在终端的log文件位于:   ~/Library/Logs/CoreSimulator/C4B94BA6-EF08-4AD2-AE7D-1A3A2E2AC545/system.log

 

对于真机:

Here‘s another tip using the great libimobiledevice library http://www.libimobiledevice.org/, originally built to manage iOS devices on Linux.
 
This method shows you how you can view the log output (e.g. what you see in Xcode when running in debug mode) on any app, whether it‘s an AppStore build or an AdHoc build.
 
Some apps are more talkative than others - it all depends on how careful the developers were to remove log messages in release builds.
 
I find this most useful for debugging issues in release versions of our apps. If a user reports a sequence of actions causes a crash, you can try this out while watching the log from your app.

Here‘s how:

 
Connect your device, open up Terminal.app and type:
 
idevicesyslog
 
Up pops a real-time display of the device‘s system log.

With it being a console app, you can filter the log using unix commands, such as grep


For instance, see all log messages from a particular app:

idevicesyslog | grep myappname

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。