From 32258461bee77f34f1022a85a1f93d318e037c8d Mon Sep 17 00:00:00 2001 From: butomo1989 Date: Tue, 19 Jun 2018 01:20:15 +0200 Subject: [PATCH] Enable to specify port --- genymotion/example/sample_devices/devices.json | 3 ++- src/appium.sh | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) mode change 100644 => 100755 genymotion/example/sample_devices/devices.json diff --git a/genymotion/example/sample_devices/devices.json b/genymotion/example/sample_devices/devices.json old mode 100644 new mode 100755 index 048ab0b..3150d45 --- a/genymotion/example/sample_devices/devices.json +++ b/genymotion/example/sample_devices/devices.json @@ -1,7 +1,8 @@ [ { "template": "Samsung Galaxy S7 - 6.0.0 - API 23 - 1440x2560", - "device": "SamsungS7V6" + "device": "SamsungS7V6", + "port": 38727 }, { "template": "Google Nexus 6 - 8.0 - API 26 - 1440x2560", diff --git a/src/appium.sh b/src/appium.sh index b4a3c49..daaa2cb 100644 --- a/src/appium.sh +++ b/src/appium.sh @@ -20,8 +20,15 @@ function prepare_geny_cloud() { template=$(get_value '.template') device=$(get_value '.device') - echo "Starting \"$device\" with template name \"$template\"..." - gmtool --cloud admin startdisposable "${template}" "${device}" + port=$(get_value '.port') + + if [[ $port != null ]]; then + echo "Starting \"$device\" with template name \"$template\" on port \"$port\"..." + gmtool --cloud admin startdisposable "${template}" "${device}" --adb-serial-port "${port}" + else + echo "Starting \"$device\" with template name \"$template\"..." + gmtool --cloud admin startdisposable "${template}" "${device}" + fi done }