Unity – Install and run an APK on all connected devices with a bash script on OS X

Hey,

As a mobile game developer you need to deploy your game on multiple devices, especially on Android devices.

Unity can only Build and run on ONE device.

If you connect several devices the build will be run on one device only.

So if you want to install and run an .apk file on all connected devices you can use this script:

  • Create a file named push_apk_all_devices.sh
  • Copy and paste this script:

  • First, you need to install the Android SDK
  • Open a Terminal window
  • Type adb and Press enter in order to check if the adb command is installed

  • Check if the devices are connected and type adb devices

  • Build an .apk file with Unity
  • Then launch this script: sh path/push_apk_all_devices.sh (just drag and drop the script in the terminal window)
  • When it’s done press CTRL + C to stop the script.

SOURCE: https://stackoverflow.com/questions/8610733/how-can-i-adb-install-an-apk-to-multiple-connected-devices/14822827