IOS 界面調(diào)試方法和工具介紹【2015年10月】

簡(jiǎn)介:
1.xcode 6 以上支持 圖層調(diào)試,一鍵即可查看圖層布局
2.第三方UI調(diào)試工具(Reveal,Ponydebugger(Free),Spark Inspector)

No.1 Xcode 界面調(diào)試

在模擬器調(diào)試和真機(jī) 運(yùn)行調(diào)試的過程中 點(diǎn)擊 圖層調(diào)試按鈕,即可查看圖層分布


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

No.2 第三方工具

Reveal UI 調(diào)試工具
(1)安裝Reveal

自己 度娘一下 Reveal for mac (由于 病毒的教訓(xùn) ,就不貼某度的連接了)

(2)配置Reveal

參考連接
-度娘唐巧的Reveal 的使用
-reveal官網(wǎng)
【模擬器調(diào)試配置

  • step1 編寫 編譯器(LLDB)腳本
    在 mac OX 的 home 文件夾內(nèi)建立一個(gè)名為 .lldbinit 的文件 并寫入以下內(nèi)容
    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 回調(diào)中打上斷點(diǎn) 并設(shè)置斷點(diǎn)action 類型為debugger command 類型(LLDB 調(diào)試命令 類型) 并填寫命令標(biāo)識(shí) 為 reveal_load_sim (請(qǐng)勾選options :Automatically continue after evaluating actions)

2210454C-19EA-4F25-9EAC-8CFDDDA1FBFE.png
  • step3 選擇模擬器 運(yùn)行應(yīng)用 然后 reveal 里就會(huì)出現(xiàn) 模擬器選項(xiàng) 選擇即可
    【真機(jī)調(diào)試配置 】 正在完善 請(qǐng)期待 或者留言催促懶蛋筆者 。。。。
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容