============================================================================
How to use adb on Windows to modify the Android hosts file without rooting
<
https://www.modmy.com/how-modify-hosts-file-your-android-device>
o Enable USB debugging on the phone:
<
https://www.recovery-android.com/enable-usb-debugging-on-android.html>
o On Windows, install Android Studio (or just ADB):
Studio: <
https://developer.android.com/studio/>
ADB: <
https://www.xda-developers.com/install-adb-windows-macos-linux/>
o Connect the phone via USB & check that ADB can 'see' that phone:
cd c:\<install-path>\sdk\platform-tools\
adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
LGTP450abcdef12 device
o Get the Android hosts file from the phone /system/etc/ directory:
adb pull /system/etc/hosts C:\tmp\
hosts.android
/system/etc/hosts: 1 file pulled. 0.0 MB/s (56 bytes in 0.011s)
type C:\tmp\
hosts.android
127.0.0.1 localhost
::1 ip6-localhost
o Supposedly, without being root, you can push a hosts file:
adb root push c:\windows\system32\drivers\etc\hosts /system/etc/
Despite what the article says, my pull worked, but not the push.
============================================================================
As always, please test and improve so that all benefit from every action.