Skip to content

Instantly share code, notes, and snippets.

@19317362
Forked from interference-security/writable-avd.md
Last active November 27, 2021 09:22
Show Gist options
  • Save 19317362/1fb07d9cec2c6f589dd91d9ed48afd0b to your computer and use it in GitHub Desktop.
Save 19317362/1fb07d9cec2c6f589dd91d9ed48afd0b 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/

Config the dev-env properly

export ANDROID_SDK=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_SDK/emulator:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools/bin:$ANDROID_SDK/tools

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 /

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