I'm creating a composite action in GitHub Actions that launches an iOS simulator. There is a step which runs a shell script that selects a simulator based on certain inputs (device and OS version) then boots it with xcrun simctl bootstatus . Something like this:
.github/actions/
# ...
runs:
steps:
- run: ${{ github.action_path }}/.sh
# ...
.github/actions/
udid=$(command that returns udid)
echo "udid=$udid" >> $GITHUB_OUTPUT
xcrun simctl bootstatus $udid -b
However, it fails with the message:
Invalid device:
Error: Process completed with exit code 148.
In my investigations I've found two strange things:
The output from
xcrun simctl list devicesdoes show a device with the UDID thatbootstatusreports as invalid.Running
xcrun simctl bootstatusas a separate step (i.e. not in the shell script) launches the device successfully.-b .github/actions/
/action.yaml # ... runs: steps: - run: ${{ github.action_path }}/.sh shell: bash id: - run: xcrun simctl bootstatus ${{ steps. .outputs.udid }} -b shell: bash # ... .github/actions/
/ .sh udid=$(command that returns udid) echo "udid=$udid" >> $GITHUB_OUTPUT
Any ideas why this is happening and how to get xcrun simctl bootstatus working successfully inside the shell script?