Eclipse / Android - how to monitor device's HT

2019-07-20 15:44发布

问题:

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!