From 210db58b30d7af864423eb6c652c37de40c8614b Mon Sep 17 00:00:00 2001 From: D N <4661784+retyui@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:09:12 +0100 Subject: [PATCH] feat(android): pass -Pandroid.adbOptions.installOptions=-d by default in run-android --- .../commands/runAndroid/__tests__/runOnAllDevices.test.ts | 1 + .../src/commands/runAndroid/runOnAllDevices.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/packages/cli-platform-android/src/commands/runAndroid/__tests__/runOnAllDevices.test.ts b/packages/cli-platform-android/src/commands/runAndroid/__tests__/runOnAllDevices.test.ts index 1e54de80d..0b75c1454 100644 --- a/packages/cli-platform-android/src/commands/runAndroid/__tests__/runOnAllDevices.test.ts +++ b/packages/cli-platform-android/src/commands/runAndroid/__tests__/runOnAllDevices.test.ts @@ -144,6 +144,7 @@ describe('--appFolder', () => { expect((execa as unknown as jest.Mock).mock.calls[0][1]).toEqual([ 'app:clean', 'app:someTask', + '-Pandroid.adbOptions.installOptions=-d', '-PreactNativeDevServerPort=8081', ]); }); diff --git a/packages/cli-platform-android/src/commands/runAndroid/runOnAllDevices.ts b/packages/cli-platform-android/src/commands/runAndroid/runOnAllDevices.ts index 73c13952c..cdd3379b7 100644 --- a/packages/cli-platform-android/src/commands/runAndroid/runOnAllDevices.ts +++ b/packages/cli-platform-android/src/commands/runAndroid/runOnAllDevices.ts @@ -57,6 +57,11 @@ async function runOnAllDevices( 'install', ); + // Allow version downgrades (adb install -d) by default. + // Note: this only works for debuggable builds. + // Mirrors tryInstallAppOnDevice, which passes `-r -d` to adb install by default. + gradleArgs.push('-Pandroid.adbOptions.installOptions=-d'); + if (args.extraParams) { gradleArgs.push(...args.extraParams); }