I am trying to set up a network proxy to view emulator traffic.
Now if I make a change in network settings of emulator ( 10.0.2.2:< port >, things work fine. But if I try to set the proxy through command line using emulator -avd myAvd -http-proxy localhost:< port > , SSL traffic does not go through and I get time out errors.
Anyone has been able to get this working ?
Thanks
With the emulator open, click More , and then click Settings and Proxy. From here, you can define your own HTTP proxy settings. The -http-proxy option forces the emulator to use the specified HTTP/HTTPS proxy for all outgoing TCP connections.
Not sure which emulator you are using, but there is an issue with new
Android emulator announced with Android Studio 2 - Bug Tracker
To get a workaround, I had to do the following using the new
emulator set to API 23:
-http-proxy http://192.168.x.x:yyyy
as a flag when you are launching the emulator. For details how to do this, see here. Access Point
settings for the proxy within the emulator. To do this, you go to settings->more->cellular network->access point names and edit the existing Access Point.Developer Settings
for configuring the device to use the legacy DHCP client instead of the new one. This must be configured to use the legacy one.Airplane
mode on and off.
Check out comment #6 on https://code.google.com/p/android/issues/detail?id=201402#c6. If you use your computers LAN IP setting the proxy works using the -http-proxy command line switch and no other workarounds are necessary.
For example:
$ emulator -avd Nexus_5X_API_23 -http-proxy http://10.102.80.149:8888
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With