4

In the past, I was able to create an AVD with persistant /system/ storage by copying the system.img file from the base directory (ex: $ANDROID_HOME/platforms/android-10/images/system.img) into the AVD directory (ex: ~/.android/avd/wuntee.avd/) then remount the /system/ partition as rw and finally modify the files on the /system/ partition. This would persist to the AVDs local system.img file and upon reboot, the changes would stay still exist. This process does not work with the emulator version 16...

There are options in the emulator, specifically:

-sysdir <dir>                         search for system disk images in <dir>
-system <file>                        read initial system image from <file>

that I would assume write the changes back to the file, but no luck. Has anyone experienced this, and have a workaround (without unyaffs'ing the .img files)? Is this something that was done intentionally by the Android/emulator developers?

Chris Gerken
  • 16,221
  • 6
  • 44
  • 59
wuntee
  • 12,170
  • 26
  • 77
  • 106

1 Answers1

5

apparently rev. 16 copies the system.img file to your OS's temp folder (on my linux box, it's in /tmp/android-username/emulator-*). The changes you make to the /system partition are reflected on that copy instead of the one in the avds folder.

I remounted /system, modified some files, and then before closing the emulator instance, copied the tmp file to my avd folder. Restarted the emulator and my modifications are persistent.

user1028544
  • 366
  • 3
  • 5