3

I want to be able to write to /system in my Android Studio Emulator. I've made sure to use a rootable, non-Google Play Services AVD. I'm currently using the Pixel 2 - API 28 AVD (targets Android 9.0).

I've made sure to run adb root and that works, though adb remount gives remount of the / superblock failed: Permission denied as an error. (I also tried running adb disable-verity and rebooting before remounting, but I still get the same remount error.)

I've tried adb shell mount -o rw,remount /system, but I get mount: '/system' not in /proc/mounts.

I've also tried

adb shell
su
mount -o rw,remount /system

but get the same mount: '/system' not in /proc/mounts error

(I've tried it without /system too. It appears to work, but if I then try to write to /system, I get mv: /system: Read-only file system)

I've tried emulator -avd -writeable-system but I get 'emulator' is not recognized as an internal or external command, operable program or batch file.

Can someone please help me figure out how to run the emulator in such a way that I can write to /system?

Elliptica
  • 3,928
  • 3
  • 37
  • 68

1 Answers1

1

On Windows open a command prompt/power shell in C:\Users\YourUser\AppData\Local\Android\Sdk\tools and execute

.\emulator.exe -writable-system -avd Pixel_2_API_28

In another command prompt/power shell in C:\Users\YourUser\AppData\Local\Android\Sdk\platform-tools execute

.\adb.exe remount

On Linux you can use the the following commands:

$ANDROID_HOME/tools/emulator -writable-system -avd Pixel_2_API_28
adb remount
Catalin
  • 119
  • 2
  • 4