Search code examples
androidandroid-emulatorfiddler

Capture traffic from Android emulator to localhost?


How can I capture traffic from the Android emulator to a local webserver? Can I use Fiddler?

Thanks!


Solution

  • I found out a way to capture the traffic thanks to EricLaws comment.

    I had to use a reverseproxy and write a FiddlerScript rule. I added the following line

    if (oSession.host.toLowerCase() == "10.0.2.2:8888") oSession.host = "localhost:8082";
    

    in the OnBeforeRequest function. In my Android code I'm using the address 10.0.2.2:8888 to reach localhost:8082. Works great!