Reveal2通过lldb调试的方法

一、添加lldbinit文件

打开终端,输入如下指令:

vim ~/.lldbinit

然后将以下内容复制进入

command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer", 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];

指令的作用:

  1. reveal_load_sim 模拟器加载reveal调试用的动态链接库。
  2. reveal_load_dev 真机加载reveal调试用的动态链接库。
  3. reveal_start 启动reveal调试功能。
  4. reveal_stop 结束reveal调试功能。

二、添加BreakPoint

按下图进行设置:

打开breakpoint编辑界面

点击左下角的+,选择Symbolic Breakpoint

如图设置该断点,作用是程序启动时,断点自动启动。断点启动后,选择继续执行,reveal的库就动态添加到项目中了。此时再打开reveal,就可以查看你模拟器的项目了

三、reveal1.x和reveal2.x的区别

1.X  :  command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2);

2.X  :  command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer", 0x2);

主要区别是iOS-Libraries的库不一样了

参考链接

http://support.revealapp.com/kb/getting-started/load-the-reveal-server-via-an-xcode-breakpoint
http://blog.csdn.net/nadazero/article/details/52638696

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值