iOS 网络调试库,NetworkEye 1.0 正式发布

jopen 8年前

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的监控数据界面如图:

来自:https://github.com/coderyi/NetworkEye