1

I know how to set up the android emulator to proxy browser web traffic through a proxy like Charles or Fiddler2 but app traffic does not go through the proxy.

I am trying to debug an app and I need to see what the request\response is but cannot figure out how to set that up. I have tried the -http-proxy command line argument but that does not seem to do anything for me.

2 Answers 2

2

I believe the easiest thing to do is either:

  1. Capture traffic using a tool like wireshark, and filter based on the server address.

  2. Use a socks proxy that logs traffic, and use a socksify wrapper around the Android emulator

  3. Update the app to use proxy settings (details vary on the connection method you're using, e.g. HttpUrlConnection, WebView, raw sockets, ...). You should do this at some point anyway to improve compatability with different network setups, but not necessarily right now.

Sign up to request clarification or add additional context in comments.

1 Comment

Wireshark works, but captures TOO much traffic. Unfortunately it seems like its the only option as many blogs I've read mention the inability to properly proxy the Android emulator. Google needs to get its act together.
0

Any HTTP request need to resolve the domain name (to get the domain ip) by dns query, the emulator by default tries to get the machine dns server, but it not always works , for example in ubuntu emulator uses /etc/resolv.conf but it is obsolete. So when running emulator there is another flag that can be used -dns-server

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.