Skip to content

Instantly share code, notes, and snippets.

@interference-security
Last active March 4, 2024 06:08
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save interference-security/b786d349839ee5bf40bbd1bc2d240a59 to your computer and use it in GitHub Desktop.
Save interference-security/b786d349839ee5bf40bbd1bc2d240a59 to your computer and use it in GitHub Desktop.
How to make AVD system and file-system writable?

Source: https://www.linkedin.com/pulse/android-emulator-tips-security-testers-divya-mudgal/

List created Android AVDs:

emulator -list-avds

Start an AVD (without Play Store) with writable "/system":

emulator -avd Pixel_3_XL_API_26 -writable-system

Start ADB daemon as root:

adb root

Remount "/system" because it is by default mounted as "read-only" even if "-writable-system" is used:

adb remount

Get shell access on AVD and change current user to "root":

adb shell

su

Remount "/system" with read-write access:

mount -o rw,remount /system

mount -o rw,remount /

@W-i-n-7
Copy link

W-i-n-7 commented Feb 9, 2023

emulator_x86_64:/ # mount -o rw,remount /system
mount: '/system' not in /proc/mounts
1|emulator_x86_64:/ # mount -o rw,remount /
'/dev/block/dm-4' is read-only
emulator_x86_64:/ #

error

@itis911
Copy link

itis911 commented Feb 16, 2023

i am like u
are u find any solution ?

@dfelici87
Copy link

I've the same problem!! help me please!

@interference-security
Copy link
Author

This technique does not work on newer version of Android. Depending upon what you are trying to achieve, you can find alternate ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment