
041bf77b1cef2db6549336fd81749a7.png
1、init進程:初始化,解析init.rc,啟動屬性服務,并且啟動Zygote進程。
2、Zygote進程:創(chuàng)建虛擬機,注冊jin方法并調用Zygoteinit.main()進入Java層
2.1、Zygoteinit.main():創(chuàng)建Socket,fork出SystemServer進程,AMS就在SystemServer中創(chuàng)建的
3、APP進程:AMS通知Zygote進程fork出來
總的來說:首先由init()進程fork出Zygote()進程,Zygote進程創(chuàng)建了很多服務其中包括AMS,AMS通知AMS通知Zygote進程fork出來APP進程