Noffica
Noffica

Reputation: 469

Calabash Android: how to run or execute tests on all connected devices?

I know I can trigger tests on multiple devices using

ADB_DEVICE_ARG=<serial_number> TEST_SERVER_PORT=<port_number> calabash-android run <apk>

but this is quite manual, where I have to manually launch a new Terminal instance and type those commands for each device.

Is there a way I can trigger the Calabash tests to run on all connected devices?

Upvotes: 0

Views: 2315

Answers (1)

Dmitry Cheremushkin
Dmitry Cheremushkin

Reputation: 366

You can achieve that with the sh script like

NUM=`expr $(adb devices | wc -l) - 1`
DEVICES_LIST=`adb devices | tail -$NUM | awk -F " " '{print $1}'`
PORT_NUMBER=34777

for DEVICE in $DEVICES_LIST; do \
  ADB_DEVICE_ARG=$DEVICE TEST_SERVER_PORT=$PORT_NUMBER calabash-android run <apk>
  PORT_NUMBER=`expr $PORT_NUMBER+1`
done

Upvotes: 2

Related Questions