Eclipse / Android - how to monitor device's HTTP traffic

ぐ巨炮叔叔 提交于 2019-12-11 02:48:41

问题


I have my device connected to debug Android apps, but I need to see the HTTP requests and responses (inc. header info).

I've seen a similar question asked on how to do this for an emulator, but how to do this when a real device is connected?


回答1:


You can use Charles, is a really powerful tool that does exactly what you need.

Charles allows you to sniff the packets sent through HTTP from your actual device, the way you use it is simple:

  • Download and install Charles, run the program and specify the proxy port
  • Connect the Android Device to the very same network of the computer running Charles
  • Go to Wifi-Settings in Android Device and long tap on the network connected, then go to Modify Network-> Show advanced Options
  • Set Proxy as Manual and in Proxy Host name set your computer IP "192.xxx.x.x" and in the Proxy port add the same port specified in Charles Proxy Settings.

And that's it, all the traffic from your phone will be proxy to charles and it will show you headers, parameters, etc...

Hope it Helps

Regards!



来源:https://stackoverflow.com/questions/22077533/eclipse-android-how-to-monitor-devices-http-traffic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!