Tutorial: Getting Android Emulator Working With Fiddler (HTTP Proxy Tool)

Posted: March 22, 2010 in Uncategorized

UPDATE: Another great option is to use GenyMotion and configure it to use Fiddler as a proxy.

Ok, I wrestled with this for days, but finally have it figured out. If you’re trying to make the Fiddler HTTP Proxy work with the Android emulator so you can debug web services and the like, here’s how to do it:

Configuring Fiddler

First we need to configure Fiddler to accept traffic from the emulator. In this case I am running Fiddler on the machine that is also hosting the emulator.

1. Start Fiddler

2. Go to Tools, then Fiddler Options

image
Figure: Going to Tools –> Fidler Options

3. Configure General and Connections tabs to look like the ones below:

image
Figure: The General tab’s settings

image
Figure: The Connections tab’s settings

4. Click OK

5. Quit and Relaunch Fiddler (important!)

6. Enable the Streaming feature in Fiddler so HTTP requests are shown as they occur.

image
Figure: The streaming option in Fiddler (shown in disabled state)

Configuring the Emulator

1. Start the emulator

2. Go to Settings, then Wireless controls

image
Figure: Wireless controls option

It is normal for tapping Wireless controls to cause a crash. Just try again and it will work. Don’t ask me why the emulator is so buggy – complain to Google.

3. Tap Mobile networks

image
Figure: Mobile networks option

4. Select Access point names

image
Figure: Access point names option

5. Choose the selected access point and configure the following options:

- Name : Internet
- APN : Internet
- Proxy : Fiddler’s proxy IP address (10.0.1.26 in my case)
- Port : Fiddler’s proxy IP port (8888)
- Username : <Not set> (clear it if anything is already there)
- Password : <Not set> (clear it if anything is already there)
- MCC : 310
- MNC : 260

Don’t play with any of the other settings!

image

Note: This part is special thanks to Xeros who posted to this thread.

6. Press MENU and then press Save

image

7. Keep going back until you’re at the home screen. I don’t know if this makes a difference, but I’m just making sure…

8. Try loading a Web site and you should see the traffic in Fiddler.

image
Figure: Web traffic still works, but is flowing through Fiddler.

image
Figure: Traffic being captured in Fiddler.

That should do it!

Note: You may need to disable Windows Firewall to make this work. Obviously I don’t need to tell you not to do this on a public network.

If you have any questions, please let me know on our support site.

Comments
  1. mike says:

    Thanks for the instructions. I\’m seeing traffic in Fiddler from the web browser, but not when using other data enabled apps (like a Twitter or news client). Any suggestions on how to capture non-browser traffic in Fiddler as well?

  2. Auri says:

    It\’s hit or miss on that one … I\’m working on those answers and will post as soon as I find out!

  3. Ruben dario says:

    bien

  4. Sandeep says:

    I followed your settings to set up fiddler and android emulator, but I’m still not able to see the traffic. The only thing I noticed that was different from ur settings is I don’t see a “3G Connection” in my fiddler options–>Connections. Both fiddler and emulator are on the same machine.
    How was this added?

    • Sandeep says:

      forgot to add
      - I’m calling a web service from an android app
      - Emulator version is 2.2
      - I can see the request by putting the web service in debug mode, but I need the soap envelope to investigate further

  5. Bryan Anderson says:

    I just followed this tutorial and it was extremely helpful. I was able to capture traffic from the android browser just like I needed. Thanks for sharing!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s