因為項目需要
要調整 /system/framework/framework-res.apk
網路上可以查到很多方法寫入 /system (下面會再補充)
但因為 Android Emulator 不斷更新
很多方法已經失效 (有的方法以前有用過能 work, 現在已經不行了)
後來注意到 這篇 (Read only file system on Android) 回應
才想起 Emulator 有個參數: -writable-system
為了寫入 system partition 新增的
要注意是
Use this option to have a writable system image during your emulation session. To do so:
- Start a virtual device with the -writable-system option.
- Enter the adb remount command from a command terminal to tell the emulator to remount system/ as read/write (it’s mounted as read-only by default).
Note that using this flag will create a temporary copy of the system image that can be very large (several hundred MBs), but will be destroyed when the emulator exits.
所以會有種情況就是:
使用 -writable-system 開啟 AVD 寫入資料後 關閉AVD
然後 正常地 (from GUI) 開啟 AVD 是看不到上面寫入的資料
參考資料
Advanced options
-writable-system提到的三種方法已經對現在 Android Emulator 無法直接有效, 但還是有參考價值
不過重啟 AVD 又會復掛