Android Emulator에서 Sceneform 앱 실행
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android Emulator를 사용하여 실제 기기 없이 AR 시나리오를 테스트합니다. Android Emulator를 사용하면 에뮬레이션된 에뮬레이션된 기기를 사용하여 가상 환경에서 ARCore 앱을 실행할 수 있습니다.
개발 환경 설정
소프트웨어 요구사항:
하드웨어 요구사항:
- 또한 앱에서 Backgroundform을 사용하려면 OpenGL ES 3.0 이상을 지원하는 개발 머신이 필요합니다.
Android 스튜디오 3.1 이상을 설치합니다.
Android 스튜디오에서 Preferences > Appearance and Behavior > System Settings > Android SDK로 이동합니다.
SDK Platforms 탭을 선택하고 Show Package Details를 선택합니다.
Android 8.1 (Oreo)에서 다음을 선택합니다.
Google API Intel x86 Atom System Image API 수준 27, 버전 4 이상
SDK Tools 탭을 선택하고 Android Emulator 27.2.9 이상을 추가합니다.
확인을 클릭하여 선택한 패키지와 도구를 설치합니다.
확인을 다시 클릭하여 변경사항을 확인합니다.
구성요소 설치 프로그램의 라이선스 계약에 동의합니다.
마침을 클릭합니다.
AR 지원으로 가상 기기 만들기
Android 스튜디오 안내에 따라 AR 지원으로 가상 기기를 만들 수 있습니다.
장면 양식을 사용하려면 OpenGL ES 3.0 이상이 필요합니다.
에뮬레이터가 최신 버전의 OpenGL ES를 사용하도록 구성되어 있는지 확인합니다.
- 실행 중인 에뮬레이터 툴바에서
를 클릭합니다.
- Settings > Advanced > OpenGL ES API level > Renderer max (up to OpenGL ES 3.1)를 선택합니다.
- 에뮬레이터를 다시 시작합니다. 메시지가 표시되면 현재 상태를 저장하지 마세요.
에뮬레이터를 다시 시작한 후 에뮬레이션된 derivce와 잠시 상호작용한 다음 기기 로그를 grep하여 OpenGL ES 3.0 이상이 사용되고 있는지 확인합니다.
adb logcat | grep eglMakeCurrent
ver 3 0
이상 버전이 표시되면 에뮬레이터에서 장면 앱을 실행할 수 있습니다.
… … … … D EGL_emulation: eglMakeCurrent: 0xebe63540: ver 3 0 (tinfo 0xd104cb40)
하위 버전이 표시되면 데스크톱 GPU가 OpenGL ES 3.0을 지원하지 않으며, 대신 실제 지원되는 기기를 사용하여 장면 양식 앱을 실행해야 합니다.
앱 실행
에뮬레이터의 AR 지원 가상 기기에서 ARCore 앱을 테스트합니다. 이렇게 하려면 Android 스튜디오 안내에 따라 Android Emulator에서 앱을 실행하면 됩니다.
AR용 Google Play 서비스 업데이트
에뮬레이터의 Google Play AR 서비스 버전이 오래되었을 수 있습니다. 업데이트하려면 다음 안내를 따르세요.
GitHub 출시 페이지에서 최신 Google_Play_Services_for_AR_1.15.0_x86_for_webmasters.apk를 다운로드합니다.
다운로드한 APK를 사용하려는 각 AVD에 설치합니다.
원하는 AVD를 시작한 다음 다운로드한 APK를 실행 중인 에뮬레이터로 드래그하거나 가상 기기가 실행되는 동안 adb
를 사용하여 설치합니다.
adb install -r Google_Play_Services_for_AR_1.15.0_x86_for_emulator.apk
사용하려는 추가 AVD에 이 단계를 반복합니다.
가상 장면 제어
앱이 ARCore에 연결되면 에뮬레이터 창 아래에 카메라와 상태 표시줄을 제어하는 방법을 설명하는 오버레이가 표시됩니다.
![]()
가상 카메라 이동
Option (macOS) 또는 Alt (Linux 또는 Windows)를 길게 눌러 카메라 이동 컨트롤에 액세스합니다. 카메라를 이동하려면 다음 컨트롤을 사용하세요.
플랫폼 |
작업 |
필요한 조치 |
macOS
|
왼쪽 또는 오른쪽으로 이동
|
Option을 누른 상태에서 A 또는 D를 누름
|
|
아래 또는 위로 이동
|
Option을 누른 상태에서 Q 또는 E를 누름
|
|
앞으로 또는 뒤로 이동
|
Option을 누른 상태에서 W 또는 S를 누름
|
|
기기 방향 변경
|
Option + 마우스 이동
|
Linux 또는 Windows
|
왼쪽 또는 오른쪽으로 이동
|
Alt를 누른 상태에서 A 또는 D를 누름
|
|
아래 또는 위로 이동
|
Alt를 누른 상태에서 Q 또는 E를 누름
|
|
앞으로 또는 뒤로 이동
|
Alt를 누른 상태에서 W 또는 S를 누름
|
|
기기 방향 변경
|
Alt 키를 누른 상태에서 마우스 이동
|
Option 또는 Alt를 해제하여 에뮬레이터의 대화형 모드로 돌아갑니다.
기기 위치를 더 정확하게 지정하려면 Extended controls의 Virtual Sensors 탭을 사용합니다.
문제해결 도움말
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2022-09-26(UTC)
[null,null,["최종 업데이트: 2022-09-26(UTC)"],[[["\u003cp\u003eThe Android Emulator can be used to test ARCore apps in a virtual environment without a physical device, using a controlled emulated device.\u003c/p\u003e\n"],["\u003cp\u003eTo use the emulator for AR development, you need Android Studio 3.1 or later and Android Emulator 27.2.9 or later, along with a development machine supporting OpenGL ES 3.0 or higher.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a virtual device with AR support by selecting the Pixel or Pixel 2 hardware profile and the Oreo: API Level 27: x86: Android 8.1 (Google APIs) system image, while ensuring the Camera Back is set to VirtualScene.\u003c/p\u003e\n"],["\u003cp\u003eTo configure the emulator to support Sceneform, you need to set the OpenGL ES API level to Renderer maximum (up to OpenGL ES 3.1) and verify that the emulator is using at least version 3.0.\u003c/p\u003e\n"],["\u003cp\u003eTo control the virtual camera within the AR environment, press and hold Option (macOS) or Alt (Linux/Windows) and use the A, S, D, W, Q, or E keys, or move the mouse for device orientation changes.\u003c/p\u003e\n"]]],["To test AR apps without a physical device, use the Android Emulator. First, install Android Studio 3.1+ and Android Emulator 27.2.9+. Configure the emulator with a Pixel/Pixel 2 device, Android 8.1 (API 27) system image, and set \"Camera Back\" to \"VirtualScene.\" Ensure OpenGL ES 3.0+ is enabled and update Google Play Services for AR. Control the virtual camera using Option/Alt plus WASD/QE keys or mouse movement. Finally, run the app on the emulator and interact with the AR environment.\n"],null,["# Run Sceneform apps in Android Emulator\n\nUse the [Android Emulator](//developer.android.com/studio/run/emulator.html)\nto test AR scenarios without a physical device. The Android Emulator lets you\nrun ARCore apps in a virtual environment with an emulated device that you\ncontrol.\n\nSet up your development environment\n-----------------------------------\n\nSoftware requirements:\n\n- [Android Studio](//developer.android.com/studio/) **3.1** or later.\n\n- [Android Emulator](//developer.android.com/studio/run/emulator.html#requirements)\n **27.2.9** or later.\n\nHardware requirements:\n\n- You'll also need a development machine that supports **OpenGL ES 3.0** or higher to use Sceneform in your app.\n\nGet Android Studio and SDK tools for ARCore\n-------------------------------------------\n\n1. Install [Android Studio](//developer.android.com/studio/) 3.1 or later.\n\n2. In Android Studio, go to **Preferences \\\u003e Appearance and Behavior \\\u003e System Settings \\\u003e Android SDK**.\n\n3. Select the **SDK Platforms** tab and check **Show Package Details**.\n\n Under **Android 8.1 (Oreo)** , select: \n\n **Google APIs Intel x86 Atom System Image** API Level 27, version 4 or later.\n4. Select the **SDK Tools** tab and add **Android Emulator** 27.2.9 or later.\n\n5. Click **OK** to install the selected pacakges and tools.\n\n6. Click **OK** again to confirm changes.\n\n7. Accept the license agreement for the Component Installer.\n\n8. Click **Finish**.\n\nCreate a virtual device with AR support\n---------------------------------------\n\nYou can follow the Android Studio instructions to [create a\nVirtual Device](//developer.android.com/studio/run/managing-avds.html#createavd)\nwith AR support.\n\n### Configure the virtual device\n\n- Select the **Pixel** or **Pixel 2** hardware profile.\n- Select the **Oreo: API Level 27: x86: Android 8.1 (Google APIs)** system image.\n- Confirm that your virtual device is configured correctly:\n\n - Go to **Verify Configuration \\\u003e Show Advanced Settings**.\n - Make sure that **Camera Back** is set to **VirtualScene**.\n\nConfigure the emulator to support Sceneform\n-------------------------------------------\n\nSceneform requires **OpenGL ES 3.0** or higher.\n\n1. Make sure your emulator is configured to use the latest version of\n OpenGL ES:\n\n - Click in the running emulator's toolbar.\n - Select **Settings \\\u003e Advanced \\\u003e OpenGL ES API level \\\u003e\n Renderer maximum (up to OpenGL ES 3.1)**.\n - Restart the emulator. When prompted, do not save the current state.\n2. After restarting the emulator, briefly interact with the emulated deivce,\n then check whether OpenGL ES 3.0 or higher is being used by grepping the\n device logs:\n\n \u003cbr /\u003e\n\n ```\n adb logcat | grep eglMakeCurrent\n ```\n\n \u003cbr /\u003e\n\n If you see **`ver 3 0`** or higher version, then you can run Sceneform\n apps in the emulator: \n\n ```\n … … … … D EGL_emulation: eglMakeCurrent: 0xebe63540: ver 3 0 (tinfo 0xd104cb40)\n ```\n\n \u003cbr /\u003e\n\n If you see a lower version, then your desktop GPU does not support\n OpenGL ES 3.0 and you must instead use a physical\n [supported device](/ar/discover/supported-devices) to run Sceneform apps.\n\nRun your app\n------------\n\nTest an ARCore app on an AR-supported virtual device in the emulator. To do\nthis, you can follow the [Android Studio instructions](//developer.android.com/studio/run/emulator.html#runningapp) to\nrun an app in the Android Emulator.\n| **Note:** To run apps with NDK components in the Android Emulator, your app must be built with [**x86 ABIs**](//developer.android.com/ndk/guides/abis.html). For an example, see the [**ARCore HelloAR C sample app**](//github.com/google-ar/arcore-android-sdk/tree/master/samples/hello_ar_c).\n\n### Update Google Play Services for AR\n\nThe version of Google Play Services for AR on the emulator is likely out of\ndate. Follow these instructions to update it:\n\n1. Download the latest **Google_Play_Services_for_AR_1.15.0_x86_for_emulator.apk** from the GitHub\n [releases](//github.com/google-ar/arcore-android-sdk/releases) page.\n\n2. Install the downloaded APK into each AVD you'd like to use:\n\n Start the desired AVD, then drag the downloaded APK onto the running\n emulator, or install it using `adb` while the virtual device is running: \n\n ```\n adb install -r Google_Play_Services_for_AR_1.15.0_x86_for_emulator.apk\n ```\n\n \u003cbr /\u003e\n\nRepeat these steps process for any additional AVDs you'd like to use.\n\n### Control the virtual scene\n\nWhen your app connects to ARCore, you'll see an overlay describing how to control\nthe camera and a status bar below the emulator window.\n\n#### Move the virtual camera\n\nPress and hold **Option** (macOS) or **Alt** (Linux or Windows) to access camera\nmovement controls. Use the following controls to move the camera:\n\n\u003cbr /\u003e\n\n| Platform | Action | What to do |\n|--------------------------|---------------------------|----------------------------------------|\n| **macOS** | Move left or right | Hold **Option** + press **A** or **D** |\n| | Move down or up | Hold **Option** + press **Q** or **E** |\n| | Move forward or back | Hold **Option** + press **W** or **S** |\n| | Change device orientation | Hold **Option** + move mouse |\n| **Linux** or **Windows** | Move left or right | Hold **Alt** + press **A** or **D** |\n| | Move down or up | Hold **Alt** + press **Q** or **E** |\n| | Move forward or back | Hold **Alt** + press **W** or **S** |\n| | Change device orientation | Hold **Alt** + move mouse |\n\n\u003cbr /\u003e\n\nRelease **Option** or **Alt** to return to interactive mode in the emulator.\n\nUse the **Virtual Sensors** tab in [Extended controls](//developer.android.com/studio/run/emulator.html#extended)\nfor more precise device positioning.\n\n### Troubleshooting tips\n\n- If your ARCore app launches and you see an \"AR Core not supported\" message,\n check the revision on your system image. Make sure you are using\n **API Level 27 Revision 4**.\n\n- If your ARCore app fails to open the camera when it launches, make sure that\n **Camera Back** is set to **VirtualScene** , as described in the [configuration\n steps above](#configure_the_virtual_device)."]]