NetworkEyeiOS 網(wǎng)絡(luò)調(diào)試庫
NetworkEye是一個網(wǎng)絡(luò)調(diào)試庫,可以監(jiān)控App內(nèi)所有HTTP請求并顯示請求相關(guān)的所有信息,方便App開發(fā)的網(wǎng)絡(luò)調(diào)試。
可以檢測到包括網(wǎng)頁,NSURLConnecttion,NSURLSession,AFNetworking,第三方庫,第三方SDK等的HTTP請求,非常方便實用。
NetworkEye,a iOS network debug library,It can monitor all HTTP requests within the App and displays all information related to the request.
Podfile
platform :ios, '7.0'pod "NetworkEye", "~> 0.9.3"
使用:
注意請在DEBUG模式下使用NetworkEye 在AppDelegate.m里面加入下面代碼就可以了
#import "NEHTTPEye.h" #if defined(DEBUG)||defined(_DEBUG) [NSURLProtocol registerClass:[NEHTTPEye class]]; #endif
使用的時候可以通過搖一搖(Shake Gesture)手勢調(diào)出監(jiān)控數(shù)據(jù)界面NEHTTPEyeViewController 也可以用如下代碼直接present出來。
#if defined(DEBUG)||defined(_DEBUG) NEHTTPEyeViewController *vc=[[NEHTTPEyeViewController alloc] init]; [self presentViewController:vc animated:YES completion:nil]; #endif
在NEHTTPEye.h里面有兩個可以配置的參數(shù)即默認數(shù)據(jù)庫密碼是networkeye和默認監(jiān)控最多300條請求,請求的保存位置在緩存目錄的networkeye.sqlite內(nèi)。
#define kSQLitePassword @"networkeye" #define kSaveRequestMaxCount 300
NetworkEye使用了Aspects并且依賴倉庫SQLCipher。 Aspects用于搖一搖手勢,SQLCipher用于加密數(shù)據(jù)庫。
NetworkEye的監(jiān)控數(shù)據(jù)界面如圖:
評論
圖片
表情
