How can I adb install an apk to multiple connected devices?

后端 未结 20 2082
余生分开走
余生分开走 2020-11-30 19:03

I have 7 devices plugged into my development machine.

Normally I do adb install and can install to just a single device.

Now

20条回答
  •  感情败类
    2020-11-30 19:26

    With Android Debug Bridge version 1.0.29, try this bash script:

    APK=$1
    
    if [ ! -f `which adb` ]; then
        echo 'You need to install the Android SDK before running this script.';
        exit;
    fi
    
    if [ ! $APK ]; then
        echo 'Please provide an .apk file to install.'
    else
        for d in `adb devices | ack -o '^\S+\t'`; do
            adb -s $d install $APK;
        done
    fi
    

    Not sure if it works with earlier versions.

提交回复
热议问题