reveal 界面調(diào)試

http://blog.ittybittyapps.com/blog/2013/11/07/integrating-reveal-without-modifying-your-xcode-project/

Open up your favourite text editor, create the file .lldbinit file in your home directory and chuck the following LLDB command aliases into it:

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];```
越獄機(jī)器調(diào)試任意app

http://c.blog.sina.com.cn/profile.php?blogid=cb8a22ea89000gtw

首先打開(kāi)Terminal,輸入 vim ~/.lldbinit 創(chuàng)建一個(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);
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];

該步驟其實(shí)是為lldb設(shè)置了4個(gè)別名,為了后續(xù)方便操作,這4個(gè)別名意義如下:

reveal_load_sim 為模擬器加載reveal調(diào)試用的動(dòng)態(tài)鏈接庫(kù)
reveal_load_dev 為真機(jī)加載reveal調(diào)試用的動(dòng)態(tài)鏈接庫(kù)
reveal_start 啟動(dòng)reveal調(diào)試功能
reveal_stop  結(jié)束reveal調(diào)試功能

接下來(lái),我們?cè)贏ppDelegate類的 
application: didFinishLaunchingWithOptions: 方法中,作如下3步操作(如下圖所示):

點(diǎn)擊該方法左邊的行號(hào)區(qū)域,增加一個(gè)斷點(diǎn),之后右擊該斷點(diǎn),選擇“Edit Breakpoint”。
點(diǎn)擊”Action”項(xiàng)邊右的”Add Action”,然后輸入“reveal_load_sim”
勾選上Options上的”Automatically continue after evaluating”選項(xià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)容