Fix invalid host file modification in Android emulator

Source: Internet
Author: User

The current online tutorials are as follows three articles:

1. Start the simulator with EMULATOR-AVD avdname-partition-size size
2. Gain root privileges through the ADB root and adb remount commands.
3. Transfer the Hosts file to the PC via the ADB pull/system/etc/hosts command, manually modify the hosts, and push the hosts file back through ADB push.
Still not working ...

The reason is that the carriage returns a newline character pounded by the ghost. Solution:

After performing the above 1, 22, do not execute 3rd, (ensure that the hosts file only one line 127.0.0.1 localhost) next execution:

A. adb shell enters shell mode

B.echo-e \\n >>/system/etc/hosts Write a line break

C.echo ***.***.***.*** www.whatever.com >>/system/etc/hosts write to your host,

If there are more than one host, repeat B and C

At this point, solve!

Fix invalid host file modification in Android emulator

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.