6

Is it possible to preserve system data (not SD card data) on Android emulator when it is shutdown? My specific problem is that I am trying to import a new root certificate into the /system/etc/security/cacerts.bks file, but that requires a restart, and when I do restart the emulator the file gets reverted to original state.

saugata
  • 2,823
  • 1
  • 27
  • 39
  • 1
    hey, did you manage to find out a solution ? I am trying to copy some files to /system/framework and they are lost on restart, – Ahmed Nov 08 '12 at 20:05

2 Answers2

5

The file is a part of the system image, and is not a part of the files created under .avd folder.

Found a link on how to backup/modify a system image. The comments are not in English, but the commands are pretty straightforward.

saugata
  • 2,823
  • 1
  • 27
  • 39
  • 1
    You can follow the instructions provided by http://stackoverflow.com/a/10540106/988704 as well (in English), main difference is instead of pushing APKs you're pushing the cacerts.bks file. – Roberto Andrade Sep 17 '13 at 01:22
0

I think that I once managed to do this by finding a temporary file that contained the modified /system image of the running emulator, and saving a copy which I later substituted for the initial image in an avd that I made to hack on.

Unfortunately I don't remember where I found the temp file. Playing with it at the moment the file called out in the avd seems to be changing and I can't find indication of any other candidates that are open. Perhaps what I did was copy that while the emulator was still running? At the moment dummy files I create in /system after remounting it writable seem to persist across emulator destruction and recreation without any effort on my part.

Additionally, are you sure that an actual reboot of the emulator is needed, that simply using the adb shell to 'stop' and then 'start' the android framework won't do the trick?

Chris Stratton
  • 39,853
  • 6
  • 84
  • 117
  • Thanks for the response, I found the answer after some searching, putting up as separate answer. – saugata Dec 10 '10 at 06:31