Erhe quest launch

From tksuoran/erhe · View interactive version

Erhe quest launch is an AI agent skill from the GitHub repository tksuoran/erhe. Build, install, and launch the erhe editor APK on a Meta Quest 3 attached over adb. Enforces the headset-prompt protocol (install before asking the user to put the headset on, never launch without acknowledged readiness; batch/soak runs confirm once up front) and walks through the canonical script i

How to use this skill

Skill file

erhe Quest launch

Build the editor APK, install it on a connected Meta Quest 3, then launch it into immersive VR. The Quest runtime's RequiresControllersLaunchInterceptor blocks the immersive app behind a "Controllers Required" dialog if the headset is off the user's head when the launch intent fires, so the order of operations matters.

Required order

  1. Build the APK -- no headset interaction needed:

```

scripts\build_android.bat quest

```

APK lands at android-project\app\build\outputs\apk\quest\debug\app-quest-debug.apk.

  1. Install the APK -- still no headset interaction needed. Force-stop first so the install isn't deferred while a previous instance holds the package:

```

$LOCALAPPDATA/Android/Sdk/platform-tools/adb.exe shell am force-stop org.libsdl.app.quest

scripts\install_android.bat quest

```

Verify by reading lastUpdateTime from adb shell dumpsys package org.libsdl.app.quest; it should advance with each install.

  1. Decide the launch class.
  1. Launch only after the user acknowledges -- and ALWAYS start the persistent logcat capture first. The in-memory logcat ring rolls over within seconds once the editor enters a per-frame error loop (e.g. an XR_FRAME_DISCARDED storm), so only a disk capture keeps the full startup trace:

```

bash scripts/quest_logcat.sh # prints the new capture path

$LOCALAPPDATA/Android/Sdk/platform-tools/adb.exe shell am start -n org.libsdl.app.quest/org.libsdl.app.ErheActivity

```

(Optionally adb logcat -c before starting the capture for a clean ring.)

Variants

```

scripts\run_android.bat quest

```

Same headset-prompt rule applies before invoking it (run_android.bat ends with am start -W -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -c com.oculus.intent.category.VR ... so the Horizon shell enters immersive composition).

```

$LOCALAPPDATA/Android/Sdk/platform-tools/adb.exe uninstall org.libsdl.app.quest

scripts\install_android.bat quest

```

Uninstall wipes /data/data/org.libsdl.app.quest/files/spirv_cache/ so the next launch re-compiles every shader.

Persistent logcat capture: scripts/quest_logcat.sh

Capture files land in logs/quest_<YYYYMMDD>_<HHMMSS>.log (gitignored) and are appended live by the streamer -- tail -F / grep them while the editor runs. To stop a capture explicitly (e.g. when wrapping up a session with no further launches planned): bash scripts/quest_logcat.sh stop. If you forget, the next launch's start call cleans it up automatically.

The script enforces these invariants -- understand them before changing it:

Filtering a capture to erhe-only lines

Raw captures interleave hundreds of system tags (MRSS, [CT], wlan, ...); a typical 30 s capture is 30k+ lines -- too much to scan. Filter to the editor's erhe spdlog tag:

bash scripts/quest_logcat.sh filter logs/quest_<YYYYMMDD>_<HHMMSS>.log
# writes logs/quest_<YYYYMMDD>_<HHMMSS>_erhe.log

The filter is a single grep on erhe +: (space, literal tag, optional padding, colon) anchored to logcat's threadtime tag column, so it does not match the substring "erhe" inside other tags or message bodies. Always analyze the filtered file; reach for the unfiltered capture only to correlate against OS-level events (OpenXR, VrApi, MRSS, [CT] tags from the Horizon runtime, or WLAN/battery for thermal-throttle context).

Readiness signals (NEVER blind-sleep before capturing)

The editor takes ~15-20 s to initialize on Quest and the exact time varies per run. sleep N before looking once wastes runs: too short misses the window, too long and the user may have removed the headset or exited. ALWAYS poll/stream for a definite readiness signal and act the instant it appears. Pick the signal that matches the state you need:

ADB="$LOCALAPPDATA/Android/Sdk/platform-tools/adb.exe"
"$ADB" shell setprop debug.oculus.logLayers 1   # enable per-frame layer dump (CompositorClient tag)
# Stream the dump; exit the moment OUR app's block contains a QUAD (HUD open).
# Replace "Type QUAD" with the condition you need; raise timeout for slow init.
timeout 150 "$ADB" logcat -s CompositorClient | awk '
  /LogLayers: Client/ {
    if (cap && hit) { printf "%s", buf; found=1; exit }
    cap = (index($0, "org.libsdl.app.quest") > 0); buf=""; hit=0
  }
  cap { buf = buf $0 "\n"; if (index($0,"Type QUAD")>0) hit=1 }
  END { if (!found) print "[watcher] target block not seen (editor not rendering / HUD not open / headset off-head)" }
'
"$ADB" shell setprop debug.oculus.logLayers 0   # ALWAYS turn the flood back off when done

Two gotchas, both learned the hard way:

Mobile (non-Quest) Android: sideload security-check dialog

When running the mobile flavor on a regular Android phone (e.g. soaking with scripts/soak_quest.py --flavor mobile, or any sideloaded APK), Play Protect / Samsung Auto Blocker pops a "Send app for a security check?" dialog on each adb install. It blocks the install until dismissed, which stalls and can crash an unattended clean-reinstall soak. Always disable it before a mobile Android run, and restore it afterward (these are global settings):

ADB="$LOCALAPPDATA/Android/Sdk/platform-tools/adb.exe"
# disable for the soak:
"$ADB" -s <serial> shell settings put global verifier_verify_adb_installs 0
"$ADB" -s <serial> shell settings put global upload_apk_enable 0
"$ADB" -s <serial> shell settings put global package_verifier_user_consent -1
# restore afterward:
"$ADB" -s <serial> shell settings put global verifier_verify_adb_installs 1
"$ADB" -s <serial> shell settings put global upload_apk_enable 1
"$ADB" -s <serial> shell settings put global package_verifier_user_consent 1

If the dialog still appears, it is Samsung Auto Blocker rather than Play Protect: toggle it off in Settings > Security and privacy > Auto Blocker. (The Quest never shows this dialog, but the mobile editor cannot run on the Quest anyway -- the Quest sleeps flat 2D activities and the editor then SIGSEGVs at Vulkan surface creation; soak the mobile editor on a phone instead. Alternatively, scripts/soak_quest.py batch --no-reinstall relaunches the already-installed app each iteration, dodging the install dialog entirely.)

Locating the Android tools

The wrapper scripts probe in this order:

In bash on Windows, the canonical adb path is "$LOCALAPPDATA/Android/Sdk/platform-tools/adb.exe".

Prefer the wrapper scripts (build_android.bat, install_android.bat, run_android.bat) when possible -- they handle both probes plus device-state checks. Drop to direct adb/gradle/java invocations only when a script does not cover the case (e.g. a -P gradle property the bat-arg parser mangles; see Variants above).

Pulling logs after launch

The editor logs under tag erhe. To pull what just happened:

$LOCALAPPDATA/Android/Sdk/platform-tools/adb.exe logcat -d -v time | grep -E "erhe|FATAL|Abort message|Creating shader module|VALIDATION ERROR|Headset_view: multiview"

When chasing a hang, watch for Headset_view: multiview render path enabled (init reached the headset path) and the absence/presence of frame-period am start-following logs to decide whether the editor is actually rendering.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.