<p>Has anybody managed to get the Android Emulator working behind a proxy that requires authentication?</p>
<p>I've tried setting the -http-proxy argument to</p>
<pre><code>http://DOMAIN/USERNAME:PASSWORD@IP:PORT
</code></pre>
<p>but am having no success.</p>
<p>I've tried following the docs to no avail. I've also tried the <code>-verbose-proxy</code> setting but this no longer seems to exist.</p>
<p>Any pointers?</p>

[{'answer_id': 28406, 'author': 'dlamblin', 'author_id': 459, 'author_profile': 'https://Stackoverflow.com/users/459', 'pm_score': 2, 'selected': False, 'text': '<p>I\'ve not used the Android Emulator but I have set the $http_proxy environment variable for perl and wget and a few cygwin tools on windows. That might work for you for android, but the slash in the domain name seems like a potential problem.\nI know I tried having my domain "GLOBAL" in there, but ended up taking it out and sticking with: <code>http://$USER:password@www-proxy.company.com:80</code></p>\n\n<p>One problem I run into a lot though is programs that cannot be told to use the proxy for DNS queries too. In cases where they don\'t I always get a host name not found. I\'d like to find a local dns resolver that can use the proxy for all the programs that won\'t.</p>\n'}, {'answer_id': 40189, 'author': 'Naseer', 'author_id': 907, 'author_profile': 'https://Stackoverflow.com/users/907', 'pm_score': 4, 'selected': False, 'text': "<p>I remember having the same problem - After searching on the web, I found this solution - From the command line,</p>\n\n<pre><code>1. &gt; adb shell\n2. # sqlite3 /data/data/com.android.providers.settings/databases/settings.db\n3. sqlite&gt; INSERT INTO system VALUES(99,’http_proxy', 'proxy:port');\n4. sqlite&gt;.exit\n</code></pre>\n\n<p>EDIT:\nEdited answer to reflect the latest version of Android.</p>\n"}, {'answer_id': 1641977, 'author': 'Deepak Sarda', 'author_id': 143438, 'author_profile': 'https://Stackoverflow.com/users/143438', 'pm_score': 5, 'selected': False, 'text': "<p>It seems like SDK 1.5 onwards, the <code>-http-proxy</code> flag also doesn't work. What did work for me is to boot the android image in the emulator and then once Android is running, go to <code>Home &gt; Menu &gt; Settings &gt; Wireless Controls &gt; Mobile Networks &gt; Access Point Names</code> and then setup the http proxy settings for the default access point.</p>\n\n<p>With the APN proxy settings in place, I can get the emulator's browser to surf the web. However, other stuff like Maps still doesn't work.</p>\n"}, {'answer_id': 2330869, 'author': 'user280818', 'author_id': 280818, 'author_profile': 'https://Stackoverflow.com/users/280818', 'pm_score': 2, 'selected': False, 'text': "<p>Jay, though that would be the 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 the 2.1 emulator.</p>\n\n<p>The http-post argument does not work for the 2.1 emulator.\nSetting a proxy in the APN list within the 2.1 emulator does not work.\nInserting the proxy directly into the system table via sql-lite does not work with 2.1.</p>\n\n<p>In fact, the ONLY way to get the browser to connect to the internet via the emulator that I've found in 2.1, is to NOT use a proxy at all. I really hope this gets fixed soon, for there are many people with this same problem.</p>\n"}, {'answer_id': 2592745, 'author': 'arnouf', 'author_id': 449498, 'author_profile': 'https://Stackoverflow.com/users/449498', 'pm_score': 3, 'selected': False, 'text': '<p>Apparently this problems runs only with Android 2.x and Windows.\nThere is a opened bug here :\n<a href="http://code.google.com/p/android/issues/detail?id=5508&amp;q=emulator%20proxy&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars" rel="noreferrer">http://code.google.com/p/android/issues/detail?id=5508&amp;q=emulator%20proxy&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars</a></p>\n'}, {'answer_id': 3869611, 'author': 'Sandeep Singh', 'author_id': 467571, 'author_profile': 'https://Stackoverflow.com/users/467571', 'pm_score': 7, 'selected': True, 'text': '<p>I Managed to do it in the Adndroid 2.2 Emulator.</p>\n\n<pre><code>Go to "Settings" -&gt; "Wireless &amp; Networks" -&gt; "Mobile Networks" -&gt; "Access Point Names" -&gt; "Telkila"\n</code></pre>\n\n<p>Over there set the proxy host name in the property "Proxy"\nand the Proxy port in the property "Port"</p>\n'}, {'answer_id': 4458163, 'author': 'b-ryce', 'author_id': 469682, 'author_profile': 'https://Stackoverflow.com/users/469682', 'pm_score': 2, 'selected': False, 'text': "<p>I was able to view the traffic with an HTTP sniffer instead of a proxy. I used HTTPScoop, which is a nice little app.</p>\n\n<p>Also the nice thing about using HTTPScoop is that I can also see traffic on my actual device when I turn on internet sharing and have my phone use the wifi from my mac. So this is a good deal for debugging what happens on the phone itself AND the emulator.</p>\n\n<p>This way it doesn't matter what emulator you use, because the sniffer sees the traffic independent of the emulator, device, compiler settings etc.</p>\n"}, {'answer_id': 5297354, 'author': 'Glenn85', 'author_id': 619365, 'author_profile': 'https://Stackoverflow.com/users/619365', 'pm_score': 2, 'selected': False, 'text': '<p>This worked for me: <a href="http://code.google.com/p/android/issues/detail?id=5508#c39" rel="nofollow">http://code.google.com/p/android/issues/detail?id=5508#c39</a><br />\nApparently there\'s a bug in the emulator that forces you to use the IP address of the proxy instead of the name...</p>\n'}, {'answer_id': 5556686, 'author': 'Taranttini', 'author_id': 693547, 'author_profile': 'https://Stackoverflow.com/users/693547', 'pm_score': 3, 'selected': False, 'text': '<ol>\n<li><p>Find the file <code>androidtool.cfg</code> at <code>C:\\Documents and Settings\\YOUR USER NAME\\.android\\</code></p></li>\n<li><p>Add this line:</p>\n\n<pre><code>http.proxyLogin=USER@PASSWORD\n</code></pre></li>\n<li><p>Save the file and try to open the Android SDK.</p></li>\n</ol>\n'}, {'answer_id': 5604961, 'author': 'Sundaram', 'author_id': 673684, 'author_profile': 'https://Stackoverflow.com/users/673684', 'pm_score': 2, 'selected': False, 'text': '<p>I will explain all the steps:</p>\n\n<ol>\n<li>Go to settings in Android emulator > Wireless &amp; Network > Mobile network > Access point > Telkilla > and here do necessary settings such as proxy, port, etc.</li>\n</ol>\n\n<p>I think now everything is clear about proxy settings...</p>\n'}, {'answer_id': 5648741, 'author': 'prasad', 'author_id': 662336, 'author_profile': 'https://Stackoverflow.com/users/662336', 'pm_score': 2, 'selected': False, 'text': '<ol>\n<li><p>Start command prompt.</p></li>\n<li><p>Go the folder where your emulator is located. In general, it will be in the tools folder of the Android SDK.</p></li>\n<li><p>Then use the following command:</p>\n\n<pre><code>emulator -avd &lt;avd name&gt; -http-proxy &lt;server&gt;:&lt;proxy&gt;\n</code></pre>\n\n<p>By using this, we will be able to access the internet using the browser.</p></li>\n</ol>\n'}, {'answer_id': 6659684, 'author': 'bindu', 'author_id': 820935, 'author_profile': 'https://Stackoverflow.com/users/820935', 'pm_score': 2, 'selected': False, 'text': '<p>For Android2.3.3\nSettings->Wireless&amp;Networks->MobileNetworks->AccessPointNames->Telkila->\nset the Proxy and the Port here (xx.xx.xx.xx and port)</p>\n'}, {'answer_id': 6659743, 'author': 'bindu', 'author_id': 820935, 'author_profile': 'https://Stackoverflow.com/users/820935', 'pm_score': 2, 'selected': False, 'text': '<p>Using Android SDK 1.5 emulator with proxy in Eclipse 3.45</p>\n\n<p>Go to Package Explorer -> Right click your Android project ->Run As->Run Configurations.</p>\n\n<p>Under Android Application on the left column, select your project -> on the right column, where you see Android | Target | Common tabs -></p>\n\n<p>Select Target -> on the bottom “Additional Emulator Command Line Options”-></p>\n\n<p>-http-proxy <a href="http://www.gateProxy.com:1080" rel="nofollow">http://www.gateProxy.com:1080</a> -debug-proxy <a href="http://www.gateProxy.com:1080" rel="nofollow">http://www.gateProxy.com:1080</a></p>\n\n<p>->Run/Close.</p>\n'}, {'answer_id': 12068426, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': '<p>For setting proxy server we need to set APNS setting. To do this:</p>\n\n<ul>\n<li>Go to Setting</li>\n<li>Go to wireless and networks</li>\n<li>Go to mobile networks</li>\n<li>Go to access point names. Use menu to add new apns</li>\n<li>Set Proxy = localhost</li>\n<li>Set Port = port that you are using to make proxy server, in my case it is 8989</li>\n</ul>\n\n<p>For setting Name and apn here is the link:</p>\n\n<p>According to your sim card you can see the table</p>\n'}, {'answer_id': 29368559, 'author': 'Shahyad Sharghi', 'author_id': 216812, 'author_profile': 'https://Stackoverflow.com/users/216812', 'pm_score': 1, 'selected': False, 'text': '<p>I had the same problem when i use the following command:</p>\n\n<pre><code>emulator-x86.exe -http-proxy domain\\user:password@proxyIP:port -avd MyAVD\n</code></pre>\n\n<p>I got the proxy authentication error.</p>\n\n<p>Finally, I had to bypass the proxy NTLM authentication by using the Cntlm here:</p>\n\n<p><a href="http://sourceforge.net/projects/cntlm/" rel="nofollow">http://sourceforge.net/projects/cntlm/</a></p>\n\n<p>And then after simply configuring the cntlm.ini, I use the following command instead:</p>\n\n<pre><code>emulator-x86.exe -http-proxy 127.0.0.1:3128 -avd MyAVD\n</code></pre>\n\n<p>and it works :)</p>\n'}, {'answer_id': 50063005, 'author': 'Gaket', 'author_id': 3675659, 'author_profile': 'https://Stackoverflow.com/users/3675659', 'pm_score': 1, 'selected': False, 'text': '<p>With the new versions of Android Studio and its emulator, it is an easy task.</p>\n<p>Press the emulator\'s &quot;More&quot; button, and choose the Settings -&gt; Proxy tab. All the needed configurations are there.</p>\n<p><a href="https://i.stack.imgur.com/m4Q09.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m4Q09.jpg" alt="enter image description here" /></a></p>\n'}]
['https://Stackoverflow.com/questions/28380', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1281/']