플랫폼용 Android 스튜디오(ASfP)는 Android Automotive OS(AAOS) 소프트웨어 정의 차량(SDV) 플랫폼 개발에 권장되는 통합 개발 환경(IDE)입니다. ASfP는 SDV 서비스 번들을 위한 Rust를 포함하여 AAOS SDV 플랫폼에서 사용하는 모든 언어를 지원합니다.
이 페이지에서는 SDV 관련 설정만 다룹니다. 일반적인 ASfP 기능 및 워크플로에 관한 자세한 내용은 플랫폼용 Android 스튜디오를 참고하세요.
ASfP는 x86-64 CPU가 있는 64비트 Linux에서만 실행됩니다. 로컬 Linux 워크스테이션이나 클라우드에서 사용할 수 있습니다. 클라우드 설정에 관한 자세한 내용은 클라우드 개발을 참고하세요.
ASfP 설치
ASfP는 기본적으로 최대 힙 크기가 30GB입니다. 플랫폼 체크아웃의 색인을 생성하면 특히 동일한 머신에서 멀티 VM Cuttlefish 기기를 실행하는 경우 많은 메모리가 사용됩니다. 프로젝트 범위를 작업 중인 디렉터리로 제한하고 필요한 경우 ASfP 메모리 설정에서 최대 힙 크기를 조정합니다.
ASfP는 IDE 내 자동 업데이트를 지원합니다. 자세한 내용은 플랫폼용 Android 스튜디오 업데이트를 참고하세요. ASfP 다운로드 및 설치, 시스템 요구사항 확인에 관한 자세한 내용은 플랫폼용 Android 스튜디오 설치를 참고하세요.
SDV 프로젝트 만들기
시작하기 전에 AAOS SDV 체크아웃을 초기화, 동기화, 빌드합니다. 체크아웃 설정에 관한 자세한 내용은 코드 위치 및 다운로드, 빌드, 실행을 참고하세요.
SDV 프로젝트를 만들려면 다음 단계를 따르세요.
- ASfP에서 새 프로젝트를 만들고 AAOS SDV 체크아웃의 루트를 저장소 체크아웃으로 선택합니다. 마법사 단계에 대한 자세한 내용은 프로젝트 만들기 또는 가져오기를 참고하세요.
- ASfP에서 프로젝트를 만든 후 ASfP > Project > Open Config를 선택하여
.asfp-project파일을 엽니다. 파일의 콘텐츠를 다음 예시로 바꾼 후
repo를 체크아웃 경로로 설정합니다.repo: /path/to/sdv_source lunch: sdv_core_cf-aosp_current-userdebug directories: include: - system/software_defined_vehicle/samples other_languages: - rust작업하는 영역의
lunch및directories을 업데이트합니다. 색인 생성 및 동기화를 빠르게 유지하려면 적극적으로 수정하는 디렉터리만 포함하세요. 다음 표에는 일반적인 SDV 타겟과 디렉터리가 나와 있습니다.SDV 개발 중점 분야 목표 lunch개권장 directoriesSDV 서비스 번들 sdv_core_cf-aosp_current-userdebug서비스 카탈로그 및 번들 디렉터리(예: system/software_defined_vehicle/samples)SDV 핵심 플랫폼 통합 sdv_core_cf-aosp_current-userdebugsystem/software_defined_vehicle/middleware,system/software_defined_vehicle/automotive_services,device/google/sdvSDV IVI의 SDV 게이트웨이 sdv_ivi_cf-aosp_current-userdebugsystem/software_defined_vehicle/sdv_gateway,system/software_defined_vehicle/samples/sdv_gateway,packages/services/CarSDV 미디어의 디스플레이 안전 sdv_media_har_cf-aosp_current-userdebugdevice/google/sdv_display_safetypackages/services/display_safetySDV IVI의 디스플레이 안전 sdv_ivi_cf_ds-aosp_current-userdebugpackages/services/display_safety/servicepackages/apps/Car/DriverUI체크아웃에서
trunk_staging매니페스트를 사용하는 경우-aosp_current-userdebug을-trunk_staging-userdebug로 바꿉니다. 네이티브 플랫폼 코드도 탐색하려면cpp를other_languages에 추가합니다. 모든 구성 옵션에 대한 자세한 내용은 구성 매개변수를 참조하세요.변경사항을 적용하려면 ASfP > Sync > Sync Project를 선택합니다. 동기화 모드(전체 동기화, 부분 동기화, 빌드 없음 동기화)와 팀을 위한 공유 가능한
.asfp-project템플릿 내보내기 또는 가져오기에 관한 자세한 내용은 동기화 모드 및 Soong 도구 창과 공유 가능한 프로젝트 템플릿(내보내기 및 가져오기)을 참고하세요.
SDV 서비스 번들 배포
ASfP에는 서비스 번들이 포함된 APEX를 실행 중인 SDV 기기에 직접 배포하는 SDV 플러그인이 포함되어 있습니다. 플러그인은 기본적으로 사용 중지되어 있습니다. 이를 사용하려면 설정 > 플러그인에서 SDV 플러그인을 사용 설정합니다. APEX 패키징에 관한 자세한 내용은 서비스 번들 빌드 및 배포를 참고하세요.
배포 방법은 APEX가 이미 기기에 있는지에 따라 다릅니다.
- APEX가 이미 설치되어 있는 경우 ASfP에서 직접 변경사항을 배포할 수 있습니다.
- APEX가 새 항목인 경우 먼저 시스템 이미지를 다시 빌드하고 다시 실행하거나 APEX에 서명하는 데 사용된 키가 포함된 시스템 이미지를 사용해야 합니다. 그런 다음 ASfP에서 배포할 수 있습니다.
서비스 번들 APEX를 배포하려면 다음 단계를 따르세요.
- Cuttlefish 플러그인을 사용하여 SDV 기기를 시작합니다. 자세한 내용은 Cuttlefish에서 SDV 기기 실행을 참고하세요.
- 서비스 번들의
apex/Android.bp파일을 열고apex {블록 옆의 여백에 있는 실행 아이콘을 클릭합니다. - 열리는 메뉴에서 Run 'Deploy APEX_NAME'을 선택합니다. 동일한 메뉴에서 APEX를 배포하지 않고 빌드하거나 실행 구성을 변경할 수도 있습니다.
Cuttlefish에서 SDV 기기 실행
ASfP에는 로컬 Cuttlefish 기기를 만들고 실행하는 Cuttlefish 플러그인이 포함되어 있습니다. 플러그인에는 Cuttlefish 호스트 조정자가 필요합니다. 호스트 조정자를 사용할 수 없는 경우 ASfP에 설정 안내가 표시됩니다.
SDV 기기를 만들려면 다음 단계를 따르세요.
- Tools > 기기 관리도구를 선택하고 +를 클릭한 후 Create Cuttlefish Device를 선택합니다.
- 다중 VM 설정을 만들려면 표준 구성에서를 선택하고 설정에 대한 구성을 만들거나 가져옵니다(예: SDV IVI가 있는 SDV Core 또는 디스플레이 안전을 위한 SDV IVI가 있는 SDV 미디어). 단일 VM을 만들려면 대신 로컬 Android 소스 트리 체크아웃에서를 선택합니다.
단일 화면에서 모든 VM 디스플레이를 보고 추가 기기 옵션에 액세스하려면 Cuttlefish 도구 창을 사용하세요. 이를 열려면 측면 패널에서 … 아이콘을 선택하고 Cuttlefish를 선택하거나 도움말 > 작업 찾기에서 Cuttlefish를 검색합니다. 실행 중인 기기에서 개별 디스플레이를 볼 수도 있습니다. SDV Core는 디스플레이 없이 실행되므로 Logcat과 터미널을 사용하여 검사합니다.
디버그 및 테스트
ASfP에는 C++ 및 Rust 코드용 LLDB 디버거가 내장되어 있습니다. ASfP의 디버깅 및 테스트에 관한 자세한 내용은 플랫폼 코드 디버그, Rust 코드 디버그, atest로 플랫폼 코드 테스트, LLDB에서 cc_test 및 rust_test 타겟 디버그를 참고하세요.
디버거를 서비스 번들에 연결할 때는 서비스 번들을 호스팅하는 프로세스에 연결합니다. 프로세스 이름은 <bundle_name>:<instance_name> 형식(예: OrchestratorSampleRustServiceBundle:sample-main-no-conditions)을 사용합니다. 다음 명령어는 일치하는 프로세스와 프로세스 ID를 나열합니다.
adb shell ps -A | grep <bundle_name>
여러 기기에 연결하고 로그를 보는 등 SDV 디버깅 워크플로에 관한 자세한 내용은 SDV 디버그를 참고하세요.
VSIDL 파일 수정
ASfP에는 VSIDL 언어 서버(vsidl-lsp)가 포함되어 있습니다. 언어 서버의 카탈로그를 설정하는 방법에 관한 자세한 내용은 자동 카탈로그 업데이트 및 LSP 통합을 참고하세요. 카탈로그에 CATALOG_UPDATE 파일이 포함된 경우 편집기는 .vsidl 파일에 대해 다음 기능을 제공합니다.
- 실시간 유효성 검사: 편집기는 VSIDL 키워드를 강조 표시하고 문제 창에 문법 오류, 확인되지 않은 유형, VSIDLC 유효성 검사 오류를 표시합니다. 검증 규칙 및 오류 코드에 관한 자세한 내용은 VSIDL 언어 사양을 참고하세요.
- 자동 완성 및 문서: Ctrl+Space를 눌러 키워드, 메시지, 서비스, 주제, 채널 추천을 표시하고 Ctrl+Q를 눌러 문서 주석을 볼 수 있습니다.
- 탐색 및 서식 지정: Ctrl+B를 눌러
.vsidl또는.proto정의로 이동하고, Alt+Shift+F7을 눌러 참조를 찾고, Ctrl+F12를 눌러 파일 구조를 보고, Ctrl+Alt+L을 눌러 파일의 서식을 지정할 수 있습니다.
AI 어시스턴트의 SDV 컨텍스트 추가
ASfP에는 Android 스튜디오의 AI와 Soong 빌드 및 atest 도구가 포함된 내장 에이전트가 포함되어 있습니다. AGENTS.md 파일은 버전 제어에서 소스 코드와 함께 존재하므로 ASfP의 기본 제공 에이전트와 AGENTS.md를 읽는 명령줄 또는 컨테이너 기반 코딩 에이전트 간에 동일한 SDV 규칙을 공유할 수 있습니다. ASfP에서 파일이 열린 상태로 프롬프트를 제출하면 에이전트는 해당 파일의 디렉터리와 상위 디렉터리에서 AGENTS.md 파일을 로드합니다(동일한 디렉터리의 GEMINI.md 파일이 우선 적용되지 않는 한). 채팅 패널의 컨텍스트 창에 있는 AGENTS.md 파일에서 활성 파일을 확인할 수 있습니다. 자세한 내용은 플랫폼용 Android 스튜디오 소개 및 AGENTS.md 파일을 사용하여 에이전트 맞춤설정을 참고하세요.
다음 템플릿은 SDV 프로젝트 만들기의 워크플로를 위한 시작점을 제공합니다.
SDV 서비스 번들
이 AGENTS.md 파일을 catalog/, services/, apex/ 폴더를 포함하는 .asfp-project에 포함된 번들 디렉터리에 배치합니다. 자세한 내용은 미들웨어 생성, 서비스 번들 빌드 및 배포, SOME/IP 매핑 파일 작성, SDV 통신 승인 개요를 참고하세요.
# AAOS SDV service bundle and VSIDL rules
## Build and test
- Initialize the build environment (`source build/envsetup.sh` and
`lunch sdv_core_cf-aosp_current-userdebug`) when running outside ASfP, build
modules with Soong (`m <module_name>`), and run tests with
`atest <TestModuleName>` (`rust_test`, `rust_test_host`, `cc_test`, or
`python_test_host`), without creating `Cargo.toml` files or running `cargo`
- In catalog `Android.bp` files, avoid `defaults` on `rust_protobuf` modules
(`vsidlc` uses a regex parser), include each `.proto` file in at most one
`rust_protobuf` target, and cover all catalog files in the first `filegroup`
(`srcs: ["**/*"]`)
## Protobuf, VSIDL, and AUTOSAR SOME/IP mapping conventions
- Keep `.proto` files limited to `message`, `enum`, and RPC `service` schemas
(using `sdv/vsidl/v1/annotations.proto` only for field size bounds), without
topic names, channel names, or queue capacities
- Write `.vsidl` files in TextProto `VsidlEntry` syntax (`package: "..."`,
`service_bundle { name: "..." }`, `publisher` or `subscriber` with `message`
and `topic`, and `server` or `client` with `service` and `channel`, without
`import` statements; RPCs support unary, client-streaming, and
server-streaming methods, not bidirectional streaming), and isolate
`some_ip_mapping` (`sdv_type_mapping` and `someip_service_mapping` for
AUTOSAR electronic control unit (ECU) `ARXML` or `vsomeip` IDs) or
`vhal_mapping` rules in dedicated `.vsidl` mapping files so core bundles stay
transport-independent
- Use `PascalCase` for `service_bundle` names (avoiding Rust, C++, and Java
keywords), `snake_case` for `build_cfg.target_name`, a globally unique
lowercase `package` with at least four segments (`com.<org>.sdv.<domain>`;
never reuse platform-reserved `com.android.sdv.*` or sample `com.sdv.*`
names), and lowercase dash-case starting with a letter (no consecutive or
trailing hyphens, underscores, or slashes) for `topic`, `channel`, and
instance names
- Set `capacity` on every `publisher` to an even integer greater than or equal
to 2, and pair every `subscriber` and RPC `client` with a matching
`publisher` or `server` in the catalog or its `-d` dependency catalogs
## Code generation, authorization, and APEX packaging
- Export `ANDROID_BUILD_TOP`, check `CATALOG_UPDATE` for catalog-relative
`output_path` (such as `".."`), `dependency_catalog_paths` (`-d`), and
`vsidlc_gen_args`, and run `vsidlc -c <catalog_dir> -o <output_dir>`; omit
`--services` from `vsidlc_gen_args` and avoid `-p` (`--purge`) or
`regenerator` when `output_path` holds handwritten `services/` code
- Leave generated files in `generated_rs/`, `apex/`, and `configs/` unmodified,
and implement Rust logic in `services/<ServiceBundleName>/src/main.rs` (even
though the initial `vsidlc --services` skeleton header says not to edit; C++
bundles do not use `vsidlc` C++ codegen and instead use
`libsdv_lifecycle_client_cpp`, `libsdv_comms_cpp`, and
`sdv_service_bundle_metadata` with `native_library_path: "lib64/lib<so>.so"`
in `sdv_service_bundles_manifest.textproto`)
- Keep communications authorization `.textproto` policies in `configs/` aligned
with every `publisher`, `subscriber`, `server`, and `client` unit (omitting
`capacity` inside manual authorization `.textproto` `publisher` entries) so
Service Discovery does not reject endpoints at runtime
- In Rust bundles, wait for publisher or RPC server availability before
creating subscribers or clients, stop active tasks in `on_stop`, and run
blocking work in `tokio::spawn_blocking`
- Generate Rust service bundle APEXes with `vsidlc --apex` (`updatable: true`,
`min_sdk_version: "35"`, and `product_specific: true` in `apex/Android.bp`,
never `vendor: true` or `soc_specific: true`, with matching unique `name` and
`version` >= 1 in `apex_manifest.json`), and do not set
`supportsRebootlessUpdate: true` or run `adb install --force-non-staged`
because SDV APEX updates require a reboot
SDV IVI의 SDV 게이트웨이
이 AGENTS.md 파일을 IVI 클라이언트 모듈 디렉터리 또는 system/software_defined_vehicle/sdv_gateway/에 배치합니다. 자세한 내용은 IVI에서 SDV 게이트웨이 사용을 참고하세요.
# AAOS SDV Gateway on SDV IVI rules
- Initialize the build environment (`source build/envsetup.sh` and
`lunch sdv_ivi_cf-aosp_current-userdebug`) when running outside ASfP, build
IVI modules with Soong (`m <module_name>`), and run verification with
`atest <TestModuleName>`
- For native C or C++ IVI clients (including vehicle hardware abstraction layer
(VHAL) integrations), link `libsdvgatewayclient`
(`#include "libsdvgatewayclient.h"`) or `ISdvGateway`; for in-tree system Java
or Kotlin clients, use `libsdvgatewayclient-java`,
`libsdvgatewayclient-java-sdk.stubs`, `libsdvgatewayclient-java-sdk`, and
`com.android.sdv.gateway.client`
- Start the Binder thread pool before calling `ASDVGateway_Client_new`, and
call `ASDVGateway_Client_initComms` (or `SdvGatewayClient.initComms`) before
any service discovery, data tunnel, or RPC calls
- Check `ASDVGateway_Client_isRpcAvailable` or
`ASDVGateway_Client_isProcessBoundToSdvRpcNetworkInterface` before opening
RPC sockets on early boot, treat `ASDVGateway_StatusCode_OK` with null
`ASDVGateway_RpcCredentials_t` as insecure `UNLOCKED` boot mode, and free
non-null credentials with `ASDVGateway_Client_deleteRpcCredentials`
- Grant `sdv_gateway_client_domain(<domain>)` in SELinux (do not add
`binder_use` on `/vendor` daemons, which violates Treble `neverallow`; add
`group inet` on native init services, and `INTERNET` plus
`CONNECTIVITY_USE_RESTRICTED_NETWORKS` privapp permissions for system Java
RPC clients)
위급 정보 표시
이 AGENTS.md 파일을 packages/services/display_safety/ 또는 계기판 앱 디렉터리에 배치합니다. 자세한 내용은 디스플레이 안전 시작하기, HAR 플랫폼 추상화 계층, 안전 설계 도구 모음, DriverUI를 참고하세요.
# AAOS Display Safety partner integration rules
- Display Safety spans two guest VMs with separate `lunch` targets: keep
safety-critical telltales, gauges, camera views, chimes, and early-boot or
fallback placeholders in the Rust high availability renderer (HAR) and safety
monitor on SDV Media (`sdv_media_har_cf`), and build non-safety cluster UI on
SDV IVI (`sdv_ivi_cf_ds`) using `ClusterHomeManager` (`Cluster2` rather than
legacy `Cluster1`)
- Implement target OS and hardware subsystems (display, graphics, exterior view
system (EVS) cameras, audio, user input, and vehicle signals) in a dedicated
`har-platform-<target>` platform abstraction layer (PAL) crate implementing
`har-platform-api` traits rather than modifying core `harry` framework crates,
and verify PAL crates against the HAR platform test suite with `atest`
- Generate safety monitor configurations and telltale inspection artifacts from
the serialized Automotive Design for Compose document and safety JSON mapping
(`{"documents": [{"rootnode": "#...", "display_id": 1, "document_id": "...",`
`"states": {"<signal>": "#<node_id>"}}]}`) using the safety design compiler
rather than hardcoding telltale pixel coordinates
- Because the HAR display plane composites above Android IVI, ensure HAR clears
the cluster viewport region to `alpha = 0.0` while valid `HeartbeatRequest`
gRPC messages arrive from IVI, and set opaque pixels in custom HAR OpenGL ES
surfaces to `alpha = 1.0` (`0xFF`)
- Initialize the build environment (`source build/envsetup.sh` and `lunch`) when
running outside ASfP, integrate prebuilt cluster APKs into `sdv_ivi_cf_ds`
through `DriverUIPrebuilt` (`overrides: ["DriverUIStubApp"]`), launch dual-VM
Cuttlefish setups from ASfP or with `ds_toolkit launch`, pass `--user 0` to
`adb shell am` cluster commands, and note that
`adb shell dumpsys SurfaceFlinger` on SDV IVI inspects only Android layers
rather than the overlying HAR plane