diff --git a/src/appium.sh b/src/appium.sh index aaf964f..83b141f 100644 --- a/src/appium.sh +++ b/src/appium.sh @@ -104,7 +104,7 @@ data "aws_ami" "geny_aws_$index" { resource "aws_key_pair" "geny_key_$index" { provider = "aws.provider_$index" - public_key = "${file("~/.ssh/id_rsa.pub")}" + public_key = "\${file("~/.ssh/id_rsa.pub")}" } resource "aws_instance" "geny_aws_$index" { @@ -142,9 +142,16 @@ _EOF ./terraform plan ./terraform apply -auto-approve + sleep(10) # Connect with adb - # TODO - # ssh -i ~/.ssh/id_rsa -oStrictHostKeyChecking=no $(./terraform output public_dns_$index.id) 'setprop persist.sys.usb.config adb && exit' + echo "Enable adb for all instances" + for ((i=index;i>=1;i--)); do + dns=$(./terraform output public_dns_$index) + echo $dns + ssh -i ~/.ssh/id_rsa -oStrictHostKeyChecking=no $dns 'setprop persist.sys.usb.config adb && exit' + echo "Adb is enabled" + done + #TODO }