gavanwanggw

导航

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

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`






posted on 2017-06-03 15:07  gavanwanggw  阅读(174)  评论(0编辑  收藏  举报