Reputation:
My current script looks something like this:
#!/bin/sh
cd Desktop/work-directory/project-directory/
code .
npx expo run:ios -d
sleep 10
xdotool key Return
npx expo run:ios -d
command to run my build on my local device.npx expo run:ios -d
I am asked to "Select a simulator" where I pick which simulated device I want to create the build for.From an outsiders perspective, might anyone be able to shed some light on what I might be doing wrong? Is my syntax wrong? Does someone know if I have to use any different tools from xdotool
to interact with the Expo CLI prompt? Any and all help would be greatly appreciated.
yes
and that did not work. I specifically need enter or return.Expect
and unsure if that is the route I want to go/the tool I even need.Thank you so much and I look forward to hearing from y'all within the Bash community :)
Upvotes: 0
Views: 40
Reputation:
To answer my own question, I actually didn't need to simulate a return keyPress to automate one of the commands within the Expo CLI
I was able to come to a solution by using the following tool: FIG (https://fig.io/)
When I would input npx expo run:ios -d
, before pressing enter like I usually do, fig had auto populated the device id to go after -d
. Which made the whole command look something like this npx expo run:ios -d 00008030-000537H31B5573F
(Numbers and letters have been changed).
This alone allowed me to essentially respond to one of Expo's interactive prompts by providing the device id before it was ever asked.
Hopefully this can help someone else in the future. Cheers.
Upvotes: 0
Reputation: 1707
Looking at the manual page, , look for the reference to "Navigator".
That gives an example of how to make xdotool locate the window associated with your npx expo process, so that it can then send that signal to it.
Upvotes: 0