iOS学习之PonyDebugger调试工具
2016-08-27 本文已影响167人
龙马君
Pony Debugger 是一个远程调试工具包,通过使用 Chrome 开发者工具来调试 iOS 应用的网络流量和数据存储。同时提供一个 iOS 客户端库用来调试通过 NSURLConnection 和其 Core Data 堆栈发送的数据。


GitHub : https://github.com/square/PonyDebugger
安装:
服务器端
1. 安装 Xcode’s Command Line Tools
2. 在shell里面执行下面命令
curl -sk https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | \ python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
3. 安装成功以后,在shell里面执行
ponyd serve --listen-interface=127.0.0.1
4. 打开你的浏览器 输入地址
http://localhost:9000

说明服务器端已经安装好了。
.IOS 端
(1)安装cocoapoads
$ sudo gem install cocoapods
$ pod setup
(2)编辑Profile文件
pod 'PonyDebugger', '~> 0.3.1'
(4)安装
$ pod install
3.使用
在你的工程中,输入下面的代码:
PDDebugger *debugger = [PDDebugger defaultInstance];
[debugger enableNetworkTrafficDebugging];
[debugger forwardAllNetworkTraffic];
[debugger enableCoreDataDebugging];
[debugger connectToURL:[NSURL URLWithString:@"ws://127.0.0.1/device"]];
4.然后编译工程,运行,在浏览器中就可以浏览到信息了。
附录安装失败
安装PonyDebugger的一些坑
http://www.jianshu.com/p/1c64e0a1806d