Use Android Studio to view the Android 5. x source code
Reading and editing the AOSP Source code is the most annoying part in Machine Development. This article gives you the opportunity to get rid of Eclipse and Source Insight tools.
Google brings Android Studio to Android Developers to replace Eclipse. Since the emergence of Android Studio, the whole machine development and Android source code reading and editing will certainly be able to use it. This article mainly introduces how Android Studio imports the Android AOSP source code.
Currently, only the code after Android Lollipop has been tested. It is unclear whether the project before Android 5.0 supports it. As follows:
There are no complicated configurations. A few simple commands are as follows:
1. Generate the IDE tool File
mmm development/tools/idegen/
After running, the idegen. jar file is generated.
2. Generate the Android Studio configuration file
Mainly generate android. iws, android. ipr, android. iml: these three files are key files of the Android Studio project. They are mainly used to list projects consisting of modules, dependencies, and directory structures.
sh ./development/tools/idegen/idegen.sh
3. Import the project
Open Android Studio, File-> Open-> Project root directory android. ipr. Android automatically imports all the code of the project. The long indexing process takes 30 ~ About 120 minutes.
Process: The config prompt of the framework is displayed in the index. Click config and confirm. The indexing will continue for a period of time.
End: After indexing is complete, select project view to see the clear code structure at the beginning of the article.
4. Advantages and Disadvantages
Advantages:
1. Made by Google
2. Good code reading environment
3. Excellent code editing functions, prompt and method redirection
4. Powerful plug-ins are said to support
Disadvantages:
1. It is recommended that the 8g take-off memory be standard.
Goodbye Source Insight! Goodbye to Eclipse!