- 断点调试,不需要像项目中添加库,适合多人开发。
- 在终端中
cd ~
- 创建
touch .lldbinit
文件,如果已经有此文件可以不重复创建 open .lldbinit
,然后拷贝下面的代码到文件中保存即可然后在工程的
didFinishLaunchingWithOptions
中的任一行添加可编辑断点,如果是oc的工程,添加objc_reveal_load_sim
,如果是swift项目,添加swift_reveal_load_sim
重命名 添加动态库的命令
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];
reveal 断点调试 oc / swift
最新推荐文章于 2025-01-11 07:50:50 发布