博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在iOS端如何使用Charles用作http调试
阅读量:4111 次
发布时间:2019-05-25

本文共 2156 字,大约阅读时间需要 7 分钟。

在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 app, but the same basic steps should also work for a Windows HTTP debugger such as . (Update: Fiddler users, see Eric Lawrence’s  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.

iPad HTTP Proxy Network Utility

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.

iPad HTTP proxy settings

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.

Charles proxy settings

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”.

charles proxy alert

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.

转载地址:http://zjosi.baihongyu.com/

你可能感兴趣的文章
BODAS说明书的中文版与相关资料总结
查看>>
关于测控系统的CAN通讯协议总结
查看>>
从SpringMVC源码分析原理
查看>>
《Java编程思想第四版》中在算法题中常用的概念总结(持续更新)
查看>>
git常用工具的原理介绍以及项目使用中常见问题(持续更新)
查看>>
Java性能监控工具Arthas实践
查看>>
Java虚拟机(JVM)调优和Debug的常用参数详解
查看>>
Java内存溢出的典型场景测试
查看>>
操作系统之进程调度与内存管理
查看>>
分布式系统中的消息队列传递
查看>>
maven如何解决依赖冲突?示例三种bug的解决
查看>>
git的回滚操作
查看>>
记一次新建操作(insert)的优化过程
查看>>
摆桶问题
查看>>
TCP连接延伸7小问
查看>>
增量式PID控制算法的C++代码实现
查看>>
C#计时器timer的嵌套用法
查看>>
C#在word文档中生成多个报告
查看>>
查看linux信息
查看>>
Git: Github提示Key is already use
查看>>