How to modify host file for emulator and windows
In post, we know how to edit or update windows/emulator hosts file
Windows:-
Host File Location
Host file located in below under windows folder
C:\Windows\System32\drivers\etc
Block site Access from Hosts File
If you want to block host entries for the original host address used in place editable host addresses. Simply make an entry in your host file with below IP address and hostname
127.0.0.1 blocksite.com
Edit hosts File
Open the hosts file in notepad or any available text editor. and make the entries in the form of IP address followed by the hostname.
Info If you editing for localhost, Used IP adress127.0.0.1 for localhost in place of local Ip address
Example:-
127.0.0.1 google.com
127.0.0.1 google.com
Emulator:-
Follow steps mentioned below to modify hosts file of emulator
- Open command promt Win+R and type cmd and click on Ok
- Switch to Android SDK's tools folder
C:\Users\user\AppData\Local\Android\sdk\tools - To get the list available(Created by you), emulator used below command
emulator -list-avds - Start the emulator with writable system image option using command.Emulator name spaces replaced by underscore
emulator -avd emulator_name -writable-system - Open new command prompt and switch to Android SDK's platform-tools folder
C:\Users\user\AppData\Local\Android\sdk\platform-tools - Use the adb (Android Debug Bridge) tool to remount::
a) adb root
b) adb remount - Run the following commands to update the hosts file. Use Ip address 10.0.2.2 for local host
a) adb shell
b) cd /system/etc
c) echo "IP Address Hostname" >> hosts - Check for the hosts file update bt command
cat hosts
1 Comments:
North Shield Windows and Doors offers a wide selection of high-quality windows and doors. Among other features, our products offer the latest in security, durability, and design. We are homeowners too, that’s why we work within your style preferences to find exactly what you need and provide you with durable products that will keep your home safe. Windows replacement
Post a Comment
Subscribe to Post Comments [Atom]
<< Home