Skip to content

Commit eb5b0c2

Browse files
authored
Merge pull request #51 from bl4ckb0ne/avd-setup
Add OpenXR android virtual device image
2 parents a17f26b + 1f8d152 commit eb5b0c2

3 files changed

Lines changed: 48 additions & 0 deletions

File tree

build-all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ set -e
1818
./build-one.sh openxr-sdk 20250603 "$@"
1919
./build-one.sh openxr-pregenerated-sdk 20240924 "$@"
2020
./build-one.sh openxr-android 20250121 "$@"
21+
./build-one.sh openxr-avd 20251027 "$@"
2122
)

install-avd.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2022-2025, Collabora, Ltd. and the Monado contributors
3+
#
4+
# SPDX-License-Identifier: BSL-1.0
5+
6+
set -eo pipefail
7+
8+
# Default fallback values, should match install-android-sdk.sh
9+
ANDROID_COMPILE_SDK=${ANDROID_COMPILE_SDK:-34}
10+
ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-/opt/android-sdk}
11+
ANDROID_ARCH=${ANDROID_ARCH:-x86_64}
12+
13+
SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
14+
AVDMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager
15+
AVD_PACKAGE="system-images;android-${ANDROID_COMPILE_SDK};aosp_atd;${ANDROID_ARCH}"
16+
AVD_NAME=openxr-pixel5
17+
18+
echo "Installing AVD simulator"
19+
echo y | $SDKMANAGER "$AVD_PACKAGE" >> /dev/null
20+
21+
echo "Configuring device"
22+
$AVDMANAGER --verbose create avd --name $AVD_NAME --device pixel_5 --package $AVD_PACKAGE
23+
$AVDMANAGER list avd

openxr-avd.Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2025, The Khronos Group Inc.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
FROM khronosgroup/docker-images:openxr-android
6+
7+
LABEL maintainer="Rylie Pavlik <rylie.pavlik@collabora.com>" \
8+
org.opencontainers.image.authors="Rylie Pavlik <rylie.pavlik@collabora.com>" \
9+
org.opencontainers.image.source=https://github.com/KhronosGroup/DockerContainers/blob/main/openxr-avd.Dockerfile
10+
11+
ENV LANG C.UTF-8
12+
13+
# Switch back to privileged user for AVD setup
14+
USER root
15+
16+
# Runtime dependencies for AVD
17+
RUN env DEBIAN_FRONTEND=noninteractive apt-get update -qq && \
18+
env DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y -qq \
19+
libx11-6 \
20+
&& apt-get clean && \
21+
rm -rf /var/lib/apt/lists/*
22+
23+
COPY install-avd.sh /install-avd.sh
24+
RUN /install-avd.sh

0 commit comments

Comments
 (0)