下载破解
可以先在官网revealapp.com下载正式版本 接下要搞很牛逼的一步了,破解Reveal1.5.x通杀破解.zip_免费高速下载 (最近升级1.6.X的小伙伴,这破解方法依然有效哦)
使用
安装好Reveal后, 首先打开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)[(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调试功能
PS:
command alias 其格式为:command alias 别名 LLDB命令,因此如上reveal_start和reveal_load_sim就是我设置的别名。你们也可以替换成你们自己喜欢的名字
连接模拟器中调试
设置好以上指令后,在模拟器中使用,可以用两种方式
一、在项目中打个断点,运行项目,到app断点时,在控制台中输入LLDB命令reveal_load_sim
然后在输入reveal_start
即可在Reveal里审查你的UI元素了。
二、在AppDelegate类的 application: didFinishLaunchingWithOptions: 方法中作如下3步操作:
1.点击该方法左边的行号区域,增加一个断点,之后右击该断点,选择“Edit Breakpoint”。
2.点击”Action”项边右的”Add Action”,然后输入“reveal_load_sim”
3.勾选上Options上的”Automatically continue after evaluating”选项。
之后我们运行模拟器,然后打开Reveal,就可以在Reveal界面的左上角,看到有模拟器可以连接调试,选择它,则可以在Reveal中查看和调试该iOS程序的界面了。
连接真机调试
要用Reveal连接真机调试,我们需要先把Reveal的动态链接库上传到真机上。由于iOS设备有沙盒存在,所以我们只能将Reveal的动态链接库添加到工程中。
点击Reveal菜单栏的”Help”->”Show Reveal Library in Finder”选项(如下图所示),可以在Finder中显示出Reveal的动态链接库:libReveal.dylib
我们将libReveal.dylib文件拖动到目标Xcode工程中,Xcode默认情况下错误地将libReveal.dylib设置到了”Link Binary With Libraries”下,我们需要进行一下调整,将其中”Link Binary With Libraries”中删除,然后将其添加到“Copy Bundle Resources”下面。
之后用Reveal连接真机的方式和连接模拟器的方式类似,我们只需要把上一节提到的断点Action的内容从reveal_load_sim改成reveal_load_dev即可
PS:
如果有使用cocospods的小伙伴,可以加入
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
来引入库文件,这样做就可以不用修改原工程了
摘录:
http://chuansong.me/n/1308113
http://www.jianshu.com/p/51c539f61ab0