Android Studio for Platform (ASfP) is the recommended integrated development environment (IDE) for Android Automotive OS (AAOS) Software-Defined Vehicle (SDV) platform development. ASfP supports all languages that the AAOS SDV platform uses, including Rust for SDV service bundles.
This page covers only the SDV-specific setup. For more information about general ASfP features and workflows, see Android Studio for Platform.
ASfP runs only on 64-bit Linux with x86-64 CPUs. You can use it on a local Linux workstation or in the cloud. For more information about cloud setup, see Cloud development.
Install ASfP
For more information about downloading and installing ASfP and checking the system requirements, see Install Android Studio for Platform.
Indexing a platform checkout uses a lot of memory, especially when you also run multi-VM Cuttlefish devices on the same machine. If ASfP runs slowly, increase the maximum heap size in the ASfP memory settings to fit your project and machine, and keep your project scoped to the directories you work on.
Create an SDV project
Initialize, sync, and build your AAOS SDV checkout before you start. For more information about setting up your checkout, see Code location and Download, build, and run.
To create an SDV project, follow these steps:
- Create a new project in ASfP and select the root of your AAOS SDV checkout as the repository checkout. For more information about the wizard steps, see Create or import a project.
- After ASfP creates the project, select ASfP > Project > Open Config to
open the
.asfp-projectfile. Replace the contents of the file with the following example, and then set
repoto the path of your checkout:repo: /path/to/sdv_source lunch: sdv_core_cf-aosp_current-userdebug directories: include: - system/software_defined_vehicle/samples other_languages: - rustUpdate
lunchanddirectoriesfor the area you work on. To keep indexing and sync fast, include only the directories you actively modify. The following table lists common SDV targets and directories:SDV development focus lunchtargetRecommended directoriesSDV service bundles sdv_core_cf-aosp_current-userdebugYour service catalog and bundle directory, such as system/software_defined_vehicle/samplesSDV Core platform integration sdv_core_cf-aosp_current-userdebugsystem/software_defined_vehicle/middleware,system/software_defined_vehicle/automotive_services,device/google/sdvSDV Gateway on SDV IVI sdv_ivi_cf-aosp_current-userdebugsystem/software_defined_vehicle/sdv_gateway,system/software_defined_vehicle/samples/sdv_gateway,packages/services/CarDisplay Safety on SDV Media sdv_media_har_cf-aosp_current-userdebugpackages/services/display_safety,device/google/sdv_display_safetyDisplay Safety on SDV IVI sdv_ivi_cf_ds-aosp_current-userdebugpackages/apps/Car/DriverUI,packages/services/display_safety/serviceIf your checkout uses a
trunk_stagingmanifest, replace-aosp_current-userdebugwith-trunk_staging-userdebug. To browse native platform code as well, addcpptoother_languages. For more information about all configuration options, see Configuration parameters.To apply your changes, select File > Sync Project.
Deploy SDV service bundles
ASfP includes an SDV plugin that deploys an APEX containing your service bundles directly to a running SDV device. The plugin is disabled by default. To use it, enable the SDV plugin in Settings > Plugins. For more information about APEX packaging, see Build and deploy service bundles.
How you deploy depends on whether the APEX is already on the device:
- If the APEX is already installed, you can deploy your changes directly from ASfP.
- If the APEX is new, you must rebuild and relaunch the system image first, or use a system image that includes the key used to sign the APEX. After that, you can deploy from ASfP.
To deploy a service bundle APEX, follow these steps:
- Start your SDV device with the Cuttlefish plugin. For more information, see Run SDV devices on Cuttlefish.
- Open the
apex/Android.bpfile of your service bundle and click the Run icon in the gutter next to theapex {block. - In the menu that opens, select Run 'Deploy APEX_NAME'. You can also build the APEX without deploying it or change the run configuration from the same menu.
Run SDV devices on Cuttlefish
ASfP includes a Cuttlefish plugin that creates and runs local Cuttlefish devices. The plugin needs the Cuttlefish host orchestrator. If the host orchestrator isn't available, ASfP shows instructions for setting it up.
To create an SDV device, follow these steps:
- Select Tools > Device Manager, click +, and select Create Cuttlefish Device.
- To create a multi-VM setup, select From canonical configuration and create or import a configuration for your setup, such as SDV Core with SDV IVI, or SDV Media with SDV IVI for Display Safety. To create a single VM, select From local Android source tree checkout instead.
To view all VM displays on a single screen and access additional device options, use the Cuttlefish tool window. To open it, select the ... icon in the side panel and select Cuttlefish, or search for Cuttlefish in Help > Find Action. You can also view individual displays in Running Devices. Because SDV Core runs without a display, use Logcat and the Terminal to inspect it.
Debug and test
For more information about debugging and testing in ASfP, see Debug platform code and Test platform code. For more information about setting up CodeLLDB to debug Rust service bundles, see Rust debugging.
When you attach the debugger to a service bundle, attach to the process that
hosts it. Process names use the <bundle_name>:<instance_name> format, such as
OrchestratorSampleRustServiceBundle:sample-main-no-conditions. The following
command lists matching processes and their process IDs:
adb shell ps -A | grep <bundle_name>
For more information about SDV debugging workflows, such as connecting to multiple devices and viewing logs, see Debug SDV.
Edit VSIDL files
ASfP includes the VSIDL Language Server (vsidl-lsp). For more information
about how to set up your catalog for the language server, see
Automatic catalog updates and LSP integration. When your catalog includes
a CATALOG_UPDATE file, the editor provides the following features for
.vsidl files:
- Live validation: The editor highlights VSIDL keywords and shows syntax errors, unresolved types, and VSIDLC validation errors in the Problems window. For more information about the validation rules and their error codes, see the VSIDL language specification.
- Autocompletion and documentation: You can press Ctrl+Space for keyword, message, service, topic, and channel suggestions, and press Ctrl+Q to view documentation comments.
- Navigation and formatting: You can press Ctrl+B to go to
.vsidlor.protodefinitions, Alt+Shift+F7 to find references, Ctrl+F12 to view the file structure, and Ctrl+Alt+L to format the file.
Add SDV context for AI assistants
ASfP includes Gemini in Android Studio. For more information about ASfP
features, see Meet Android Studio for Platform. To help Gemini or another
AI coding assistant follow SDV conventions, add an AGENTS.md file to the root
of your SDV catalog. For more information about agent files, see
Customize Gemini using AGENTS.md files.
The following example is a starting point that you can adapt to your catalog:
# AAOS SDV service catalog rules
- Implement SDV service bundles in Rust under `services/<BundleName>/src/`.
- Keep `.proto` files limited to Protobuf `message`, `enum`, and `service` definitions. Define service bundles, APEX packaging, VM placement, and SOME/IP mappings in `.vsidl` files.
- Regenerate middleware with `vsidlc` after you change `.vsidl` or `.proto` files, and leave generated files unmodified.
- Use `PascalCase` for service bundle names and lowercase `kebab-case` for topic and channel names.
- Run `vsidlc --explain <CODE>` to look up a VSIDLC error code.