Android 应用程序启动过程 1、用户触发应用组件(server)2、给AMS发消息要先启动应用进程(mPendingService组件列表添加当前组件)3、AMS通过socket的方式给Zygote,发送ActivityThread的类名4、Zygote fork出应用进程,加载ActivityThread的main函数5、开启Looper.prepareMainLooper(),并调用attach(false),告诉AMS启动结束,Looper.Loop()6、在attach(false),调用attachApplicationLocked(),从mPendingSetvice里取出组件,并启动 1、用户触发应用组件(server) 2、给AMS发消息要先启动应用进程(mPendingService组件列表添加当前组件) 3、AMS通过socket的方式给Zygote,发送ActivityThread的类名 4、Zygote fork出应用进程,加载ActivityThread的main函数 5、开启Looper.prepareMainLooper(),并调用attach(false),告诉AMS启动结束,Looper.Loop() 6、在attach(false),调用attachApplicationLocked(),从mPendingSetvice里取出组件,并启动