From c8fe595e35938bab27f22cecc5f7100b26c71f0c Mon Sep 17 00:00:00 2001 From: William Candillon Date: Sun, 18 Oct 2026 15:43:50 +0200 Subject: [PATCH] =?UTF-8?q?chore(=F0=9F=A4=96):=20give=20the=20example=20a?= =?UTF-8?q?pp=20its=20own=20Android=20application=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit react-native-test-app builds every example to its default application id, com.microsoft.reacttestapp, so the WebGPU and Skia examples replaced each other on a device and could not be installed side by side. The example now sets `android.package` in app.json, which the test app writes to `applicationId`: com.reactnativewebgpu.example. The Java namespace stays the test app's own (com.microsoft.reacttestapp): `packageName` in react-native.config.js keeps naming it, since the CLI's generated entry point reads BuildConfig from that package, and the launcher activity keeps its full name. The CI launch by package is updated, and the agent workflow starts the activity by its full class name instead of one relative to the application id. Verified with a debug build: the APK's package is com.reactnativewebgpu.example and its launchable activity is com.microsoft.reacttestapp.MainActivity. --- .github/workflows/agent.yml | 6 ++++-- .github/workflows/ci.yml | 2 +- apps/example/app.json | 1 + apps/example/react-native.config.js | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index ff52e39e2..b24db81a5 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -244,7 +244,7 @@ jobs: METRO_PORT: 8081 ANDROID_AVD: webgpu-agent ANDROID_SYSTEM_IMAGE: system-images;android-35;default;x86_64 - ANDROID_PACKAGE: com.microsoft.reacttestapp + ANDROID_PACKAGE: com.reactnativewebgpu.example AGENT_OUTPUT: ${{ github.workspace }}/agent-output steps: # The pull request's head when a number is given. The build then runs @@ -389,7 +389,9 @@ jobs: ok=0; for i in 1 2 3 4 5; do adb wait-for-device install -r apps/example/android/app/build/outputs/apk/debug/app-debug.apk && ok=1 && break; echo "adb install failed (attempt $i)"; sleep 5; done; [ "$ok" = 1 ] curl -sf --max-time 900 -o /dev/null \ "http://localhost:$METRO_PORT/index.bundle?platform=android&dev=true&lazy=true&minify=false" - adb shell am start -W -n "$ANDROID_PACKAGE/.MainActivity" + # The activity keeps react-native-test-app's own package name: the + # application id is the example's, the Java namespace is not. + adb shell am start -W -n "$ANDROID_PACKAGE/com.microsoft.reacttestapp.MainActivity" sleep 20 adb exec-out screencap -p > "$AGENT_OUTPUT/launch.png" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aab42b91a..d986f278d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -424,7 +424,7 @@ jobs: adb reverse tcp:8081 tcp:8081 nohup adb logcat > logcat.txt 2>&1 & adb install -r apps/example/android/app/build/outputs/apk/debug/app-debug.apk - adb shell monkey -p com.microsoft.reacttestapp 1 + adb shell monkey -p com.reactnativewebgpu.example 1 cd packages/webgpu && yarn test # Same purpose as the iOS upload above: missing snapshots written on this diff --git a/apps/example/app.json b/apps/example/app.json index 73135e124..a85b9cee3 100644 --- a/apps/example/app.json +++ b/apps/example/app.json @@ -34,6 +34,7 @@ } }, "android": { + "package": "com.reactnativewebgpu.example", "permissions": [ { "android:name": "android.permission.INTERNET" }, { "android:name": "android.permission.CAMERA" }, diff --git a/apps/example/react-native.config.js b/apps/example/react-native.config.js index 75794451e..b37d0b9ac 100644 --- a/apps/example/react-native.config.js +++ b/apps/example/react-native.config.js @@ -4,6 +4,8 @@ const project = (() => { return configureProjects({ android: { sourceDir: "android", + // The Java namespace of react-native-test-app's app module, where + // BuildConfig lives (the application id is set in app.json). packageName: "com.microsoft.reacttestapp" }, ios: {