Xcode8 Swift3 使用Reveal

很久没调试UI了,由于新的工程采用全程Swift编写,可预知的是Reveal的dlib加载方式已经扑街了(实际测试确实扑街)。

晚上搜了下,貌似这玩意儿就国内玩的人多,网上教程也比较旧,基本上都是dylib的断点加载方式,对于Reveal 2以后的版本都是采用的Framework加载。

老版本(dylib)-> ~/.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 nil];

更新:2017-03-19
Reveal 2以后的新版本(Framework)-> ~/.lldbinit

Objective-C:

command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer", 0x2);
command alias reveal_load_dev expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"RevealServer" ofType:@"framework"] 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 nil];

Swift:

command alias swift_reveal_load_sim expr dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework/RevealServer", 2)
command alias swift_reveal_load_dev expr dlopen(NSBundle.mainBundle().pathForResource("RevealServer", ofType: "framework")!, 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)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 15,916评论 4 61
  • 嗯哼嗯哼蹦擦擦~~~ 转载自:https://github.com/Tim9Liu9/TimLiu-iOS 目录 ...
    philiha阅读 5,281评论 0 6
  • 碎碎叨叨,想写点什么,也许难得周六下午的落空是一种失落在作祟,总觉得这是难得的黄金时间居然就这么虚度了,总有点不甘...
    沉淀123阅读 248评论 0 3
  • 早上面试了一个校友妹子,她还是给我留下了深刻的印象,因为感觉她把这个面试变成了一个相互学习的过程。而且提出了很多尖...
    兔子公园阅读 656评论 0 2
  • 关于回头炮,我一向来的态度是拒绝的。因为光看这三个字的组成,就包含着太多欲说还休的情感和纠缠,不论从理性还是感性的...
    ca5eff908329阅读 1,156评论 0 1

友情链接更多精彩内容