sudo spctl --master-disable mac開放權(quán)限
-ObjC -weak_framework RevealServer 配置路徑
1.下載一個正版的reveal來安裝。
2.打開終端,輸入vim ~/.lldbinit創(chuàng)建一個名為.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];
該步驟其實是為lldb設(shè)置4個別名,這樣方便以后操作,這4個別名的意義如下:
1)reveal_load_sim 模擬器加載reveal調(diào)試用的動態(tài)鏈接庫。
2)reveal_load_dev 真機加載reveal調(diào)試用的動態(tài)鏈接庫。
3)reveal_start 啟動reveal調(diào)試功能。
4)reveal_stop 結(jié)束reveal調(diào)試功能。
3.在AppDelegate類的application:(UIApplication *)application didFinishLaunchingWithOptions:方法中接入下面3個操作,如下如:
增加一個斷點,右擊斷點,選擇"Edit BreakPoint".
單擊"Action"右邊的"Add Action",然后輸入"reveal_load_sim".
勾選上"Options"上的“Automatically continue after evaluating actions”選項。
之后運行我們運行模擬器,打開reveal,就可以在reveal界面左上角看到有模擬器可以選擇調(diào)試,選擇它,則可以在reveal中查看調(diào)試iOS程序的界面了。
4.用revea連接真機(補充:似乎現(xiàn)在這個方法已經(jīng)不生效了)
要用reveal連接真機調(diào)試,我們需要先把reveal的動態(tài)鏈接庫上傳到真機上。由于iOS設(shè)備有沙盒存在,所以我們只能將reveal的動態(tài)鏈接庫添加到工程里。
1)選擇reveal菜單欄的"Help"->"Show Reveal library in Finder"選項,可以在Finder中找到Reveal的動態(tài)鏈接庫libReveal.dylib.
2)將該文件拖到工程里,Xcode默認將libReveal.dylib設(shè)置到"Link Binary With Libraries",我們需要進行調(diào)整,將"Link Binary With Libraries"中的libReveal.dylib刪除,再將其添加到"Copy Bundle Resources"下面。
3)之后用Reveal連接真機的方式和連接模擬器的方式類似,我們只需把上面提到的斷點Action的內(nèi)容從reveal_load_sim改成reveal_load_dev即可。
補充:1.關(guān)于正版reveal的使用
reveal時收費的,所以。。。,它有30天的試用期,到30天過期后,到~/Library/Preferences/com.ittybittyapps.Reveal.plist,把這個plist文件刪除,然后重啟電腦,就可以了。雖然麻煩點兒,將就著使吧。
2.在打包上傳的時候libReveal.dylib是需要刪除的,不然會報錯。
wireshark 使用
尋找http請求
http
查找接口:
http.request.uri matches "/clt/getAdviseIn"
連接抓包設(shè)備 UDID
rvictl -s iphone設(shè)備id
斷開抓包設(shè)備
rvictl -x iphone設(shè)備id