How to modify emulator's rootfs?

775 views
Skip to first unread message

Lee Leclair

unread,
May 31, 2010, 6:53:03 PM5/31/10
to android-platform
For development convenience, I would like to add some custom libraries
to the emulator's rootfs so I don't have to load them everytime the
emulator reboots. I think the file I'm looking for is userdata.img,
created when I built the Android source tree. How do I modify this
file to insert something into /system/lib?

David Turner

unread,
Jun 1, 2010, 6:03:30 PM6/1/10
to android-...@googlegroups.com
you need a custom system.img, do the following:

1/ copy out/target/product/<whatever>/system.img to /tmp/my-system.img
2/ start the emulator with 'emulator -system /tmp/my-system.img <other-options>'

Here's an explanation of why this is needed: because it is very important that the emulator does not modify the system.img generated by the build,

what happens during a normal boot is that a temporary _copy_ of system.img is created, and is used during the emulated session. When you exit
the emulator, the copy is destroyed automatically (even if you press Ctrl-C).

using -system <file> allows you to specify a persistent system image to use. Any changes you perform there are kept in <file> across reboots.

Hope this helps.


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.


Lee Leclair

unread,
Jun 2, 2010, 12:26:33 PM6/2/10
to android-platform
What's the proper method for rebooting the emulator? If I close the
emulator window, none of the file system changes in /system/bin are
persisted (this is with -system flag). If I issue a "reboot" command
on the shell, the emulator appears to hang.

Thanks!

On Jun 1, 3:03 pm, David Turner <di...@android.com> wrote:
> you need a custom system.img, do the following:
>
> 1/ copy out/target/product/<whatever>/system.img to /tmp/my-system.img
> 2/ start the emulator with 'emulator -system /tmp/my-system.img
> <other-options>'
>
> Here's an explanation of why this is needed: because it is very important
> that the emulator does not modify the system.img generated by the build,
>
> what happens during a normal boot is that a temporary _copy_ of system.img
> is created, and is used during the emulated session. When you exit
> the emulator, the copy is destroyed automatically (even if you press
> Ctrl-C).
>
> using -system <file> allows you to specify a persistent system image to use.
> Any changes you perform there are kept in <file> across reboots.
>
> Hope this helps.
>
> On Mon, May 31, 2010 at 3:53 PM, Lee Leclair <zer0stimu...@gmail.com> wrote:
> > For development convenience, I would like to add some custom libraries
> > to the emulator's rootfs so I don't have to load them everytime the
> > emulator reboots. I think the file I'm looking for is userdata.img,
> > created when I built the Android source tree. How do I modify this
> > file to insert something into /system/lib?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-platfo...@googlegroups.com<android-platform%2Bunsu...@googlegroups.com>
> > .

Lee Leclair

unread,
Jun 2, 2010, 12:26:49 PM6/2/10
to android-platform
What's the proper method for rebooting the emulator? If I close the
emulator window, none of the file system changes in /system/bin are
persisted (this is with -system flag). If I issue a "reboot" command
on the shell, the emulator appears to hang.

Thanks!

On Jun 1, 3:03 pm, David Turner <di...@android.com> wrote:
> you need a custom system.img, do the following:
>
> 1/ copy out/target/product/<whatever>/system.img to /tmp/my-system.img
> 2/ start the emulator with 'emulator -system /tmp/my-system.img
> <other-options>'
>
> Here's an explanation of why this is needed: because it is very important
> that the emulator does not modify the system.img generated by the build,
>
> what happens during a normal boot is that a temporary _copy_ of system.img
> is created, and is used during the emulated session. When you exit
> the emulator, the copy is destroyed automatically (even if you press
> Ctrl-C).
>
> using -system <file> allows you to specify a persistent system image to use.
> Any changes you perform there are kept in <file> across reboots.
>
> Hope this helps.
>
> On Mon, May 31, 2010 at 3:53 PM, Lee Leclair <zer0stimu...@gmail.com> wrote:
> > For development convenience, I would like to add some custom libraries
> > to the emulator's rootfs so I don't have to load them everytime the
> > emulator reboots. I think the file I'm looking for is userdata.img,
> > created when I built the Android source tree. How do I modify this
> > file to insert something into /system/lib?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-platfo...@googlegroups.com<android-platform%2Bunsu...@googlegroups.com>
> > .

praneet pandit

unread,
Jun 7, 2010, 2:58:03 AM6/7/10
to android-platform, ravi....@pathpartnertech.com
Hey,
To restart emulator go to
adb shell
ps

kill either system-server or zygote

One more way is to use
adb reboot


regards,
Ravi - The PPite
PathPartner Tech,
www.pathpartnertech.com
Reply all
Reply to author
Forward
0 new messages