ASfP: A tool to enhance AOSP platform development - Android Studio for Platform

ASfP: A tool to enhance AOSP platform development - Android Studio for Platform

Android Studio for Platform (ASfP) is a version of Android Studio IDE designed for developers of the Android Open Source Project (AOSP) platform built using the Soong build system. Unlike standard Android Studio, ASfP has multi-language support, can write C++, Kotlin and Java programming languages ​​​​in the same IDE, and has features such as project setup wizards and configuration lunch targets and platform modules.

asfp installation configuration

If you are an AOSP platform developer and do a lot of C++ programming, ASfP may be your development environment of choice. Here are some getting started guides for using ASfP:

  1. Install the Repo client: Before you start using ASfP, you need to install the Repo tool. You can find official installation instructions in Google's developer documentation.

  2. Initialize the Repo to check out the branch: After initializing the Repo, you need to specify the AOSP branch to be checked out. This process can be found in Google's developer documentation.

  3. Download and install ASfP: You can download ASfP's .deb installer for Linux from the official website and install it with the following command:

sudo dpkg -i /path/to/asfp-2023.1.1.19-linux.deb
  1. Turn on ASfP: Start ASfP by switching to the ASfP bin directory in the terminal and running the studio.sh command:
/opt/android-studio-for-platform/bin/studio.sh

Configuring a shortcut icon It is always not very convenient
to use .shstartup, so it is much more convenient to configure a shortcut icon . Create a
new asfp.desktopfile and configure it as follows:

[Desktop Entry]
Encoding=UTF-8
Name=AndroidStudio                                     
Comment=AndroidStudio                                  
Exec=/home/cl/soft/asfp/bin/studio.sh 
Icon=/home/cl/soft/asfp/bin/studio.svg 
Terminal=false                                   
StartupNotify=true
Type=Application
Categories=Application;Development;

After completing the configuration, be careful to modify the permissions. The shortcut icons are as follows

  1. Import the project: After starting ASfP, you need to point to the Repo checkout directory and configure the lunch target and modules to build. This will ensure you can compile and build your project correctly.

ASfP supports multiple languages ​​and platforms, making it easier for developers to perform multiple programming tasks in the same development environment. If you are an AOSP platform developer, ASfP can help you iterate and test your code faster, and allow you to develop Android applications more efficiently. Now, you can try using ASfP to improve your Android platform development efficiency!

Configuration structure

Import the AOSP project. You can import the AOSP project from File->Import Asfp Project.
Repo checkout is the AOSP root directory.
Lunch target is the target that needs to be started. That is, the option in the project list we start through the lunch command.
Module paths is the module that needs to be debugged. For example, framework, Settings, etc.
Project name is the project name
and Location is the project configuration and data storage location.

The root directory asfp-config.jsonis the global configuration of the project

{
    
    
  "repoRoot" : "/home/cl/Code_extend/aosp",
  "modulePaths" : [
    "frameworks",
    "packages/apps/Settings",
    "system/extras/su"
  ],
  "lunchTarget" : "gxx5-userdebug",
  "nativeConfig" : {
    
    
    "excludePaths" : [ ],
    "excludeGenPaths" : [
      "*"
    ]
  }
}

Projects can not only import Java/kotlin projects, but also C++ projects.
The following author imported the system/extras/su module

Supports code highlighting. Some header files cannot be jumped directly because other modules are introduced, so it is necessary to increase the import of the imported modules.

Modules can be dynamically added or deleted in the Project Structure.

Soong compilation process output window

After modifying the module and executing Asfp->Sync soong project, the soong window will re-execute the compilation. The idea command support is still poor, and the compilation is also slow. It is not as fast as executing the mm command or ninja directly in the shell window.

Guess you like

Origin blog.csdn.net/u011897062/article/details/133065217