Home > Android, Mobile Security > Setting up proxy for android emulator

Setting up proxy for android emulator

Facing some issues in setting up a proxy from android emulator??

This article will tell you the steps you need to follow to set up the proxy for android applications using emulator.  For this you require three basic things i.e “Machine Connected to internet”,”Android SDK”,”Proxy Tools (Paros, Fiddler, Burpsuit etc)”. If we are ready with all these software, the first step is to setup the proxy server using any of these tools like paros, fiddler, burpsuit etc. I’ll show you how to do it with paros.

In paros go to Tool>>Options>>Local proxy and enter the address(127.0.0.1 for localhost) and port number(e.g. 8080) on which you want your proxy server should listen. Please refer to the screenshot below for the options page in paros.

Android Proxy Paros Settings

Android Proxy Paros Settings

If your machine is using a outgoing proxy server for accessing internet, you can enter these settings (including authentication details) in connection tab as shown below. Click on OK to save your setting and your proxy server is configured to listen on the address and port number you just mentioned.

Android Proxy Paros outgoing proxy settings

Android Proxy Paros outgoing proxy settings

The next step is to make some changes in emulator so that it sends all http requests to the proxy server we have just configured. The simplest method to do it is by changing the APN settings in the emulator. To change the APN settings in emulator, start the emulator and  go to Settings>>Wireless and networks>>Mobile networks>>Access Point Names and click on the APN name you are using (By default it’s Telkila). In ‘proxy’ and ‘port’ option you have to enter the address and port on which your proxy server is listening. So under proxy ideally we should write 127.0.0.1, and it should point to the localhost of the base machine, but in case of android emulator this ip will be localhost for emulator itself. To resolve this issue android emulator has some hardcoded ip addresses which will do this work for us. If we have to access base machine’s localhost the ip we have to use is 10.0.2.2. So under proxy mention “10.0.2.2” and under port mention the port number which you mentioned in proxy server (port 8080 in my case). Save your settings and your proxy setup is done.

Android Emulator Proxy Settings

Android Emulator Proxy Settings

Now if you try to open a website in emulator’s browser, proxy tool will be able to catch those requests. Now you can tamper any request and response and test your android app.

Google on Android Browser

Google on Android Browser

Tampering Request using Paros

Tampering Request using Paros

NOTE : Using this proxy environment you can only trap requests from emulator’s browser. I could not find a way through which you can trap requests going through apps installed in emulator. But you can use a alternate method to do so. My next article on ““setting-up-proxy-for-apps-in-android-emulator” will help you to do so.

You can watch this video to see how to use paros and echomirage to setup the proxy for android emulator or devices.

  1. September 16th, 2011 at 08:18 | #1

    You have really interesting blog, keep up posting such informative posts!

  2. bombard
    September 19th, 2011 at 13:16 | #2

    nice one… nice info sharing

  3. October 13th, 2011 at 20:50 | #3

    Thank you for this information! I used it for my diploma thesis =)

  1. August 25th, 2011 at 05:15 | #1

Switch to our mobile site