下载 安装好Reveal之后 我们需要配置一下lldb 方便调试。
打开终端 输入vim ~/.lldbinit
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];
如图
备注:终端 显示所有文件指令 -ls -a 删除文件 rm ~/.lldbinit
到此 XCode就能够支持 模拟器 调试 了。
打开任意工程 在需要的地方打上断点 设置
或者直接在lldb输入
这样代表成功
运行工程 就能在Reval软件中看到我们的模拟器 如图:
到此 模拟器调试就已经成功,真机调试相对比较麻烦,我们要一步一来。
注意:之前调试了好久 也不能进行真机调试 最后使用了cocoapods集成了一下 下载了很多东西之后就可以。
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
真机调试需要Reveal的动态链接库:Reveal.framework和reveal.lib
在Reveal 中查看
拷贝这两个文件。
重点来了:
在Build Phases 中添加刚才复制的库
building一下 看看有木有报错!
出现这个问题 说明 没有在Build Setting 添加-ObjC -lz -framework Reveal
出现这个问题 说明 framework没有编译进工程当中 多添加几次
把Reveal.framework 放到Linker Binary With Libraries中编译
然后在放回Copy Bundle Resources去
编译不报错 打上断点
这样表示成功
之后就能在Reveal 上看到我们的程序了
大功告成!!!~
注意:1.mac和iPhone要在同一个网络下进行调试
2.要在Debug模式