Reveal无侵入使用

2016-05-31  本文已影响196人  dpplh
$vim ~/.lldbinit
command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2);
command alias reveal_load_dev expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2);
command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:nil];

该步骤其实是为 lldb 设置了 4 个别名,为了后续方便操作,这 4 个别名意义如下:
reveal_load_sim 为模拟器加载 reveal 调试用的动态链接库
reveal_load_dev 为真机加载 reveal 调试用的动态链接库
reveal_start 启动 reveal 调试功能
reveal_stop 结束 reveal 调试功能

  1. 新增一个断点,编辑断点Edit Breakpoint
  2. 点击Action右边的Add Action输入"reveal_load_sim"
  3. 勾选Options上的"Automatically continue a er evaluating"

关于在Swift中使用Reveal报错问题

error: :1:8: error: consecutive statements on a line must be separated by ';'
解决方法:删除(void)*

command alias reveal_load_sim expr dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2)
上一篇 下一篇

猜你喜欢

热点阅读