问题
This is fairly a very old question but I am surprised that none of the solutions are working for me. I need to run an android app as system app in an AVD (in emulator) created for Android version 7.0. For this, I want to push apk file to system partition but I keep getting error saying it is read only file system. I found many similar questions on stackoverflow but nothing is working for me. I restarted adb in root, executed it with remount as suggested in answers to similar questions, but system partition file system permissions do not change. Here is a sample session:
mvsagar@mvslt:~/sw/android_sdk/platform-tools$ ./adb root
restarting adbd as root
mvsagar@mvslt:~/sw/android_sdk/platform-tools$ ./adb remount
remount succeeded
mvsagar@mvslt:~/sw/android_sdk/platform-tools$ ./adb push /home/mvsagar/projects/AndroidStudioProjects/LcnApps/app/LCNUE.apk /system/app/LCNUE.apk
adb: error: failed to copy '/home/mvsagar/projects/AndroidStudioProjects/LcnApps/app/LCNUE.apk' to '/system/app/LCNUE.apk': couldn't create file: Read-only file system
I have tried manually remounting with read/write(rw) options using adb shell, but the remounting fails.
Is there any way to have read/write permission on system partition?
My dev env is Android Studio on Ubuntu.
回答1:
In my case, I use a avd( Based on: Android 8.0 (Oreo) Tag/ABI: google_apis/x86_64 ).
$ emulator -avd Nexus_5X_API_26_APIs -writable-system
$ adb root
$ adb remount
Then, /system
is writeable.
$ adb push somefile /system/bin/
is work.
回答2:
use genymotion emulator, which is faster, light weight and pre rooted. (which means you can access system directory)
回答3:
For the benefit of others, answer to the question was answered a long ago by @Ishamael in another stackoverflow question Read only file system on Android
来源:https://stackoverflow.com/questions/42647209/how-to-make-system-partition-in-avd-in-emulator-writable