iOS 網絡調試庫:NetworkEye

jopen 9年前發布 | 11K 次閱讀 iOS開發 移動開發 NetworkEye

NetworkEye是一個網絡調試庫,可以監控App內所有HTTP請求并顯示請求相關的所有信息,方便App開發的網絡調試。

可以檢測到包括網頁,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)手勢調出監控數據界面NEHTTPEyeViewController 也可以用如下代碼直接present出來。
#if defined(DEBUG)||defined(_DEBUG)
    NEHTTPEyeViewController *vc=[[NEHTTPEyeViewController alloc] init];
    [self presentViewController:vc animated:YES completion:nil];
#endif

在NEHTTPEye.h里面有兩個可以配置的參數即默認數據庫密碼是networkeye和默認監控最多300條請求,請求的保存位置在緩存目錄的networkeye.sqlite內。
#define kSQLitePassword @"networkeye"

#define kSaveRequestMaxCount 300

NetworkEye使用了Aspects并且依賴倉庫SQLCipher。 Aspects用于搖一搖手勢,SQLCipher用于加密數據庫。

NetworkEye的監控數據界面如圖:


項目主頁:
http://www.baiduhome.net/lib/view/home/1446772727967

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!