下载 安装好Reveal之后 我们需要配置一下lldb 方便调试。
打开终端 输入vim ~/.lldbinit
![](https://img.haomeiwen.com/i1754474/db3df5bfb2211240.png)
commandaliasreveal_load_devexpr(void*)dlopen([(NSString*)[(NSBundle*)[NSBundlemainBundle]pathForResource:@"libReveal"ofType:@"dylib"]cStringUsingEncoding:0x4],0x2);
commandaliasreveal_startexpr(void)[(NSNotificationCenter*)[NSNotificationCenterdefaultCenter]postNotificationName:@"IBARevealRequestStart"object:nil];
commandaliasreveal_stopexpr(void)[(NSNotificationCenter*)[NSNotificationCenterdefaultCenter]postNotificationName:@"IBARevealRequestStop"object:nil];
如图
![](https://img.haomeiwen.com/i1754474/852336ed9d62f66b.png)
备注:终端 显示所有文件指令 -ls -a 删除文件 rm ~/.lldbinit
到此 XCode就能够支持 模拟器 调试 了。
打开任意工程 在需要的地方打上断点 设置
或者直接在lldb输入
![](https://img.haomeiwen.com/i1754474/69c3832376699296.png)
这样代表成功
![](https://img.haomeiwen.com/i1754474/9e4d17363acaa0d9.png)
运行工程 就能在Reval软件中看到我们的模拟器 如图:
![](https://img.haomeiwen.com/i1754474/ad9940084c154d05.png)
到此 模拟器调试就已经成功,真机调试相对比较麻烦,我们要一步一来。
注意:之前调试了好久 也不能进行真机调试 最后使用了cocoapods集成了一下 下载了很多东西之后就可以。
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
真机调试需要Reveal的动态链接库:Reveal.framework和reveal.lib
在Reveal 中查看
![](https://img.haomeiwen.com/i1754474/ebdd77d96524b62a.png)
拷贝这两个文件。
![](https://img.haomeiwen.com/i1754474/a496849e3fd485a2.png)
重点来了:
在Build Phases 中添加刚才复制的库
![](https://img.haomeiwen.com/i1754474/c12a942c9ce7ff57.png)
building一下 看看有木有报错!
![](https://img.haomeiwen.com/i1754474/7b72e31760aa4b92.png)
出现这个问题 说明 没有在Build Setting 添加-ObjC -lz -framework Reveal
![](https://img.haomeiwen.com/i1754474/7a1ccaea56122fb6.png)
出现这个问题 说明 framework没有编译进工程当中 多添加几次
![](https://img.haomeiwen.com/i1754474/c779a4cfedca7f7a.png)
把Reveal.framework 放到Linker Binary With Libraries中编译
![](https://img.haomeiwen.com/i1754474/119c3ebdb5e64993.png)
然后在放回Copy Bundle Resources去
![](https://img.haomeiwen.com/i1754474/a4d75c509bf32a5e.png)
编译不报错 打上断点
![](https://img.haomeiwen.com/i1754474/bf4c385b06042526.png)
这样表示成功
![](https://img.haomeiwen.com/i1754474/6c8262cfc05aea2e.png)
之后就能在Reveal 上看到我们的程序了
![](https://img.haomeiwen.com/i1754474/d8234fbf1a4e2e65.png)
大功告成!!!~
注意:1.mac和iPhone要在同一个网络下进行调试
2.要在Debug模式
![](https://img.haomeiwen.com/i1754474/0dbdc5f39685a2ee.png)
![](https://img.haomeiwen.com/i1754474/251c428d0f67ae1d.png)
网友评论