darklord
darklord

Reputation: 5167

Cannot change android system directory to rw

I am trying to remount the /system as a rw file system so I can push some files into /system/framework. It is an android emulator running Android 6.0 x86 image.

$ mount
...
/dev/block/vda /system ext4 ro,seclabel,relatime,data=ordered 0 0
...

Then I do

su
mount -o rw,remount /system
mount
...
    /dev/block/vda /system ext4 rw,seclabel,relatime,data=ordered 0 0
...

At this time I am thinking I am ok. Then I am doing on host:

adb push test.jar /system/framework/

However I see:

failed to copy 'test.jar' to '/system/framework/test.jar': Read-only file system

Then I go back to adb:

mount
...
    /dev/block/vda /system ext4 ro,seclabel,relatime,data=ordered 0 0
...

It goes back to ro again.

When I trying to do remount again, it doesn't even let me do it this time:

mount: Read-only file system
255|root@generic_x86:/ # 

So where I am doing wrong? Thanks!

___ Edit____

restarting adbd as root via adb root command solves my issue.

Upvotes: 12

Views: 16224

Answers (3)

Zombo
Zombo

Reputation: 1

The other answer was close for me, but was missing some steps. You have to first start the server if it's not already running:

adb start-server
emulator -writable-system -avd Pixel_2_API_24

Then you can mount as writable:

adb root
adb remount

https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android

Upvotes: 0

JFouad
JFouad

Reputation: 561

based on @raed-hosny answer I solve the problem with

$ emulator -writable-system -netdelay none -netspeed full -avd Nexus_5X_API_25

In your log you will have something like this

sh: 1: glxinfo: not found emulator: WARNING: System image is writable sh: 1: glxinfo: not found emulator: Listening for console connections on port: 5554 emulator: Serial number of this emulator (for ADB): emulator-5554

Upvotes: 25

raed hosny
raed hosny

Reputation: 179

try to start emulator from terminal using -writable-system so you can mount /system as writable in the old way

Upvotes: 14

Related Questions