打开终端(Terminal)
输入 vim ~/.lldbinit 创建一个名为.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)[(NSNotifictionCenter*)[NSNotificationCenter defaultCenter]postNotificationName:@"IBARevealRequestStart" object:nil];
command alias reveal_stop expr (void)[(NSNotifictionCenter*)[NSNotificationCenter defaultCenter]postNotificationName:@"IBARevealRequestStop" object:nil];
上述内容是为lldb设置4个别名,这样可以方便后续操作。
1、reveal_load_sim 为模拟器加载 reveal 调试用的动态链接库
2、reveal_load_dev 为真机加载 reveal 调试用的动态链接库
3、reveal_start 启动reveal调试功能
4、reveal_stop 结束reveal调试功能
记下来让用户看看如何让Reveal连接上模拟器
![2755775-46dc662b0559a546.png](https://i-blog.csdnimg.cn/blog_migrate/3b2e8000129a2b97f015da571361a0bf.webp?x-image-process=image/format,png)
cz@2x.png
连接真机操作步骤:
(1)找到 libReveal.dylib 文件
![2755775-0bd7213a4b63af00.png](https://i-blog.csdnimg.cn/blog_migrate/ccb7130e75532aff38fb9ed614226ea8.webp?x-image-process=image/format,png)
1@2x.png
(2)将libReveal.dylib 文件拖入工程中,选择“Copy Bundle Resources”
(3)
![2755775-4b9642f11c28ba24.png](https://i-blog.csdnimg.cn/blog_migrate/54482e624659d13d9143d2c49d103146.webp?x-image-process=image/format,png)
23@2x.png
(4) 将断点处 改成:reveal_load_dev