简介:
1.xcode 6 以上支持 图层调试,一键即可查看图层布局
2.第三方UI调试工具(Reveal,Ponydebugger(Free),Spark Inspector)
No.1 Xcode 界面调试
在模拟器调试和真机 运行调试的过程中 点击 图层调试按钮,即可查看图层分布
No.2 第三方工具
Reveal UI 调试工具
(1)安装Reveal
自己 度娘一下 Reveal for mac (由于 病毒的教训 ,就不贴某度的连接了)
(2)配置Reveal
参考连接
-度娘唐巧的Reveal 的使用
-reveal官网
【模拟器调试配置
step1 编写 编译器(LLDB)脚本
在 mac OX 的 home 文件夹内建立一个名为 .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);
commad alias reveal_start expr (void)[(NSNotificationCenter)[NSNotificationCenter Default]postNotificationName:@"IBAReavalRequestStart" object:nil];
command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter]postNotificationName:@"IBARevalRequestStop" object:nil];step2 在app delegate的**-(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions 回调中打上断点 并设置断点action 类型为debugger command 类型(LLDB 调试命令 类型) 并填写命令标识 为 reveal_load_sim (请勾选options :Automatically continue after evaluating actions)
- step3 选择模拟器 运行应用 然后 reveal 里就会出现 模拟器选项 选择即可
【真机调试配置 】 正在完善 请期待 或者留言催促懒蛋笔者 。。。。