iOS10下打印NSLog syslog信息

在iO10以前的版本越狱机器可以用socat方便的打印出NSLog信息,但在iOS10下由于日志系统发生了改变,以前一些打印方法失效。

The logging system has changed in iOS 10. Apple now uses what it calls "Unified Logging". Below are links to a brief overview, as well as a WWDC session covering the topic:

https://developer.apple.com/reference/os/logging

https://developer.apple.com/videos/play/wwdc2016/721/

Note that Apple claims that it is much more efficient (as it does not write to disk), and so it appears that there is no need to ever turn it off.


iOS10下可用deviceconsole这个工具打印系统日志,安装方法从git上下载源码https://github.com/MegaCookie/deviceconsole并编译,将编译好的二进制文件,放到/usr/local/bin下并保证执行权限。

deviceconsole是需要通过usb来连接手机,在终端中运行deviceconsole,并连上手机,操作说明如下:

Usage: deviceconsole [options]

Options:

-i | --case-insensitiveMake filters case-insensitive

-f | --filter Filter include by single word occurrences (case-sensitive)

-x | --exclude Filter exclude by single word occurrences (case-sensitive)

-p | --process Filter by process name (case-sensitive)

-u | --udid Show only logs from a specific device

-s | --simulator Show logs from iOS Simulator

--debugInclude connect/disconnect messages in standard out

--use-separatorsSkip a line between each line

--force-colorForce colored text

Control-C to disconnect

比如打印iOSRETargetApp这个app的信息,可用deviceconsole -i -f iOSRETargetApp命令,打印结果如下:

tdxs-Mac-mini:bin tdx$ deviceconsole -i -f iOSRETargetApp

Mar3 10:14:22 sjjvenumediaserverd(AudioToolbox)[269]:1067: pid 1103(iOSRETargetApp)

Mar3 10:14:25 sjjvenuiOSRETargetApp[1103]:addButtonTapped

Mar3 10:14:27 sjjvenuiOSRETargetApp[1103]:addButtonTapped

Mar3 10:14:27 sjjvenuiOSRETargetApp[1103]:addButtonTapped

Mar3 10:14:28 sjjvenuiOSRETargetApp[1103]:addButtonTapped

Mar3 10:14:55 sjjvenuiOSRETargetApp[1103]:addButtonTapped

Mar3 10:14:56 sjjvenuiOSRETargetApp[1103]:addButtonTapped

Mar3 10:15:37 sjjvenumediaserverd(AudioToolbox)[269]:1067: pid 1103(iOSRETargetApp)

Mar3 10:15:38 sjjvenumediaserverd(AudioToolbox)[269]:1067: pid 1103(iOSRETargetApp)

Mar3 10:17:00 sjjvenuSpringBoard[317]:Process exited: ->

Mar3 10:17:10 sjjvenuiOSRETargetApp(Flex.dylib)[1244]:FLXX: Loaded patches from: /var/mobile/Library/Application Support/Flex3/patches.plist

Mar3 10:17:10 sjjvenuiOSRETargetApp(libsystem_trace.dylib)[1244]:subsystem: com.apple.siri, category: Intents, enable_level: 1, persist_level: 1, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0

Mar3 10:17:10 sjjvenuiOSRETargetApp(iOSREHookerTweak.dylib)[1244]:====== Find Short C Function!

Mar3 10:17:10 sjjvenuiOSRETargetApp(iOSREHookerTweak.dylib)[1244]:[iOSREHookerTweak] Tweak.xm:51DEBUG:Hello Test HBLogDebug


推荐阅读更多精彩内容

  • 今天碰巧下载了QQ浏览器iOS版本,居然一启动就挂了。后来从手机里面把崩溃信息导出来,仔细研究下,把研究的结果放到...
    yqmfly阅读 1,497评论 1 1
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 119,534评论 16 134
  • 前些日子的《中国式相亲》果真是相亲界的一股泥石流,不仅把中国最现实的父母之命,媒妁之言搬到台上,而且摆事实,讲物质...
    阳台姑娘阅读 326评论 1 1
  • 独自行走 一路丰盛 这是这段人生路上给自己最好礼物 寂静欢喜
    小喜悦c阅读 58评论 0 0
  • 前段时间买了喜马拉雅上的一个课程《意公子艺术课》。 意公子何许人也?是一个能把艺术讲给普通人听的红娘。我一直关注她...
    寒晗Tylor阅读 142评论 0 0