Proxy requiring authentication using Android emulator

Has anyone been able to get the Android emulator to work behind a proxy server that requires authentication?

I tried setting the -http-proxy argument to

http://DOMAIN/USERNAME:PASSWORD@IP:PORT 

but I did not succeed.

I tried to follow the docs to no avail. I also tried the -verbose-proxy option, but that no longer exists.

Any pointers?

+49
android authentication proxy
Aug 26 '08 at 15:30
source share
15 answers

I managed to do this in the Adndroid 2.2 emulator.

 Go to "Settings" -> "Wireless & Networks" -> "Mobile Networks" -> "Access Point Names" -> "Telkila" 

There, the proxy host name is set in the "Proxy" property and the proxy port in the "Port" property

+41
Oct 06 '10 at 5:06
source share

It seems that SDK 1.5, the -http-proxy flag does not work either. Downloading the Android image to the emulator worked for me, and then when Android is running, go to Home > Menu > Settings > Wireless Controls > Mobile Networks > Access Point Names , and then configure the http proxy settings for the default access point.

With the APN proxy settings, I can make the emulator browser work on the Internet. However, other things, such as Maps, still do not work.

+25
Oct 29 '09 at 6:42
source share

I remember the same problem. After searching the internet, I found this solution. From the command line

 1. > adb shell 2. # sqlite3 /data/data/com.android.providers.settings/databases/settings.db 3. sqlite> INSERT INTO system VALUES(99,'http_proxy', 'proxy:port'); 4. sqlite>.exit 

EDIT: Edited answer to reflect the latest version of Android.

+14
02 Sep '08 at 18:13
source share

Apparently, these problems only work with Android 2.x and Windows. There is an open error here: http://code.google.com/p/android/issues/detail?id=5508&q=emulator%20proxy&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

+5
Apr 7 '10 at 13:26
source share
  • Locate the androidtool.cfg file in C:\Documents and Settings\YOUR USER NAME\.android\

  • Add this line:

     http.proxyLogin=USER@PASSWORD 
  • Save the file and try opening the Android SDK.

+5
Apr 05 '11 at 18:32
source share

To configure the proxy server, we need to install APNS. For this:

  • Go to setup
  • Go to wireless network and networks
  • Go to mobile networks
  • Browse to the names of the access points. Use the menu to add new apns
  • Set proxy = localhost
  • Set port = port that you use to create a proxy server, in my case it is 8989

To install Name and apn here is the link:

According to your SIM card you can see the table

+5
Aug 22 2018-12-12T00:
source share

This worked for me: http://code.google.com/p/android/issues/detail?id=5508#c39
Apparently, there is an error in the emulator that forces you to use the proxy IP address instead of the name ...

+4
Mar 14 '11 at 10:28
source share

Jay, although this would be an ideal place for this information, it has not been updated for 2.1. Below I will list the methods that currently DO NOT work for emulator 2.1.

The http-post argument does not work for emulator 2.1. Setting a proxy server in the APN list in emulator 2.1 does not work. Inserting a proxy server directly into the system table via sql-lite does not work with 2.1.

In fact, the only way to get the browser to connect to the Internet through the emulator that I found in 2.1 is to NOT use a proxy server at all. I really hope it gets better soon because there are a lot of people with the same problem.

+3
Feb 25 2018-10-25T00
source share
  • Run the command prompt.

  • Go to the folder where your emulator is located. In general, it will be in the Android SDK tools folder.

  • Then use the following command:

     emulator -avd <avd name> -http-proxy <server>:<proxy> 

    Using this, we will be able to use the Internet through a browser.

+3
Apr 13 2018-11-11T00:
source share

Using Android SDK 1.5 emulator with proxy in Eclipse 3.45

Go to Package Explorer -> Right-click on your Android project -> Run As-> Run Configurations.

In the Android application in the left column, select your project β†’ in the right column, where you will see Android | Purpose | General tabs β†’

Choose Target β†’ at the bottom of the β€œAdvanced emulator command line options” β†’

-http-proxy http://www.gateProxy.com:1080 -debug-proxy http://www.gateProxy.com:1080

-. > Run / Close

+3
Jul 12 '11 at 5:13
source share

I did not use the Android emulator, but I set the $ http_proxy environment variable for perl and wget and several cygwin tools on Windows. This may work for you for Android, but the slash in the domain name seems to be a potential problem. I know that I tried to use my GLOBAL domain there, but in the end I took it and stuck to it: http://$USER:password@www-proxy.company.com:80

One problem I am facing is programs that also cannot use the proxy server for DNS queries. In cases where they do not, I always get a hostname that is not found. I would like to find a local dns resolver that can use a proxy server for all programs that won't.

+2
Aug 26 '08 at 15:37
source share

I was able to view traffic using an HTTP sniffer instead of a proxy. I used HTTPScoop, which is a nice little application.

Also a nice thing about using HTTPScoop is that I can also see traffic on my device itself when I turn on Internet sharing and my phone uses Wi-Fi from my mac. So this is a good deal for debugging what is happening on the phone itself and the emulator.

Thus, it doesn't matter which emulator you use, because the sniffer sees traffic that is independent of the emulator, device, compiler settings, etc.

+2
Dec 16 '10 at 6:47
source share

I will explain all the steps:

  • Go to the settings in the Android emulator> Wireless and network> Mobile network> Access point> Telkilla> and make the necessary settings, such as proxy, port, etc.

I think now everything is clear about the proxy server settings ...

+2
Apr 09 '11 at 12:14
source share

For Android2.3.3 Settings-> Wireless & Networks-> MobileNetworks-> AccessPointNames-> Telkila-> set the proxy and port here (xx.xx.xx.xx and port)

+2
Jul 12 '11 at 5:01
source share

I had the same problem when I used the following command:

 emulator-x86.exe -http-proxy domain\user:password@proxyIP:port -avd MyAVD 

I got a proxy authentication error.

Finally, I had to bypass NTLM proxy authentication using Cntlm here:

http://sourceforge.net/projects/cntlm/

Then, after a simple setup of cntlm.ini, I use the following command instead:

 emulator-x86.exe -http-proxy 127.0.0.1:3128 -avd MyAVD 

and it works :)

+1
Mar 31 '15 at 12:21
source share



All Articles