美文网首页
iOS10下打印NSLog syslog信息

iOS10下打印NSLog syslog信息

作者: sjjvenu | 来源:发表于2017-03-03 10:36 被阅读0次

在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

相关文章

  • iOS10下打印NSLog syslog信息

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

  • NSLog 打印全部信息

    NSLog 打印全部信息 宏定义 NSLog 打印中文 先写一个转义方法 NSLog 打印中文使用 可以在...

  • iOS多图选择器 PhotoKit (iOS 8以上,兼容iOS

    先说兼容iOS 10这一块有关相册需要注意的 ios10系统下真机NSLog,不打印数据,需要打印的话自行百度NS...

  • LLDB调试器

    前言 在iOS开发中经常使用NSLog进行打印调试,简单方便。NSLog每次调用会打印大量的信息,时间、名称、进程...

  • LLDB调试器

    前言 在iOS开发中经常使用NSLog进行打印调试,简单方便。NSLog每次调用会打印大量信息,时间、名称、进程等...

  • iOS开发中常用的宏定义

    iOS开发中常用的宏定义 尺寸宏 打印宏 替换NSLog来使用,debug模式下可以打印很多方法名,行信息。 #...

  • 关于使用OS_ACTIVITY_MODE

    这个属性的作用是清除掉NSLog的打印信息,在真机调试时如果使用NSLog来打印信息那么日志会全部被屏蔽掉,如果在...

  • 课程笔记:内存管理

    1、ARC下打印retainCount:NSLog(@"%ld",CFGetRetainCount((__brid...

  • IOS-APP安全加固问题

    1.系统打印不应该在正式环境下打印,避免逆向人员拿到ipa文件砸壳后,能直接看到打印信息, 解决办法:将NSLog...

  • IOS开发中 NSLog的处理

    NSLog 函数打印信息是 IOS 开发中最简单的代码调试方法,但是 NSLog 本身的性能很差,程序发布后,不应...

网友评论

      本文标题:iOS10下打印NSLog syslog信息

      本文链接:https://www.haomeiwen.com/subject/qtplgttx.html