The Android emulator sets the network proxy method

Source: Internet
Author: User

--http-proxy is added when the emulator is started on the server, but it does not work. So I searched the following way.

Four methods:

One: Write network connection proxy settings to the configuration database (for boot emulator no interface) 1. Open the emulator via the command line or by double-clicking the emulatoer executable file2. Execute the ADB shell on the command line to open the Android console (make sure that the environment variable is set correctly, that the android_sdk/tools has been added to path (Linux )/path (Windows) )3. Perform ls-l/data/data/com.android.providers.settings/databases/settings.db to see if the System settings database file exists4. If the database file exists, execute sqlite3/data/data/com.android.providers.settings/databases/ Settings.db, starting with settings.db as the current scheme SQLITE35. Execute INSERT INTO system VALUES (' http_proxy ', ' 192.168.0.245:8080′ '), statement insert data, Where 192.168.0.245 is the proxy server I use ip,8080 is the port, please replace It according to the specific situation6. Execute SELECT * from System to view the data just inserted7. Restart the emulator for the proxy server settings to take effect 8. You can use the delete from System WHERE _id=99; statement to remove proxy settings, or use the UPDATE system set value = ' 192.168.0.245:8070′where _id=99; Change proxy server settings
Two: May be a problem with DNS1. Use system commands to access the Tools directory of the Android development KitCD sdk/tools 2. Use the shell of ADB to confirm the various properties of the systemadb shell Getprop Getprop Lists the current properties of the system3. Get the DNS address of the simulatorin the results you can see :[net.dns1]: [10.0.2.3] [Net.dns2]: [10.0.2.4] 4. Change DNS to our own DNS setprop net.dns1 192.168.1.1 Note: General Tp-link and D-Link DNS are 192.168.1.1, if not please use the Ipcnofig/all command to confirm.
three: Directly with the parameters to start the simulator (this is configured before, but it does not work, specifically did not delve into)emulator @default-http-proxy 10.16.xx.xx:8080 where default is the name of the emulator
Four: Set in simulator (with graphical interface) start the emulator and then enter Settings->wireles


Reference: http://blog.sina.com.cn/s/blog_4ec307ff01014wte.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.