Reveal 1.5.1简单使用备忘

作者: shaneZhang 分类: ios技术 发布时间: 2015-07-19 02:25

1,在当前用户目录下,打开终端中新建一个.lldbinit文件

vim ~/.lldbinit
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];

2.连接到模拟器调试

在application:didFinishLaunchingWithOptions:方法中,进行以下几步,

  • 加一个断点,并右击编辑
  • 单击“Action”右边的“+”,输入“reveal_load_sim”
  • 勾选上“Option” 上的选项 “Automatically continue after evaluating”,

11

连接到真机调试

  • 添加Reveal链接动态库到我们工程:在Reveal菜单“Help”->”Show Reveal Library in Finder” 找到动态库后拖拽到工程中;

99517-62a93777652c1065

99517-67302b500f46992e

  • 注意Xcode默认是将其设置到“Link Binary With Libraries”中,需要删除它,并添加到 “Copy Bundle Resources”下面;

99517-da34f7567ebd834f

99517-a236d8e05c59a29d

  • 选中 Build Settings栏找到Linking下面的Other Linker Flags setting:

99517-e48e3976ae254be8

99517-9aaf294a1f34edc6

 -ObjC -lz -framework Reveal

在项目代理中的application:didFinishLaunchingWithOptions:方法中,进行以下几步,

  • 添加一个断点,并右击编辑
  • 单击“Action”右边的“+”,输入“reveal_load_dev”
  • 勾选上“Option” 上的选项 “Automatically continue after evaluating”,

99517-10ab9560cc4d4c22

运行项目,打开reaveal开始调试把

本页面支持繁体中文友好显示:Reveal 1.5.1简单使用备忘

如果觉得我的文章对您有用,请随意打赏。如果有其他问题请联系博主QQ(909491009)或者下方留言!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注