I have two Android devices connected to my computer. When I try to run the app from Android Studio, then it always prompt me to choose the device. Is there any way to deploy the app on a multiple devices automatically - by clicking Run or even better with a shortcut?
Tap "My Apps," "My Applications" or "My Downloads," depending on what your Android device says. You see a list of Android apps associated with your Google account. Tap "Install" next to an app's name to install any apps that you want on the second device.
In the “Overview” tab, next to “Share apps,” tap Receive. After the sender shares the apps, wait for a pairing code. If the code matches the code on your friend's phone, tap Receive. Install the apps.
In Android Studio build with "build"->"Build Bundle"->"Build APKs" which you'll find in the folder app/build/outputs/apk/debug then. You cannot attach the file in your email directly, since APKs are treated as junk by most email providers. So upload the apk somewhere and send the link to your co-worker.
This is almost too easy, actually. When you see the list of devices come up after launching the app, just shift or control click each device you want it to launch on. Just discovered this by accident.
For new users, in Android Studio 2, you also need to disable "Instant Run" in Settings->Build, Execution, Deployment->Instant Run. See Instant Run.
With Instant Run, you only can work with one device at time.
UPDATE
In Android Studio 2.1, it is automatically disabled when run in multiples devices at time.
Deploying to multiple devices
Instant Run uses different techniques to perform hot, warm, and cold swaps that are specific to the API level of the target device. For this reason, while deploying an app to multiple devices at once, Android Studio temporarily turns off Instant Run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With