界面调试工具Reveal的使用介绍

来源:互联网 发布:网络现货 编辑:程序博客网 时间:2024/04/29 20:11

Reveal


注: 此处介绍Reveal,其中大部分内容来自于唐巧的《iOS开发进阶》一书,以此说明。


如何使用Reveal进行模拟器调试,只需进行以下三个步骤即可。


1. 创建.lldbinit文件


vim ~/.lldbinit


2. 输入以下内容,创建别名


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];



其中各个别名的含义:

  •  `reveal_load_sim` 为模拟器加载reveal调试用的动态链接库
  •  `reveal_load_dev` 为真机加载
  •  `reveal_start` 启动reveal调试功能
  • *`reveal_stop` 结束reveal调试功能


3. 增加断点

定位到AppDelegate类中的`application:didFinishLaunchingWithOptions:`方法,进行以下三个步骤:
  1. 增加一个断点,右键单击断点,选择`Edit Breakpoint`
  2. 单击`Action`,然后输入`reveal_load_sim`
  3. 勾选上`Options`上的 `Automatically continue after evaluating`






1 0
原创粉丝点击