Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run an app on a multiple devices automatically in Android Studio

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?

like image 635
tomrozb Avatar asked Oct 09 '22 16:10

tomrozb


People also ask

How do I install the same app on multiple devices?

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.

Can I share apps between Android devices?

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.

How can I share my app to others that I have created using Android Studio?

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.


2 Answers

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.

like image 306
damccull Avatar answered Oct 16 '22 11:10

damccull


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.

like image 30
Rafael Gutiérrez Avatar answered Oct 16 '22 09:10

Rafael Gutiérrez