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); }