您的位置:首页 > 大数据 > 人工智能

more detail about adb shell start, stop and reboot

2011-05-07 11:37 337 查看
Introduction


adb is the sdk tool to manage the state of emulator or powerd device.

start & stop are tools under /system/bin (system.img) . It can be called by "adb shell <command>"

reboot is one parameter supported by adb which can be used directly by "adb reboot"

the officially description for start, stop, reboot is

start : Starts (restarts) an emulator/device instance.

stop : Stops execution of an emulator/device instance.

reboot : reboots the devices

What's the difference between them ?


Let's start from checking the process list of device:



from the ps list , we can draw out the boot proces of android device into 2 period:2. zygotegote)

1. start linux kernal

, pid from 1 to 72.

2. start android framework

, pid after 72 which parent is pid31. (pid31, the zygote process. :)

now let,s try to see what happen by calling adb shell stop:



All Processes that created by the 2nd process (start android framework

) has gone.

Now Let's see what happen is we call adb shell start:



Several processes are created after calling to adb shell start including:

1. a new zygote process , pid=385

2. android frameword processes created by zygote , pid later than 389 with parent=385

now we can conclude the function of start/stop, both they deal with the processes running on android dalvik

start:


invoke the pid1 process to create a zygote process ;



invoke zygote process to launch all other android framework processe


Stop:

kill all processes created by zygote process

kill zygote process

.

Start&Stop do not kill processes relatated with linux kernal. But adb reboot will cause the linux restart

adb reboot:


reboot linux


Why need adb shell start/stop?

I think at lease one senario is the best case to use them: that is during framework development. You have to use adb shell stop to kill currently running framework processes so that you can install your new framework apk and then use adb shell start to launch your frash framework apks. for example:

adb remount

adb shell stop

adb sync

adb shell top
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: