Why does `xcrun simctl bootstatus <udid> -b` error with "invalid device" message when run in script file in GitHub Actions?
12:01 24 Jul 2025

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 -b. Something like this:

.github/actions//action.yaml

# ...

runs:
  steps:
    - run: ${{ github.action_path }}/.sh

# ...

.github/actions//.sh

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 devices does show a device with the UDID that bootstatus reports as invalid.

  • Running xcrun simctl bootstatus -b as a separate step (i.e. not in the shell script) launches the device successfully.

    .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 -b working successfully inside the shell script?

ios github-actions ios-simulator xcrun simctl