一, 本机有Reveal.app
应用一定要放入到Applications
文件夹里面, 不然找不到哟
二, 在当前用户的目录下, 编辑 ./.lldbinit
打开终端输入
vim ./.lldbinit

三, 在.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];
在这个文件中粘贴这四行代码. 保存退出
四,打开Xcode
在以下方法中打断点并右键编辑
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions


reveal_load_sim 对应模拟器
reveal_load_dev 对应真机
此时运行工程, 打开Reveal就可以查看了.
另
如果是真机调试, 需要把Reveal的动态库导入工程中


把图中的动态库导入工程即可.
注意:如果是真机调试, 需要手机和电脑在同一个网络里, 最好是 手机连接电脑发出的wifi
网友评论