xamarin - Enable Calabash-sandbox in Shell Script -
i trying access calabash-sandbox running shell script. shell script has
#!/bin/sh calabash-sandbox calabash-android ---
which should run calabash-sandbox , respective commands. executes calabash-sandbox , stops there.
i took @ script calabash-sandbox
runs, , seems creates new bash session, complete environment variables calabash need. so, equivalent if ran bash && echo 'test'
in script - wont see echo 'test'
part, until exit session.
but, there multitude of ways push commands new shell sessions, , 1 in particular seems work case. bash reference manual
bash includes ‘<<<’ redirection operator, allowing string used standard input command.
this means can this: calabash-sandbox <<< 'echo test'
, open new special calabash session, execute command in string, , exit session.
$ calabash-sandbox <<< 'echo test' terminal ready use calabash. exit, type 'exit'. test terminal normal.
if need more complicated did, can use eof redirect multi line string new session, this:
#!/bin/bash calabash-sandbox <<eof export bundle_id=com.tabrindle.example export device_target=$(system_profiler spusbdatatype | sed -n -e '/ipad/,/serial/p' -e '/iphone/,/serial/p' | grep "serial number:" | awk -f ": " '{print $2}') export device_endpoint=http://gobbledygook.local:37265 export code_sign_identity="iphone developer: brindleware llc (xx8799xb1x)" echo "" printenv | grep -e 'bundle_id|device_target|code_sign_identity|device_endpoint' eof
which, expect, output this:
$ ./execute_calabash terminal ready use calabash. exit, type 'exit'. device_endpoint=http://gobbledygook.local:37265 bundle_id=com.tabrindle.example device_target=34fc6d34c34e23454c234523454580b1e2345b9ef code_sign_identity=iphone developer: brindleware llc (xx8799xb1x) terminal normal.
this may not only, or best way this, works.
Comments
Post a Comment