Follow the build and signing setup. Use the checked-in Gradle
wrapper. Point ANDROID_HOME or an ignored local.properties at the SDK.
Keep machine-specific paths and signing files out of commits.
- Run
adb devices -land authorize the debug host. If multiple devices are connected, target one withadb -s SERIALand setANDROID_SERIALfor Gradle device commands. - Unlock the device for UI and overlay tests. Grant overlay permission and set up the applicable privileged startup method. Test the actual configuration the PR affects, such as a rooted device, Shizuku, or shell startup on Waydroid.
- Use a device with a keyboard and mouse when validating real device discovery, grabs, or event delivery. A test that injects input can cover Android integration, while physical-device checks cover the hardware path.
Put tests under app/src/androidTest/java/ with packages matching the code
under test. Use AndroidX Test's AndroidJUnitRunner and assert observable
behavior. Restore any app state or resources the test changes.
./gradlew :app:assembleDebug :app:assembleDebugAndroidTest
./gradlew :app:connectedDebugAndroidTestGradle installs both APKs for connected tests. The debug app ID is
xtr.keymapper.debug and the instrumentation APK ID is xtr.keymapper.debug.test.
To run a focused test, pass its fully qualified class or Class#method as a
runner argument:
./gradlew :app:connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=fully.qualified.TestClassFor timing or startup failures, capture app and server logs as described in service debugging. See the validation guide for what to include in the PR.