Reveal安装与使用

来源:互联网 发布:国债逆回购 知乎 编辑:程序博客网 时间:2024/06/05 23:59

参考文章:

1.最新Reveal安装、使用和调试

2.Reveal-iOS页面调试利器

Reveal是一款方便查看UI层级结构的工具(官方地址:点我哦),动态修改并且实时显示效果。

1.下载地址(第1篇文章提供,感谢):

a.下载附件中的Reveal:Reveal4-8796 pwd: 3irx。(使用破解版即可)

b.将附件包里面的Reveal.app,直接拖拽到应用程序目录(/Applications)

c.执行lldbinit.sh,打开终端并cdReveal4-8796目录,然后执行./lldbinit.sh (如果没有权限,先执行chmod 777 lldbinti.sh)或者(sh /users/xxx/lldbinit.sh)


2.模拟器调试(第1篇文章提供,尝试了前3种皆可,感谢),推荐第二种方式

a.第一种方式:需要将RevealServer.framework添加到Embedded Binaries中,如下图(附件中有framework,或者从Reveal应用的Help-->Show Reveal Library in Finder-->iOS Library中获取)


b.第二种方法:

b1.直接运行工程,成功后点击,如下图


b2.console中输入start,如下图,然后打开Reveal应用,就会发现正在运行的App。


c.第三种方法:

c1.⌘+8,进入show Breakpoint Navigator

c2.点击“+”,选择Symbolic Breakpoint...

c3.编辑断点,如下图

文本框内容:

expr (Class)NSClassFromString(@"IBARevealLoader") == nil ? (void     *)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer", 0x2) : ((void*)0)


c4.运行工程,断点继续执行,会在Console中打印:INFO: Reveal Server started (Protocol Version 32),打开Reveal查看即可。


3.真机调试(第2篇文章参考,感谢)

a.根据2中的a步骤,直接添加framework就可以了

b.如果不行,根据2中的c步骤,文本框添加下面内容

expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@“RevealServer” ofType:@“framework”] cStringUsingEncoding:0x4], 0x2)

c.如果还不行,查看第2篇文章。


4.越狱真机调试(第2篇文章参考,感谢),具体参考该文章。