Reveal-使用记录

作者: 勇不言弃92 | 来源:发表于2017-08-16 14:43 被阅读10次

本文转自Reveal-iOS页面调试利器
1.首先下载Reveal
2.新建 .lldbinit 文件
在 Home 目录(就是 ~ 目录)下新建 .lldbinit 文件,然后加入下面的内容:

command alias swift_reveal_load_sim expr dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 2)
command alias swift_reveal_load_dev expr dlopen(NSBundle.mainBundle().pathForResource("libReveal", ofType: "dylib")!, 2)
command alias swift_reveal_start expr NSNotificationCenter.defaultCenter().postNotificationName("IBARevealRequestStart", object: nil)
command alias swift_reveal_stop expr NSNotificationCenter.defaultCenter().postNotificationName("IBARevealRequestStop", object: nil)
command alias objc_reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2);
command alias objc_reveal_load_dev expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2);
command alias objc_reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
command alias objc_reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:nil];

swift_reveal_load_sim
为模拟器加载 Reveal 的动态链接库,以便可以用 Reveal 动态调试模拟器运行的应用程序的页面结构。用于 Swift 代码的工程;
swift_reveal_load_dev
为真机加载 Reveal 的动态链接库,以便可以用 Reveal 动态调试模拟器运行的应用程序的页面结构。用于 Swift 代码的工程;
swift_reveal_start
启动 Reveal 调试功能;
swift_reveal_stop
结束 Reveal 调试功能;
objc_reveal_load_sim
作用与 swift_reveal_load_sim 相同,只不过该命令用于 Obejective-C 代码的工程;
objc_reveal_load_dev
作用与 swift_reveal_load_dev 相同,只不过该命令用于 Obejective-C 代码的工程;
objc_reveal_start
作用与 swift_reveal_start 相同,只不过该命令用于 Obejective-C 代码的工程;
objc_reveal_stop
作用与 swift_reveal_stop 相同,只不过该命令用于 Obejective-C 代码的工程;

在 AppDelegate application:didFinishLaunchingWithOptions: 方法的中,按如下操作:
(1) 在 application:didFinishLaunchingWithOptions: 方法第一行代码前面点击行号添加一个断点,如下图:


屏幕快照 2017-08-16 14.37.26.png

使用模拟器时配置:注意下面的选择Options 中的 "Automatically continue after evaluating actions"。


屏幕快照 2017-08-16 14.37.54.png

打开reveal:

屏幕快照 2017-08-16 14.38.12.png

将"libReveal.dylib"拖拽到工程中


屏幕快照 2017-08-16 14.38.27.png

拖入后"libReveal.dylib"会自动加到Target -> Build Phases -> Link Binary With Libraries中,需要从中删除然后加到Target -> Build Phases -> Copy Bundle Resources 中。

运行项目后不会在上面的断点处停止,直接打开reveal选择链接设备

如果上面无法正常运行,可以在 Target -> Build Phases -> 添加一个 Run Script,并将以下内容填入:

set -e
if [ -n "${CODE_SIGN_IDENTITY}" ]; then
codesign -fs "${CODE_SIGN_IDENTITY}" "${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}/libReveal.dylib"
fi
2249791-aa12717a0064211a.png 2249791-a96d8ce92aee4c53.png

相关文章

  • Reveal-使用记录

    本文转自Reveal-iOS页面调试利器1.首先下载Reveal2.新建 .lldbinit 文件在 Home 目...

  • iOS逆向工程

    Reveal 首先机器要越狱 用cydia下载Reveal 在设置中查看Reveal,Reveal->Enable...

  • mtrace-内存使用追踪(内存)

    1. 函数格式: mtrace 用于开启内存使用记录,muntrace用于取消内存使用记录。内存使用情况记录到一个...

  • 学习MySQL---ing

    @[toc] Mac MySQL使用教程 本文记录在我的GitHub 记录使用Homebrew安装Mysql全过...

  • 转场动画

    presentation使用记录

  • [tf]tensorboard的使用

    使用tf.summary.scalar记录标量数据,使用tf.summary.histogram直接记录变量var...

  • iOS下FMDB的多线程操作(二)

    上一篇记录不使用FMDatabaseQueue来使用多线程,这一篇记录一下使用FMDatabaseQueue的方式...

  • 后端ing

    spring-cache使用记录 spring-cache的使用记录,坑点记录以及采用的解决方案深入分析 java...

  • vim 插件使用记录

    vim 插件使用 @(linux 编程)[开发技能, 工具使用] 前面记录过一篇vim操作记录此处记录一些vim的...

  • 美柚产品体验报告

    1、你平时有使用软件记录或者管理经期吗? 平时会使用薄荷健康记录经期,因为有段时间使用薄荷健康记录每餐的热量,发现...

网友评论

    本文标题:Reveal-使用记录

    本文链接:https://www.haomeiwen.com/subject/djuirxtx.html