forked from Rowlhouse/PicaSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Add Meta Quest OpenXR VR support for Android #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: Quest Build | ||
|
|
||
| # Manual-only build of just the Meta Quest flavor, for fast iteration on the | ||
| # Quest port without spending CI minutes on the full multi-platform suite. | ||
| # Tip: push work-in-progress commits with "[skip ci]" in the message to keep | ||
| # the PR workflows quiet, then dispatch this workflow on the branch. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-quest: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Install NDK | ||
| run: | | ||
| SDKMANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" | ||
| yes | "$SDKMANAGER" --licenses > /dev/null || true | ||
| "$SDKMANAGER" --install "ndk;25.2.9519653" | ||
|
|
||
| - name: Cache Gradle | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: gradle-${{ hashFiles('android/**/*.gradle', 'android/gradle/wrapper/gradle-wrapper.properties') }} | ||
| restore-keys: | | ||
| gradle- | ||
|
|
||
| # Optional custom signing: set the ANDROID_KEYSTORE_BASE64, | ||
| # ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS and ANDROID_KEY_PASSWORD | ||
| # secrets to sign with your own key. Without them (e.g. on forks) the | ||
| # build falls back to the debug keystore committed in android/. | ||
| - name: Set up signing keystore (optional) | ||
| env: | ||
| ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | ||
| ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | ||
| ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | ||
| ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | ||
| run: | | ||
| if [ -n "$ANDROID_KEYSTORE_BASE64" ] && [ -n "$ANDROID_KEYSTORE_PASSWORD" ] && [ -n "$ANDROID_KEY_ALIAS" ] && [ -n "$ANDROID_KEY_PASSWORD" ]; then | ||
| echo -n "$ANDROID_KEYSTORE_BASE64" | base64 --decode > "$RUNNER_TEMP/picasim.keystore" | ||
| { | ||
| echo "PICASIM_KEYSTORE_FILE=$RUNNER_TEMP/picasim.keystore" | ||
| echo "PICASIM_KEYSTORE_PASSWORD=$ANDROID_KEYSTORE_PASSWORD" | ||
| echo "PICASIM_KEY_ALIAS=$ANDROID_KEY_ALIAS" | ||
| echo "PICASIM_KEY_PASSWORD=$ANDROID_KEY_PASSWORD" | ||
| } >> "$GITHUB_ENV" | ||
| echo "Signing with the custom keystore from secrets." | ||
| else | ||
| echo "Signing secrets not (fully) configured - using the repo debug keystore." | ||
| fi | ||
|
|
||
| - name: Generate asset manifest | ||
| run: | | ||
| python3 tools/generate_asset_manifest.py data data/assets_manifest.txt packaging_excludes.txt | ||
|
|
||
| - name: Build quest debug APK | ||
| working-directory: android | ||
| run: | | ||
| ./gradlew assembleQuestDebug -PpicasimBuildNumber=${{ github.run_number }} | ||
|
|
||
| - name: Rename APK | ||
| run: | | ||
| VERSION=$(grep -oE 'Version [0-9.]+' VERSIONS.txt | head -1 | sed 's/Version //') | ||
| cp android/app/build/outputs/apk/quest/debug/app-quest-debug.apk \ | ||
| "com.rowlhouse.picasim-quest-v${VERSION}-b${{ github.run_number }}.apk" | ||
|
|
||
| - name: Upload quest debug APK | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: picasim-quest-debug | ||
| path: com.rowlhouse.picasim-quest-v*.apk | ||
| retention-days: 14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # PicaSim on Meta Quest | ||
|
|
||
| The `quest` Gradle product flavor builds the Android app for Meta Quest | ||
| headsets (Quest 2 / Quest Pro / Quest 3) with OpenXR VR support enabled. | ||
| The regular Android build is the `phone` flavor and is unchanged. | ||
|
|
||
| ## What the quest flavor does | ||
|
|
||
| - Passes `-DPICASIM_QUEST=ON` to CMake, which enables `PICASIM_ENABLE_VR`, | ||
| defines `PICASIM_VR_SUPPORT=1` and `PICASIM_QUEST=1`, and links the OpenXR | ||
| loader and `GLESv3` in addition to `GLESv2`. | ||
| - Pulls the Khronos OpenXR loader from Maven Central | ||
| (`org.khronos.openxr:openxr_loader_for_android:1.1.49`), exposed to the | ||
| CMake build via Gradle's prefab support (`find_package(OpenXR CONFIG)`). | ||
| - Merges a Quest manifest overlay (`android/app/src/quest/AndroidManifest.xml`): | ||
| head-tracking feature requirement, `com.oculus.intent.category.VR` launcher | ||
| category, `com.oculus.supportedDevices` metadata, and removal of the | ||
| phone-oriented `screenOrientation` lock. | ||
| - Uses the same application id as the phone flavor | ||
| (`com.rowlhouse.picasim`), so only one of the two can be installed on a | ||
| device at a time. | ||
|
|
||
| ## Building | ||
|
|
||
| ```sh | ||
| cd android | ||
| ./gradlew assembleQuestDebug # -> app/build/outputs/apk/quest/debug/app-quest-debug.apk | ||
| ./gradlew assemblePhoneDebug # regular phone build | ||
| ``` | ||
|
|
||
| CI (`.github/workflows/android-build.yml`) builds both flavors and uploads | ||
| the quest APK as the `picasim-quest-debug` artifact. | ||
|
|
||
| ## Installing (sideload) | ||
|
|
||
| 1. Enable developer mode on the headset (requires a Meta developer account: | ||
| pair the headset with the Meta Horizon phone app, then toggle Developer | ||
| Mode) and connect via USB-C. | ||
| 2. Install with adb: | ||
|
|
||
| ```sh | ||
| adb install android/app/build/outputs/apk/quest/debug/app-quest-debug.apk | ||
| ``` | ||
|
|
||
| 3. Launch from **Library → Unknown Sources** on the headset. | ||
|
|
||
| ### Fast local builds with Docker | ||
|
|
||
| CI round-trips are slow for iteration; `./quest_docker_build.sh` builds the | ||
| APK locally in a container (image built once from | ||
| `docker/android-build.Dockerfile`, with JDK + Android SDK/NDK). Gradle caches | ||
| persist in the `picasim-gradle` named volume and native build outputs live in | ||
| the repo bind-mount, so incremental builds are fast. Any gradle task can be | ||
| passed as argument (default `assembleQuestDebug`); `--rebuild-image` forces | ||
| an image rebuild. On Apple Silicon enable "Use Rosetta for x86_64/amd64 | ||
| emulation" in Docker Desktop (the NDK has no linux/arm64 host toolchain). | ||
| Typical loop: | ||
|
|
||
| ```sh | ||
| ./quest_docker_build.sh && ./quest_run.sh android/app/build/outputs/apk/quest/debug/app-quest-debug.apk | ||
| ``` | ||
|
|
||
| ### One-step install + launch + logs | ||
|
|
||
| `./quest_run.sh [path/to.apk]` (repo root) installs the APK if given, | ||
| (re)launches the app via adb (USB or WiFi) and streams the app's logcat | ||
| filtered by PID — dropping all the Quest system noise while keeping PicaSim | ||
| traces, SDL and OpenXR loader/runtime output. The stream is also saved to | ||
| `picasim_quest_run.log`, and on Ctrl-C it appends any native crash report. | ||
| CI names the quest APK `com.rowlhouse.picasim-quest-v<version>-b<build>.apk` | ||
| so sideloaded builds are identifiable. | ||
|
|
||
| ### Signing | ||
|
|
||
| Debug builds (local and CI) are signed with `android/debug.keystore`, | ||
| committed to the repo with the standard Android debug credentials, so every | ||
| build shares one signature and installs over the previous one. To sign CI | ||
| builds with your own key instead, set the repository secrets | ||
| `ANDROID_KEYSTORE_BASE64` (the keystore file, base64), `ANDROID_KEYSTORE_PASSWORD`, | ||
| `ANDROID_KEY_ALIAS` and `ANDROID_KEY_PASSWORD` — with any of them missing, | ||
| the workflows fall back to the committed keystore. | ||
|
|
||
| ## Input | ||
|
|
||
| There is no VR (Touch) controller support. Fly with an RC transmitter | ||
| connected over USB-C or Bluetooth — it shows up as a standard SDL gamepad, | ||
| just like on phones. A Bluetooth mouse works for navigating the menus. | ||
|
|
||
| ## Status / known gaps | ||
|
|
||
| - **Experimental** — the build-system support is in place, but the rendering | ||
| path is still being ported to GLES3 for the Quest's OpenXR runtime. | ||
| - Not yet tested on real hardware. | ||
| - No hand tracking, no Touch controller bindings, no Quest-specific UI | ||
| (menus render on the 2D layer). | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the hardware-testing status.
“Not yet tested on real hardware” contradicts the PR history, which says Quest device testing exposed the invisible-menu startup issue. Document the tested headset/build and retain any untested-device caveats.
🤖 Prompt for AI Agents