Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot push to android emulator because of Read only file system

Tags:

android

macos

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?

like image 235
sanders Avatar asked Mar 22 '18 10:03

sanders


1 Answers

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.

like image 101
Ropstah Avatar answered Oct 11 '22 01:10

Ropstah