I am trying to push a host file to my adb device.
So, I did:
[~/Library/Android/sdk/tools]$ emulator -avd Nexus_5X_API_26_x86 -writable-system
emulator: WARNING: System image is writable
emulator: ### WARNING: /etc/localtime does not point to /usr .
/share/zoneinfo/, can't determine zoneinfo timezone name
emulator: ### WARNING: /etc/localtime does not point to
/usr/share/zoneinfo/, can't determine zoneinfo timezone name
Now in a different console I do
adb push hosts /system/etc/hosts
But I get the follwing error:
adb: error: failed to copy 'hosts' to '/system/etc/hosts': remote couldn't create file: Read-only file system hosts: 0 files pushed. 0.1 MB/s (93 bytes in 0.001s)
Any suggestions?
For those coming here in 2020:
In my case the steps in the answer didn't work as the version 30
API didn't support a writable system.
I had to use the version 28
API version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With