Does anyone know if it is possible to run or install an app to multiple devices at once via the cordova cli ?
Currently I have to run the following commands in order to run on multiple devices
cordova run --target=XXXXXXXXXX
cordova run --target=yyyyyyyyyy
cordova run --target=zzzzzzzzzz
Looking for something like
cordova run --target={zzzzzzzzzz yyyyyyyyyy zzzzzzzzzz}
or
cordova run --target=all
Thanks in advance
I came up with the same issue and got it working for android (use the same logic for other platforms) by using a shell script :
deviceLst=$(adb devices | awk 'NR > 1 {print $1}' | sed ':a;N;$!ba;s/\n/ /g')
IFS=' ' read -a array <<< "$deviceLst"
cd cordova
for element in "${array[@]}"
do
cordova run android --target=$element
done
cd ..
Where cd cordova
is the folder containing the platforms.
Hope this will help you :)
Another way to do this, is combining the two commands:
cordova run android --target=XXXXX && cordova run android --target=YYYY
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