Android 9.0 Zygote进程启动源码分析指南一

* 站在巨人的肩膀上可以看的更远 *

 

直接参考博文:

Android 9 (P) Zygote进程启动源码分析指南一

 

系统启动2——启动zygote

系统启动3——Zygote的使命

 

 

 ===== 补充个人的一些儿笔记 =====

 

二. Zygote 进程从何而来

ro.zygote属性值是哪里设置的,如下图片中显示了几处设置该值的位置,具体要根据你编译时采用的mk file来确定

 

 

 

四. Zygote进程main函数分析

main函数的参数解析:http://androidxref.com/9.0.0_r3/xref/frameworks/base/cmds/app_process/app_main.cpp#210

 

    // After the parent dir, we expect one or more the following internal
    // arguments :
    //
    // --zygote : Start in zygote mode 初始化zygote进程模式
    // --start-system-server : Start the system server. 启动systemserver
    // --application : Start in application (stand alone, non zygote) mode. Zygote孵化应用程序模式
    // --nice-name : The nice name for this process. 
    //
    // For non zygote starts, these arguments will be followed by
    // the main class name. All remaining arguments are passed to
    // the main method of this class.  对于非zygote启动模式,后面会跟着一个main class 名字,之后的所有参数都会传递给这个class的main方法
    //
    // For zygote starts, all remaining arguments are passed to the zygote.
    // main function. 对于zygote启动模式,所有剩余的参数都传递给zygote

 

posted on 2021-07-19 16:26  二的次方  阅读(252)  评论(0编辑  收藏  举报