0

I am trying to modify the hosts file in my android device without any rooting and after a quick search I came across this adb method to push hosts file to a non rooted device.

I followed all the instructions in the The non-root method section with developer mode enabled. But at the last command adb push F:\hosts /system/etc/ I am getting this error.

 adb: error: failed to copy 'F:\hosts' to '/system/etc/hosts': remote couldn't create file: Read-only file system

I tried adb reboot and adb remount but its showing this info Not running as root. Try "adb root" first.. How can I push the hosts file with out any rooting?

  • 1
    You can't in 99% of devices... but you never stated what device. – acejavelin Sep 8 '18 at 17:54
  • Possible duplicate of How best to block ads on non rooted phone? – Robert Sep 9 '18 at 10:28
  • Removed ads tag. The question was not about ad blocking alone but to push hosts file modification without root. – Eka Sep 9 '18 at 11:53
1

You cannot do this without root access. The instructions given in that link are conceptually wrong to begin with. The fact that he was able to push a file into system partition implies that he had elevated privilege to remount system partition and write into it. Clearly, the instructions cannot fit under "Non root method" category.

If you are into blocking ads through hosts file, you may try some answers here: In Android 6, how to deny an app permission to access the network?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.