在iOS端如何使用Charles用作http调试
2014-09-03 10:07
309 查看
在iOS端如何使用Charles用作http调试
After noticing that the caching in iPad Safari seemed a little funky, I made an effort to decipher some of the logic used by the browser cache. I didn’t get very far, but in the process I figured out how to route my iPad HTTP traffic through a web debugger
on my laptop. It turns out it was very easy to do (although I’m sure there is a more complicated way to go about it).
What follows is a simple step-by-step for connecting your iPad to an HTTP debugging proxy. The main requirement is that your desktop/laptop and iPad be on the same wireless network. Then it’s just a matter of telling your iPad to use your desktop as an HTTP
proxy.
I’m going to walk through how to do this on a Mac with the highly recommended HTTP proxy appCharles, but the same basic steps should
also work for a Windows HTTP debugger such as Fiddler. (Update: Fiddler users, see Eric Lawrence’s comment below.)
Additionally, the steps are the same for connecting your iPhone or iPod Touch.
1. Get your system IP address for your desktop
The easiest way to do this on a Mac is to Spotlight your way to the “Network Utility” app. Make sure you’re on your Wi-Fi network and take note of the IP address. This is your desktop’s local IP.
2. Tell your iPad about your desktop IP
On your iPad, go to Settings > Wi-Fi and click the arrow next your Wi-Fi connection. Under “HTTP Proxy”, select the Manual button and enter your desktop’s IP address in the Server field. Then enter “8888″ in the Port field. Close out.
3. Configure Charles
Open Charles and select Proxy > Proxy Settings. Under the Proxies tab, make sure the HTTP proxy value is set to 8888. Then click the “Mac OS X” tab and check “Enable Mac OS X Proxy” and “Use HTTP Proxy”. Click OK.
4. Start capturing HTTP traffic
Click the Record button in Charles and then load a web page in iPad Safari. You should see the following alert asking you if you want to allow your iPad to connect to Charles. Select “Allow”.
Now all of your HTTP traffic in iPad Safari should be recorded by Charles.
When you’re finished doing all of your fun HTTP debugging, don’t forget to turn
off the HTTP proxy in the Wi-Fi settings of your iPad.
After noticing that the caching in iPad Safari seemed a little funky, I made an effort to decipher some of the logic used by the browser cache. I didn’t get very far, but in the process I figured out how to route my iPad HTTP traffic through a web debugger
on my laptop. It turns out it was very easy to do (although I’m sure there is a more complicated way to go about it).
What follows is a simple step-by-step for connecting your iPad to an HTTP debugging proxy. The main requirement is that your desktop/laptop and iPad be on the same wireless network. Then it’s just a matter of telling your iPad to use your desktop as an HTTP
proxy.
I’m going to walk through how to do this on a Mac with the highly recommended HTTP proxy appCharles, but the same basic steps should
also work for a Windows HTTP debugger such as Fiddler. (Update: Fiddler users, see Eric Lawrence’s comment below.)
Additionally, the steps are the same for connecting your iPhone or iPod Touch.
1. Get your system IP address for your desktop
The easiest way to do this on a Mac is to Spotlight your way to the “Network Utility” app. Make sure you’re on your Wi-Fi network and take note of the IP address. This is your desktop’s local IP.
2. Tell your iPad about your desktop IP
On your iPad, go to Settings > Wi-Fi and click the arrow next your Wi-Fi connection. Under “HTTP Proxy”, select the Manual button and enter your desktop’s IP address in the Server field. Then enter “8888″ in the Port field. Close out.
3. Configure Charles
Open Charles and select Proxy > Proxy Settings. Under the Proxies tab, make sure the HTTP proxy value is set to 8888. Then click the “Mac OS X” tab and check “Enable Mac OS X Proxy” and “Use HTTP Proxy”. Click OK.
4. Start capturing HTTP traffic
Click the Record button in Charles and then load a web page in iPad Safari. You should see the following alert asking you if you want to allow your iPad to connect to Charles. Select “Allow”.
Now all of your HTTP traffic in iPad Safari should be recorded by Charles.
When you’re finished doing all of your fun HTTP debugging, don’t forget to turn
off the HTTP proxy in the Wi-Fi settings of your iPad.
相关文章推荐
- 在iOS端如何使用Charles用作http调试
- 在iOS端如何使用Charles用作http调试
- iOS开发工具-如何使用网络封包分析工具Charles,通过配置proxy对http、https、tcp、udp 等协议的请求响应过程交互信息进行分析、判断、解决我们移动开发中的遇到的各种实际问题。
- ios 如何使用 ASIHttpRequest进行http通信
- 使用charles远程调试iOS移动应用
- 如何使用 Charles 抓包并分析 Http 报文
- 如何使用Xcode分析调试在真机运行的UE4 IOS版游戏
- 如何使用Fiddler调试线上JS代码(转自:http://www.cnblogs.com/RockLi/p/3511132.html)
- 【开发工具】iOS真机调试抓包工具Charles安装及使用
- 如何使用ASIHTTPRequest从iOS端向服务器上传文件?
- 如何使用Xcode分析调试在真机运行的UE4 IOS版游戏
- 如何使用Charles抓包并分析Http报文
- iphone ios 如何在xcode中使用静态库(static lib),并能调试
- 如何调试iOS App中UIWebView和WKWebView使用的HTML文件
- iOS开发——使用Charles进行http网络抓包详解
- 如何使用iOS实现视频的直播、点播、缓存?-HTTP Live Streaming (HLS)
- mac使用charles 抓取 http请求,调试andriod 和 ios 手机网页
- Facebook发布的iOS开发调试工具“Tweaks”的使用体验如何?
- iphone ios 如何在xcode中使用静态库(static lib),并能调试
- iOS中的HTTP协议 如何使用GET和POST