You can use adb devices
to get a list of connected devices and then run adb -s DEVICE_SERIAL_NUM install...
for every device listed.
Something like (bash):
adb devices | tail -n +3 | cut -sf 1 -d " " | xargs -iX adb -s X install ...
Comments suggest this might work better for newer versions:
adb devices | tail -n +2 | cut -sf 1 | xargs -iX adb -s X install ...
For Mac OSX(not tested on Linux):
adb devices | tail -n +2 | cut -sf 1 | xargs -I {} adb -s {} install ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…