Use the Android SDK Emulator with Eclipse behind a Proxy

In the office we have a pretty stern internet proxy and I needed to test something from the Android Emulator using the network today, and therefore the Proxy. This seemed like a simple thing to do, and there are instructions for adding proxy information when launching the Emulator  on the Android Developer site (http://developer.android.com/guide/developing/tools/emulator.html#proxy). So I went into preferences for Eclipse, chose the Android preferences and sure enough, on the lunch tab there is a field for parameters when launching the Emulator. I added the proxy string there as per the document (-http-proxy user:pass@server:port) e.g.

-http-proxy http://user:pass@proxy.example.com:1234

but it did not seem to take. A little searching in some forums solved this however. I am adding it here with a title that matches what I was searching for via Google so that the next person can find it without reading a lot of forum threads.

The trick is that you need to add this info on for the project you are going to be running it from, and there is a convenient place to do so in Eclipse. With the project selected,  choose “Run” from the menu bar at the top, then “Run Configurations” This will show all the run configurations, and have the current project selected. You can also choose the Run/Configurations items from any project and select the correct one once inside. Once a configuration is chosen, choose the “Target” tab from the tabs on the right side of the Run Configurations dialog and look for the Text field labeled “Additional Emulator Command Line Options”. I had to resize the Dialog window to get this box to appear as there are no scrollpanes used there (I am using Linux version 3.5.2. of Eclipse). Below are a couple screen shots of these dialogs.



About these ads

About Jayson
Father, mountain biker, Software developer at a wire service, and also work with the IPTC (iptc.org)

3 Responses to Use the Android SDK Emulator with Eclipse behind a Proxy

  1. SHFM says:

    Thanks for the tip, very helpful.

  2. Renaldo says:

    Thanks this helped me, really appreciate it

  3. Zak D. says:

    Exactly what I needed! Thanks for restoring my sanity.

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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: