IOS 界面调试方法和工具介绍【2015年10月】

简介:
1.xcode 6 以上支持 图层调试,一键即可查看图层布局
2.第三方UI调试工具(Reveal,Ponydebugger(Free),Spark Inspector)

No.1 Xcode 界面调试

在模拟器调试和真机 运行调试的过程中 点击 图层调试按钮,即可查看图层分布


CF372A3B-FD2D-4473-BB34-60D66403CFBC.png

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)

2210454C-19EA-4F25-9EAC-8CFDDDA1FBFE.png
  • step3 选择模拟器 运行应用 然后 reveal 里就会出现 模拟器选项 选择即可
    【真机调试配置 】 正在完善 请期待 或者留言催促懒蛋笔者 。。。。
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容