Pakiet SDK XR na Androida jest teraz dostępny w wersji dla programistów. Chcemy poznać Twoją opinię. Aby się z nami skontaktować, odwiedź naszą stronę pomocy.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Aby zacząć tworzyć aplikacje na Androida XR, użyj najnowszej wersji Canary Androida Studio, która zawiera nowe narzędzia i aktualizacje zoptymalizowane pod kątem Androida XR.
Nowe funkcje w tej wersji Androida Studio:
Emulator Androida XR
Dodanie obsługi XR w Inspektorze układu
Szablon projektu XR
Wymagania systemowe dotyczące emulatora Androida XR
W systemie macOS:
System operacyjny: macOS 13.3 lub nowszy.
Procesor/GPU: Apple Silicon (układ M1 lub nowszy)
RAM/VRAM: co najmniej 16 GB
W systemie Windows:
System operacyjny: Windows 11 lub nowszy.
Procesor: Intel 9. generacji lub nowszy albo AMD Ryzen serii 1000 lub nowszy.
Pamięć RAM: co najmniej 16 GB
GPU: NVIDIA GeForce seria 10 lub nowsza albo AMD Radeon RX seria 5000 lub nowsza.
Pamięć VRAM: co najmniej 8 GB
Ustawienia BIOS: w systemie BIOS komputera musi być włączone rozszerzenie procesora VMX.
Instalowanie i konfigurowanie Androida Studio na potrzeby tworzenia aplikacji na XR
Aby pobrać Android Studio i skonfigurować środowisko programistyczne:
Zamknij wszystkie zainstalowane wersje Androida Studio.
Pobierz najnowszą wersję Androida Studio do wczesnych testów, rozpakuj ją w wybranej lokalizacji i uruchom aplikację.
Postępuj zgodnie z instrukcjami instalacji w kreatorze.
W oknie Witamy w Android Studio kliknij Więcej działań i wybierz Menedżer SDK.
Na stronie Android SDK kliknij kartę SDK Tools i wybierz te narzędzia do zainstalowania:
Android SDK Build-Tools
Android Emulator
Android SDK Platform-Tools
Layout Inspector dla interfejsu API w wersji 31–36
Na karcie Platformy pakietu SDK wykonaj te czynności:
Aby zobaczyć wszystkie opcje, zaznacz pole wyboru Pokaż szczegóły pakietu.
Wybierz obraz systemu Google Play XR ARM (macOS) lub Google Play XR Intel x86_64 (Windows).
Aby wprowadzić zmiany, kliknij Zastosuj, a następnie OK.
Poczekaj, aż wszystkie kroki instalacji zostaną wykonane, a potem kliknij Zakończ.
Tworzenie projektu Androida XR
Aby utworzyć projekt Androida XR w Android Studio lub rozszerzyć istniejący projekt o XR, wykonaj te czynności.
W oknie Witamy w Android Studio wykonaj jedną z tych czynności:
Jeśli tworzysz nową aplikację XR, kliknij Nowy projekt i przejdź do następnego kroku.
Jeśli chcesz przestrzenne odtwarzanie dźwięku w istniejącej aplikacji, kliknij Otwórz, aby wybrać projekt, a potem przejdź do następnego kroku Utwórz nowe wirtualne urządzenie z Androidem na potrzeby emulatora Androida. (Aby uzyskać pomoc w przestrzennej adaptacji istniejącej aplikacji na Androida XR, przeczytaj artykuł Przenoszenie aplikacji na Androida do 3D za pomocą XR).
W kategorii XR wybierz szablon Podstawowa aktywność zestawu słuchawkowego i kliknij Dalej.
Na następnym ekranie możesz wybrać nazwę projektu. Możesz pozostawić domyślne ustawienia bez zmian. Następnie kliknij Zakończ.
Tworzenie nowego wirtualnego urządzenia z Androidem na potrzeby emulatora Androida
Emulator Androida XR to specjalna wersja emulatora Androida przeznaczona do tworzenia aplikacji XR. Umożliwia testowanie i debugowanie aplikacji w rozszerzonej rzeczywistości (XR) w znanym środowisku Android Studio.
Aby korzystać z emulatora Androida XR, musisz utworzyć nowe urządzenie wirtualne.
Aby to zrobić:
W Android Studio kliknij Tools > AVD Manager i postępuj zgodnie z instrukcjami, aby utworzyć nowe urządzenie wirtualne z Androidem (AVD).
W oknie Dodaj urządzenie w sekcji Format wybierz opcję XR, a następnie na liście Nazwa wybierz Urządzenie XR. Kliknij Dalej.
Na następnej karcie (Configure Virtual Device) w sekcji System Image wybierz najnowszy obraz systemu Android XR zgodny z Twoim systemem.
Kliknij Zakończ.
Aby uruchomić emulator, w Menedżerze urządzeń kliknij przycisk Uruchom.
Emulator otworzy się w osobnym oknie.
Aby uruchomić aplikację w emulatorze, kliknij ikonę Uruchom w Android Studio.
Więcej informacji o korzystaniu z emulatora i innych nowych narzędzi XR znajdziesz w artykule Narzędzia Android Studio do XR.
Włączanie statystyk użytkowania, aby pomóc w ulepszaniu Android Studio
Jest to wersja Androida Studio dla programistów, więc wiele z tych funkcji jest w trakcie opracowywania. Włącz statystyki użytkowania i przesyłaj opinie, aby pomóc nam ulepszać te narzędzia.
Aby włączyć statystyki użytkowania:
Kliknij Ustawienia > Wygląd i działanie > Ustawienia systemu > Udostępnianie danych.
Wybierz Wysyłaj statystyki użytkowania do Google.
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-01 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-08-01 UTC."],[],[],null,["# Set up your development environment\n\nTo get started developing for Android XR, use the latest Canary build of\n[Android Studio](/studio/preview), which includes new tools and updates optimized for Android\nXR.\n| **Note:** Ensure you are using the latest Canary build of Android Studio. Other versions might not include Android XR tools.\n\nNew features included in this version of Android Studio are:\n\n- Android XR Emulator\n- Addition of XR support in the Layout Inspector\n- XR Project template\n\nSystem Requirements for Android XR Emulator\n-------------------------------------------\n\n**For macOS:**\n\n- **OS**: macOS 13.3 or later.\n- **CPU/GPU**: Apple Silicon (M1 chip or newer)\n- **RAM/VRAM**: 16 GB or higher\n\n**For Windows:**\n\n- **OS**: Windows 11 or later.\n- **CPU**: Intel 9th generation or later, or AMD Ryzen 1000-series or later.\n- **RAM**: 16 GB or higher\n- **GPU**: NVIDIA GeForce 10 series or later, or AMD Radeon RX 5000 series or later.\n- **VRAM**: 8 GB or higher\n- **BIOS Settings**: VMX CPU extensions must be enabled in your computer's BIOS\n\n| **Note:** You can check if the VMX CPU extensions are already enabled by attempting to run the 2D Android Emulator. If it runs successfully, no BIOS changes are needed.\n\nInstall and configure Android Studio for XR development\n-------------------------------------------------------\n\nComplete the following steps to download Android Studio and set up your\ndevelopment environment:\n\n1. Make sure to close any versions of Android Studio you already have\n installed.\n\n2. Download the latest Canary build of [Android Studio](/studio/preview), extract it into\n your preferred location, and launch the application.\n\n3. Follow the installation instructions in the wizard.\n\n4. In the **Welcome to Android Studio** dialog, click **More Actions** , and\n select **SDK Manager**.\n\n5. In the **Android SDK** page, click the **SDK Tools** tab and select the\n following tools to install:\n\n - Android SDK Build-Tools\n - Android Emulator\n - Android SDK Platform-Tools\n - Layout Inspector for API 31 - 36\n\n | **Note:** If you had a previous version of Android Studio installed, you may need to recheck these boxes, and click **Apply** to download the latest updates.\n6. Under the **SDK Platforms** tab, do the following:\n\n 1. Select the **Show Package Details** checkbox to see all the options.\n 2. Select the **Google Play XR ARM** system image (macOS) or **Google Play\n XR Intel x86_64** (Windows).\n\n 1. Click **Apply** to make the updates, and then click **OK**.\n 2. Allow all the installation steps to complete, then click **Finish**.\n\nCreate an Android XR project\n----------------------------\n\nFollow these steps to create an Android XR project in Android Studio or extend\nan existing project to XR.\n\n1. In the **Welcome to Android Studio** window, do one of the following:\n\n 1. If you're creating a new XR app, click **New Project** and go to the next step.\n 2. If you're spatializing an existing app, click **Open** to select your project, then skip to the next step Create a new Android Virtual Device for the Android Emulator. (For help with spatializing your existing app for Android XR, read [Bring your Android app into 3D with XR](/develop/xr/jetpack-xr-sdk/add-xr-to-existing))\n\n2. In the **XR** category, select the **Basic Headset Activity** template and\n click **Next**.\n\n3. On the next screen you can choose a name for your project. You can leave the\n default settings in place. Then click **Finish**.\n\n4. Explore the code provided in the template. Check out our [development\n guide](/develop/xr/jetpack-xr-sdk/develop-ui) and [reference documentation](/jetpack/androidx/releases/xr-compose).\n\nCreate a new Android Virtual Device for the Android Emulator\n------------------------------------------------------------\n\nThe Android XR Emulator is a specialized version of the Android emulator\ndesigned for XR app development. It lets you test and debug your Extended\nReality (XR) applications within the familiar Android Studio environment.\n| **Caution:** In rare cases, using the emulator can result in system freezes or crashes on some Windows configurations. Please ensure all data is saved before running the emulator. As a workaround, [enable WHPX](/studio/run/emulator-acceleration#vm-windows-whpx). See [release notes](/studio/preview/features) for more known issues.\n\nTo use the Android XR Emulator, you'll have to create a new virtual device.\nFollow these steps to do so:\n\n1. In Android Studio, click **Tools \\\u003e AVD Manager**, and follow the\n instructions to create a new Android Virtual Device (AVD).\n\n2. In the **Add Device** window, under **Form Factor** , select the **XR**\n option, then select **XR Device** in the **Name** list. Click **Next**.\n\n3. In the next tab (**Configure Virtual Device** ), under **System Image**,\n select the most recent Android XR system image that is compatible with your\n system.\n\n4. Click **Finish**.\n\n5. To start the emulator, click the **Run** button in Device Manager.\n\n The emulator opens in a separate window.\n\n6. To launch your app in the emulator, click the **Run** icon in Android\n Studio.\n\nFor details on using the emulator and other new XR tools, read [Android\nStudio Tools for XR](/develop/xr/jetpack-xr-sdk/studio-tools).\n\nEnable Usage Statistics to help improve Android Studio\n------------------------------------------------------\n\nBecause this is a developer preview version of Android Studio, many of these\nfeatures are still under development. Consider enabling usage statistics and\nsending feedback to help us improve these tools.\n\nTo enable Usage Statistics:\n\n1. Click **Settings \\\u003e Appearance \\& Behavior \\\u003e System Settings \\\u003e Data Sharing**.\n2. Select **Send usage statistics to google**."]]