React Native's run-android command installs APKs on all Android devices connected to a PC.
On the other hand, if you specify the device ID with --deviceID, you can install APKs only on specific Android devices.
However, since there was a difference between Gradle tasks executed with and without device ID specified, I have summarized the results of my research.
If you specify the --verbose option of the react-native command, you can see the command to be executed, so check it with this.
$ react-native run-android --verbose
Info Running jetifier to migrate libraries to AndroidX. Can you disable it using the “--no-jetifier” flag.
Jetifier found 1041 file (s) to forward-jetify. Using 8 workers...
INFO JS SERVER ALREADY RUNNING.
Info Presents the App...
debug running command “cd android && gradlew.bat app: installDebug -preactNativeDevServerport=8081”
The app:installDebug task is running. This builds the app and installs the APK on all Android devices.
$ react-native run-android --verbose --deviceId xxxxx
Info Running jetifier to migrate libraries to AndroidX. Can you disable it using the “--no-jetifier” flag.
Jetifier found 1391 file (s) to forward-jetify. Using 8 workers...
INFO JS SERVER ALREADY RUNNING.
INFO BUILDING THE APP...
debug running command "gradlew.bat build -x lint”
The build task is running. This performs app builds, tests, Javadoc builds, etc.
Furthermore, even if a task is specified with the --tasks option, it is not reflected, so tasks other than the build cannot be excluded.
Currently, it is impossible to change it with options, etc., so it seems that there is only one of the following.
When the following pull requests are imported, the build commands are unified and replaced by assembleDebug tasks, so it seems that they will be resolved in the future.