Get Android System write permission
Note: The following premise is that the system has been rooted.
/system
It is the Android system directory, which stores Android system applications and lib. Sometimes we need to write files into this directory. For example, we build our own apk into the system and start it as a system apk, but this directory has only read permission by default. no write permission will appear after the execution write Read-only file system
wrong tips.
The following describes how to get the write permission:
- Execute
adb shell su
. Enter adb shell as root user; - Execution
mount|grep /system
, you can see the following information, different devices, see different information.
/dev/block/platform/15740000.dwmmc0/by-name/system /system ext4 ro,relatime,data=ordered 0 0
Seeing ro, it means that the directory has only read permission, and then try to modify the permission.
- Execution
mount -o remount <device> /system
, which<device>
partially fill in the file path seen above, for example, I was here
/dev/block/platform/15740000.dwmmc0/by-name/system
, so I should have the full command is executed
mount -o remount /dev/block/platform/15740000.dwmmc0/by-name/system /system
- Re-run
mount|grep /system
, we see the following message, ro has become rw, represents the system had now ready to/system
file written.
/dev/block/platform/15740000.dwmmc0/by-name/system /system ext4 rw,relatime,data=ordered 0 0
If you want to restore the read and write permissions of the directory, you can execute it
/mount -o remount,ro <device> /system