本文為工具類文章,參考至唐巧的博客
一羊始、模擬器調(diào)試
- vim ~/.lldbinit
- 在 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);
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];
- 含義:
- 1、reveal_load_sim 為模擬器加載 reveal 調(diào)試用的動(dòng)態(tài)鏈接庫(kù)
- 2查描、reveal_load_dev 為真跡加載 reveal 調(diào)試用的動(dòng)態(tài)鏈接庫(kù)
- 3突委、reveal_start 啟動(dòng) reveal 調(diào)試功能
- 4柏卤、reveal_stop 結(jié)束調(diào)試功能
- 在 AppDelegate 中, didFinishLaunchingWithOptions:中進(jìn)行如下操作匀油,
- 添加一個(gè)斷點(diǎn)缘缚,并右鍵點(diǎn)擊-> Edit Breakpoint
- 單擊 Action 右邊的+ 按鈕,輸入 reveal_load_sim
-
勾選 Options 上的 Automatically continue after evaluating 選項(xiàng)
打開 Reveal 就 ok 拉敌蚜。
附送效果圖:
屏幕快照 2015-12-06 下午11.14.16.png
二桥滨、真機(jī)調(diào)試
-
Help-> Show Reveal library in Finder, 然后將包拖入工程,這里弛车,Xcode 會(huì)將包放錯(cuò)地方齐媒,所以我們需要手動(dòng)調(diào)整一下,將包從 Link Binary With Libraries 中刪除纷跛,添加到 Copy Bundle Resources 下面喻括。
屏幕快照 2015-12-06 下午11.17.05.png-
從這里刪除
屏幕快照 2015-12-06 下午11.19.34.png -
在這里加上
屏幕快照 2015-12-06 下午11.19.43.png - 最后別忘修改斷點(diǎn)信息:將 reveal_load_sim 改成 reveal_load_dev 即可。
-