Tuesday, November 20, 2007

Setting up proxy for Android Emulator

I think this information could be useful, is available at Android Group, but is difficult to find as messages there are growing, and the search could retrieve you a lot of messages related. So I want to paste here a message by Jason Chen that explains how to do it:

Here's how you can specify a proxy server for the Android browser.

1) Connect to the emulator using the "adb shell" command
2) Once you have a prompt, issue the following command:

sqlite3 /data/data/com.google.android.providers.settings/databases/
settings.db "INSERT INTO system
VALUES(99,'http_proxy',':');"

where and should be
replaced by the IP or hostname and port number, respectively, for the
proxy server you're using. (The command should be on one line.)

*Note*: you may need to restart the emulator for the change to be
recognized by the browser.

While in "adb shell", you can check to see if your proxy was added
correctly by issuing the following:

sqlite3 /data/data/com.google.android.providers.settings/databases/
settings.db "SELECT * FROM system"

If things worked correctly, you should see something like:

# sqlite3 /data/data/com.google.android.providers.settings/databases/
settings.db "SELECT * FROM system"
1|music_volume|3
2|voice_volume|3
3|ringer_volume|3
99|http_proxy|proxy.example.com:4242

To remove the proxy setting, issue the following command via "adb
shell":

sqlite3 /data/data/com.google.android.providers.settings/databases/
settings.db "DELETE FROM system WHERE _id=99"

0 comments: