Android系统启动篇

1,《android系统启动流程简介》

2,《android init进程启动流程》

3,《android zygote进程启动流程》

4,《Android SystemServer进程启动流程》

5,《android launcher启动流程》

6,《Android Activity启动过程详解》

Android系统开发准备篇

1,《Android 源码下载和编译》

2,《android 11源码编译和pixel3 刷机》

3,《Android Framework代码IDE加载和调试》

Android系统开发实践篇

1,《android设置默认输入法》

2,《android framework预制APK应用》

3,《Android系统层面限制应用开机自启动详解》

4,《android单独编译framework模块并push》

5,《Android Framework开发系统问题分析》

Android系统开发核心知识储备篇

1,《Android编译系统-envsetup和lunch代码篇》

2,《Android编译系统-概念篇》

3,《android日志系统详解》

4,《Android系统Handler详解》

5,《Android系统Binder详解》

6,《Android中Activity、View和Window关系详解》

7,《android view绘制流程详解》

8,《Android读取系统属性详解》

9,《android 窗口管理机制详解》

10,《初识Android系统》

11,《android中AMS进程通知Zygote进程fork新进程的通信方式》

Android核心功能详解篇

1,《android应用市场点击下载APK安装详解》

2,《Android 手势导航(从下往上滑动进入多任务页面)》

3,《android手势分析(应用界面左往右边滑动退出应用)》

4,《android应用安装流程详解》

5,《android11安装应用触发桌面图标刷新流程》

6,《Android系统多任务Recents详解》

7,《android系统导航栏视图分析》

———————————————————————————————————————————

目录

一、准备工作

1.1 下载最新的 Android Studio 版本

1.2  下载 Android 系统源码

二,编译生成android.ipr文件

2.1  配置编译加载目录

2.2 单独编译 idegen 模块

2.3  执行idegen.sh脚本

2.4 生成物

三,androidstudio加载

四,断点调试

一、准备工作

1.1 下载最新的 Android Studio 版本

https://developer.android.com/studio/index.html

1.2  下载 Android 系统源码

这里比较灵活,可以下载公司内部机型的代码,也可以下载原生AOSP的代码

环境配置参考

https://source.android.com/source/initializing.html

源码下载参考

https://source.android.com/source/downloading.html

编译运行参考

https://source.android.com/source/building.html

全部编译整个代码工程,中间如果有什么问题可以参考

https://source.android.com/source

二,编译生成android.ipr文件

        android提供一套androidstudio加载导入代码的能力,通过idegen编译生成android.iml和android.ipr文件后,androidstuio导入便可。

2.1  配置编译加载目录

        这里采用官方推荐方法修改文件/development/tools/idegen/excluded-paths,参考值:

# Default Idegen excluded paths file. Contains regular expressions, one per

# line, which match paths of directories and .jar files that should be excluded

# from the IDE configuration.

#

# We want to exclude as litte as possible by default, so it's important to

# document the reason for each exclusion.

#

# Developers can also create an 'excluded-paths' file in the project's root

# directory and add their own excludes to slim down their build.

#

# Currently, we lump all the .java files together into one big module, so you

# can't have two classes with the same name at once. In the future, we'll

# generate individual modules, each with their own dependencies, much like the

# build, so we won't have to worry about duplicate names any more than the

# build does.

#

# Note: Google-specific excludes go in vendor/google/excluded-paths.

# Generated API stubs. We only want the originals in our IDE.

android_stubs

# remove projects except framework

#^out

^disregard

^kernel

^bootstrap.bash -> build/soong/bootstrap.bash

^Android.bp -> build/soong/root.bp

^build

^vendor

^tools

^toolchain

^test

^system

^shortcut-fe

^sdk

^prebuilts

^platform_testing

^pdk

^packages

^oem-release

^libnativehelper

#^libcore

^libcore/.*/test$

^libcore/.*/test-rules$

^libcore/test-rules$

^libcore/metrictests$

^hardware

#^frameworks

^frameworks/support/samples$

^frameworks/.*/.*tests$

^frameworks/.*/test$

^frameworks/.*/test-base$

^frameworks/.*/core-testing$

^frameworks/.*/testing$

^frameworks/.*/testutils$

^frameworks/.*/loadtest$

^frameworks/.*/testtensorflow$

^frameworks/.*/testrunner-src$

^frameworks/.*/androidTest$

^flashing-files

^external

^device

^build.sh

^development

^developers

^dalvik

^cts

^compatibility

^Makefile

^bootable

^bionic

^art

2.2 单独编译 idegen 模块

$ make idegen -j16

2.3  执行idegen.sh脚本

$ ./development/tools/idegen/idegen.sh

2.4 生成物

        2.2 2.3执行完成后,工程根目录下生成android.iml和android.ipr文件,见下图:

三,androidstudio加载

        File -> Open 打开android.ipr文件,由于文件比较大,第一次加载同步时间会很长,耐心等待。

四,断点调试

        勾选show all processes,选择需要debug的进程,比如systemui进程

设置断点,进行操作,如下图:

好文推荐

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: