Android Studio for Platform (ASfP), Android Automotive OS (AAOS) सॉफ़्टवेयर-परिभाषित वीइकल (एसडीवी) प्लैटफ़ॉर्म डेवलपमेंट के लिए सुझाया गया इंटिग्रेटेड डेवलपमेंट एनवायरमेंट (आईडीई) है. ASfP, AAOS SDV प्लैटफ़ॉर्म पर इस्तेमाल की जाने वाली सभी भाषाओं के साथ काम करता है. इनमें SDV सर्विस बंडल के लिए Rust भी शामिल है.
इस पेज पर, सिर्फ़ एसडीवी के लिए सेटअप करने के बारे में बताया गया है. ASfP की सामान्य सुविधाओं और वर्कफ़्लो के बारे में ज़्यादा जानने के लिए, Android Studio for Platform देखें.
ASfP सिर्फ़ 64-बिट वाले Linux पर चलता है, जिसमें x86-64 सीपीयू होते हैं. इसे लोकल Linux वर्कस्टेशन या क्लाउड पर इस्तेमाल किया जा सकता है. क्लाउड सेटअप के बारे में ज़्यादा जानने के लिए, क्लाउड डेवलपमेंट देखें.
ASfP इंस्टॉल करना
ASfP में, हीप का साइज़ डिफ़ॉल्ट रूप से ज़्यादा से ज़्यादा 30 जीबी होता है. प्लैटफ़ॉर्म चेकआउट को इंडेक्स करने में बहुत ज़्यादा मेमोरी खर्च होती है. खास तौर पर, तब जब एक ही मशीन पर कई वीएम वाले Cuttlefish डिवाइस भी चलाए जा रहे हों. अपने प्रोजेक्ट को उन डायरेक्ट्री तक सीमित रखें जिन पर काम किया जा रहा है. साथ ही, ज़रूरत पड़ने पर ASfP की मेमोरी सेटिंग में जाकर, हीप साइज़ की ज़्यादा से ज़्यादा सीमा में बदलाव करें.
ASfP में, IDE में अपने-आप अपडेट होने की सुविधा काम करती है. ज़्यादा जानकारी के लिए, प्लैटफ़ॉर्म के लिए Android Studio को अपडेट करना लेख पढ़ें. ASfP को डाउनलोड और इंस्टॉल करने के साथ-साथ, सिस्टम की ज़रूरी शर्तों के बारे में ज़्यादा जानने के लिए, Android Studio for Platform इंस्टॉल करना लेख पढ़ें.
कोई SDV प्रोजेक्ट बनाना
शुरू करने से पहले, AAOS SDV चेकआउट को शुरू करें, सिंक करें, और बनाएं. चेकआउट सेट अप करने के बारे में ज़्यादा जानकारी के लिए, कोड की जगह और डाउनलोड करें, बनाएं, और चलाएं लेख पढ़ें.
एसडीवी प्रोजेक्ट बनाने के लिए, यह तरीका अपनाएं:
- ASfP में एक नया प्रोजेक्ट बनाएं और रिपॉज़िटरी चेकआउट के तौर पर, अपने AAOS SDV चेकआउट का रूट चुनें. विज़र्ड के चरणों के बारे में ज़्यादा जानने के लिए, कोई प्रोजेक्ट बनाना या इंपोर्ट करना लेख पढ़ें.
- ASfP के प्रोजेक्ट बनाने के बाद,
.asfp-projectफ़ाइल खोलने के लिए, ASfP > Project > Open Config को चुनें. फ़ाइल के कॉन्टेंट को इस उदाहरण से बदलें. इसके बाद,
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 डेवलपमेंट पर फ़ोकस lunchटारगेटdirectoriesका सुझावSDV सर्विस बंडल sdv_core_cf-aosp_current-userdebugआपकी सेवा का कैटलॉग और बंडल डायरेक्ट्री, जैसे कि system/software_defined_vehicle/samplesSDV Core प्लैटफ़ॉर्म इंटिग्रेशन sdv_core_cf-aosp_current-userdebugsystem/software_defined_vehicle/middleware,system/software_defined_vehicle/automotive_services,device/google/sdvSDV IVI पर SDV Gateway sdv_ivi_cf-aosp_current-userdebugsystem/software_defined_vehicle/sdv_gateway,system/software_defined_vehicle/samples/sdv_gateway,packages/services/Carएसडीवी मीडिया पर डिसप्ले सेफ़्टी sdv_media_har_cf-aosp_current-userdebugpackages/services/display_safety,device/google/sdv_display_safetyएसडीवी आईवीआई पर डिसप्ले की सुरक्षा sdv_ivi_cf_ds-aosp_current-userdebugpackages/apps/Car/DriverUI,packages/services/display_safety/serviceअगर आपका चेकआउट
trunk_stagingमेनिफ़ेस्ट का इस्तेमाल करता है, तो-aosp_current-userdebugको-trunk_staging-userdebugसे बदलें. नेटिव प्लैटफ़ॉर्म कोड को ब्राउज़ करने के लिए,cppकोother_languagesमें जोड़ें. कॉन्फ़िगरेशन के सभी विकल्पों के बारे में ज़्यादा जानने के लिए, कॉन्फ़िगरेशन पैरामीटर देखें.बदलावों को लागू करने के लिए, ASfP > Sync > Sync Project को चुनें. सिंक मोड (फ़ुल सिंक, पार्शियल सिंक, और नो-बिल्ड सिंक) के बारे में ज़्यादा जानने के लिए, सिंक मोड और Soong टूल विंडो लेख पढ़ें. अपनी टीम के लिए, शेयर किए जा सकने वाले
.asfp-projectटेंप्लेट एक्सपोर्ट या इंपोर्ट करने के बारे में ज़्यादा जानने के लिए, शेयर किए जा सकने वाले प्रोजेक्ट टेंप्लेट (एक्सपोर्ट और इंपोर्ट करना) लेख पढ़ें.
एसडीवी सर्विस बंडल डिप्लॉय करना
ASfP में एक SDV प्लग इन शामिल होता है. यह प्लग इन, आपके सर्विस बंडल वाले APEX को सीधे तौर पर चालू SDV डिवाइस पर डिप्लॉय करता है. यह प्लगिन डिफ़ॉल्ट रूप से बंद होता है. इसका इस्तेमाल करने के लिए, सेटिंग > प्लग इन में जाकर, एसडीवी प्लग इन को चालू करें. APEX पैकेजिंग के बारे में ज़्यादा जानने के लिए, सर्विस बंडल बनाना और उन्हें डिप्लॉय करना लेख पढ़ें.
डिप्लॉय करने का तरीका इस बात पर निर्भर करता है कि APEX पहले से डिवाइस पर मौजूद है या नहीं:
- अगर APEX पहले से इंस्टॉल है, तो ASfP से सीधे तौर पर बदलावों को डिप्लॉय किया जा सकता है.
- अगर APEX नया है, तो आपको पहले सिस्टम इमेज को फिर से बनाना और लॉन्च करना होगा. इसके अलावा, ऐसी सिस्टम इमेज का इस्तेमाल करें जिसमें APEX पर हस्ताक्षर करने के लिए इस्तेमाल की गई कुंजी शामिल हो. इसके बाद, ASfP से डिप्लॉय किया जा सकता है.
सर्विस बंडल APEX को डिप्लॉय करने के लिए, यह तरीका अपनाएं:
- Cuttlefish प्लग इन की मदद से, अपना SDV डिवाइस चालू करें. ज़्यादा जानकारी के लिए, Cuttlefish पर SDV डिवाइसों को चलाना लेख पढ़ें.
- अपने सर्विस बंडल की
apex/Android.bpफ़ाइल खोलें. इसके बाद,apex {ब्लॉक के बगल में मौजूद गटर में, Run आइकॉन पर क्लिक करें. - इसके बाद, जो मेन्यू खुलेगा उसमें Run 'Deploy APEX_NAME' को चुनें. आपके पास APEX को डिप्लॉय किए बिना भी उसे बनाने का विकल्प होता है. इसके अलावा, उसी मेन्यू से रन कॉन्फ़िगरेशन में बदलाव भी किया जा सकता है.
Cuttlefish पर एसडीवी डिवाइसों को चलाना
ASfP में Cuttlefish प्लग इन शामिल है. यह लोकल Cuttlefish डिवाइसों को बनाता है और चलाता है. प्लग इन के लिए, Cuttlefish होस्ट ऑर्केस्ट्रेटर की ज़रूरत होती है. अगर होस्ट ऑर्केस्ट्रेटर उपलब्ध नहीं है, तो ASfP इसे सेट अप करने के निर्देश दिखाता है.
एसडीवी डिवाइस बनाने के लिए, यह तरीका अपनाएं:
- Tools > डिवाइस मैनेजर को चुनें. इसके बाद, + पर क्लिक करें और Create Cuttlefish Device को चुनें.
- मल्टी-वीएम सेटअप बनाने के लिए, कैननिकल कॉन्फ़िगरेशन से को चुनें. इसके बाद, अपने सेटअप के लिए कोई कॉन्फ़िगरेशन बनाएं या इंपोर्ट करें. जैसे, SDV IVI के साथ SDV Core या डिसप्ले की सुरक्षा के लिए SDV IVI के साथ SDV Media. एक वीएम बनाने के लिए, लोकल Android सोर्स ट्री चेकआउट से को चुनें.
सभी वीएम डिसप्ले को एक ही स्क्रीन पर देखने और डिवाइस के अन्य विकल्पों को ऐक्सेस करने के लिए, Cuttlefish टूल विंडो का इस्तेमाल करें. इसे खोलने के लिए, साइड पैनल में मौजूद ... आइकॉन को चुनें. इसके बाद, Cuttlefish को चुनें या सहायता > कार्रवाई ढूंढें में जाकर, Cuttlefish खोजें. रनिंग डिवाइस में जाकर, अलग-अलग डिसप्ले भी देखे जा सकते हैं. SDV Core, डिसप्ले के बिना चलता है. इसलिए, इसकी जांच करने के लिए Logcat और Terminal का इस्तेमाल करें.
डीबग और टेस्ट करना
ASfP में C++ और Rust कोड के लिए, पहले से मौजूद LLDB डीबगर शामिल है. ASfP में डीबग करने और टेस्ट करने के बारे में ज़्यादा जानने के लिए, प्लैटफ़ॉर्म कोड को डीबग करना, Rust कोड को डीबग करना, atest की मदद से प्लैटफ़ॉर्म कोड को टेस्ट करना, और LLDB में cc_test और rust_test टारगेट को डीबग करना लेख पढ़ें.
जब डीबगर को किसी सर्विस बंडल से अटैच किया जाता है, तो उसे होस्ट करने वाली प्रोसेस से अटैच करें. प्रोसेस के नाम <bundle_name>:<instance_name> फ़ॉर्मैट का इस्तेमाल करते हैं, जैसे कि OrchestratorSampleRustServiceBundle:sample-main-no-conditions. इस निर्देश से, मैच होने वाली प्रोसेस और उनके प्रोसेस आईडी की सूची दिखती है:
adb shell ps -A | grep <bundle_name>
एसडीवी डीबग करने के वर्कफ़्लो के बारे में ज़्यादा जानने के लिए, एसडीवी डीबग करें लेख पढ़ें. इसमें कई डिवाइसों से कनेक्ट करने और लॉग देखने के बारे में जानकारी दी गई है.
VSIDL फ़ाइलों में बदलाव करना
ASfP में VSIDL लैंग्वेज सर्वर (vsidl-lsp) शामिल है. लैंग्वेज सर्वर के लिए अपना कैटलॉग सेट अप करने के तरीके के बारे में ज़्यादा जानने के लिए, कैटलॉग के अपने-आप होने वाले अपडेट और एलएसपी इंटिग्रेशन देखें. जब आपके कैटलॉग में CATALOG_UPDATE फ़ाइल शामिल होती है, तो एडिटर .vsidl फ़ाइलों के लिए ये सुविधाएं उपलब्ध कराता है:
- लाइव पुष्टि: एडिटर, VSIDL कीवर्ड को हाइलाइट करता है. साथ ही, समस्याएं विंडो में सिंटैक्स की गड़बड़ियां, ऐसी गड़बड़ियां जिन्हें ठीक नहीं किया गया है, और VSIDLC की पुष्टि से जुड़ी गड़बड़ियां दिखाता है. पुष्टि करने के नियमों और गड़बड़ी के कोड के बारे में ज़्यादा जानकारी के लिए, VSIDL भाषा की खास जानकारी देखें.
- अपने-आप पूरा होने की सुविधा और दस्तावेज़: कीवर्ड, मैसेज, सेवा, विषय, और चैनल के सुझाव पाने के लिए, Ctrl+Space दबाएं. दस्तावेज़ की टिप्पणियां देखने के लिए, Ctrl+Q दबाएं.
- नेविगेशन और फ़ॉर्मैटिंग:
.vsidlया.protoकी परिभाषाओं पर जाने के लिए, Ctrl+B दबाएं. रेफ़रंस ढूंढने के लिए, Alt+Shift+F7 दबाएं. फ़ाइल का स्ट्रक्चर देखने के लिए, Ctrl+F12 दबाएं. फ़ाइल को फ़ॉर्मैट करने के लिए, Ctrl+Alt+L दबाएं.
एआई असिस्टेंट के लिए, एसडीवी का कॉन्टेक्स्ट जोड़ना
ASfP में, Android Studio में एआई और पहले से मौजूद एजेंट शामिल है. इसमें Soong बिल्ड और atest टूल भी शामिल हैं. AGENTS.md फ़ाइलें, वर्शन कंट्रोल में आपके सोर्स कोड के साथ मौजूद होती हैं. इसलिए, SDV के एक जैसे नियम, ASfP के पहले से मौजूद एजेंट और कमांड-लाइन या कंटेनर पर आधारित कोडिंग एजेंट के साथ शेयर किए जा सकते हैं. ये एजेंट, AGENTS.md को पढ़ते हैं. ASfP में कोई फ़ाइल खुली होने पर प्रॉम्प्ट सबमिट करने से, एजेंट उस फ़ाइल की डायरेक्ट्री और उसकी पैरंट डायरेक्ट्री से AGENTS.md फ़ाइलें लोड करता है. हालांकि, ऐसा तब नहीं होता, जब उसी डायरेक्ट्री में मौजूद किसी GEMINI.md फ़ाइल को प्राथमिकता दी जाती है. चैट पैनल के कॉन्टेक्स्ट पैनल में, AGENTS.md फ़ाइलें में जाकर, ऐक्टिव फ़ाइलों की पुष्टि की जा सकती है. ज़्यादा जानकारी के लिए, Meet Android Studio for Platform और AGENTS.md फ़ाइलों का इस्तेमाल करके एजेंट को पसंद के मुताबिक बनाना लेख पढ़ें.
यहां दिए गए टेंप्लेट, एसडीवी प्रोजेक्ट बनाएं में वर्कफ़्लो के लिए शुरुआती पॉइंट उपलब्ध कराते हैं.
SDV सर्विस बंडल
इस AGENTS.md फ़ाइल को .asfp-project में शामिल बंडल डायरेक्ट्री में रखें. इसमें आपके catalog/, services/, और apex/ फ़ोल्डर शामिल होते हैं. ज़्यादा जानकारी के लिए, मिडलवेयर जनरेट करना, सर्विस बंडल बनाना और उन्हें डिप्लॉय करना, SOME/IP मैपिंग फ़ाइल लिखना, और एसडीवी कम्यूनिकेशन की अनुमति देने की खास जानकारी देखें.
# 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 Gateway
इस AGENTS.md फ़ाइल को अपनी आईवीआई क्लाइंट मॉड्यूल डायरेक्ट्री या system/software_defined_vehicle/sdv_gateway/ में डालें. ज़्यादा जानकारी के लिए,
आईवीआई पर एसडीवी गेटवे का इस्तेमाल करना लेख पढ़ें.
# 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/ या इंस्ट्रुमेंट क्लस्टर ऐप्लिकेशन की डायरेक्ट्री में रखें. ज़्यादा जानकारी के लिए, डिसप्ले सेफ़्टी का इस्तेमाल शुरू करना, एचएआर प्लैटफ़ॉर्म ऐब्स्ट्रैक्शन लेयर, सेफ़्टी डिज़ाइन टूलचेन, और 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