Manually start android in the google android emulator
The google android kernel will invoke services listed in the file /etc/init.rc after the kernel is started up. The /etc/init.rc is included in the ramdisk.img. Find the ramdisk.img in $EMULATOR_SDK_FOLDER/tools/lib/images/. One can change the ramdisk.img to change the init.rc and so to change the google android startup sequence.
Follow the tips in Step by step to create/modify ramdisk.img to change ramdisk.img.
Following is the items to comment out in init.rc to stop the android to be loaded at the initial time:
- Find the service section in the init.rc (following the startup section)
- Comment out the zygote sub-section, and runtime sub-section
- Recreate the ramdisk.img and replace the original ramdisk.img (backup the original if you want)
- Restart the google android emulator, use -debug-kernel to see more information
Comment out lines are listed for your reference:
#zygote {
#exec /system/bin/app_process
#args {
#0 -Xzygote
#1 /system/bin
#2 --zygote
#}
#autostart 1
#}
#runtime {
#exec /system/bin/runtime
#autostart 1
#}
After the google android emulator is started up, manually start up the google android services below:
- # adb shell to create a console
- # /system/bin/app_process -Xzygote /system/bin --zygote &
- # /system/bin/runtime &
Upload a strace tool to trace the above services:
- # strace -ff -F -tt -s 200 -o /tmp/log/zygote /system/bin/app_process -Xzygote /system/bin --zygote &
- # strace -ff -F -tt -s 200 -o /tmp/log/runtime /system/bin/runtime &
沒有留言:
張貼留言