Skip to content

Make ThinkingOrbsDemo/run.sh work on macOS - #13

Open
andresain123 wants to merge 1 commit into
Jakubantalik:mainfrom
andresain123:fix/demo-run-script-portability
Open

Make ThinkingOrbsDemo/run.sh work on macOS#13
andresain123 wants to merge 1 commit into
Jakubantalik:mainfrom
andresain123:fix/demo-run-script-portability

Conversation

@andresain123

Copy link
Copy Markdown

run.sh resolves the destination id with match($0, re, arr) — awk's
three-argument form, which is a GNU extension. macOS ships BSD awk, so on the
machine this script is written for it fails outright:

awk: syntax error at source line 2
 context is
	      d=="booted" && /\(Booted\)/ >>>  {match($0,/\(([0-9A-F-]{36})\)/, <<<

set -euo pipefail does not catch it — the awk runs inside a command
substitution whose failure is not the pipeline's exit status — so xcodebuild
just receives an empty destination id.

Replaced with a small device_udid helper built on grep -Eo, which resolves
both booted and a device name. Verified end to end on a booted iPhone 17
Pro: generate, build, install and launch all succeed.

The destination id came from awk's match($0, re, arr) — the three-argument
form, which is a GNU extension. macOS ships BSD awk, so on the machine this
script is written for it fails outright:

    awk: syntax error at source line 2

xcodebuild then received an empty destination id. Replaced with a small
device_udid helper built on grep -Eo, which resolves both "booted" and a
device name. Verified end to end: generate, build, install and launch all
succeed against a booted iPhone 17 Pro.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant