1、Reveal简介
Reveal是一个iOS程序界面调试工具。可以在Reveal上查看视图的层级和修改控件的属性,用来调试UI,查看应用的结构。
2、下载安装
2.1、官方下载
支持官方正品,软件收费89美刀,试用期30天。土豪链接:https://revealapp.com
2.2、破解版
开发者交流产品,严禁商业用途。友情链接:https://pan.baidu.com/s/1XPDgGXHQ2d4jO3lW72vOig 密码: m6nn
双击打开软件,可能会出现

如果出现如上图的错误提示,是由于没有打开【隐私】->【任意来源】,Mac OS升级之后已经去掉了这个选项,这个时候打开终端输入:sudo spctl --master-disable,回车键入密码,重新打开Reveal。
3、使用
官方有多种使用方法,这里推荐两种方法:
3.1、断点方式(模拟器使用)
打开XCode工程项目,点击断点处:

左下方添加断点:


做如下设置:
1、符号写UIApplicationMain;
2、添加Action事件为调试命令;
3、命令:expr (Class)NSClassFromString(@"IBARevealLoader") ==nil? (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib",0x2) : ((void*)0)
注:命令中的加粗地址为Reveal包中libReveal.dylib的地址。
4、勾选Options。

在断点右键,选择User选项。
Xcode运行项目,同时观察Reveal:

Reveal选择对应的项目,能看到运行的项目UI结构。
3.2、导入库文件方式(真机和模拟器都可用)
首先找到Reveal.framework文件:
依次打开:Finder->应用程序->Reveal->(右键显示包内容)->Contents->SharedSupport->iOS-Libraries->Reveal.framework。

XCode打开项目,把Reveal.framework导入项目中,添加依赖库libz,再添加-ObjC。


然后运行工程,打开Reveal,可以看到我们的真机项目了。
参考链接:
https://www.cnblogs.com/baitongtong/p/5863938.html
https://www.cnblogs.com/LiLihongqiang/p/6650114.html
https://www.jianshu.com/p/45dc72ec9499
网友评论