Post

Replies

Boosts

Views

Activity

Reply to Xcode 12 issues running multiple test suites with 'Underlying Error: Invalid device state' [only when running via SSH]
This has been doing my head in for the last week. I discovered that our CI was running in rosetta, which means in all child processes also running in rosetta. This included our final xcodebuild commands, which would then fail to run on an arm64 simulator. From the Rosetta Documentation - https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment - there is the following note: The system prevents you from mixing arm64 code and x86_64 code in the same process. Rosetta translation applies to an entire process, including all code modules that the process loads dynamically. I read this, but initially didn't realise this would apply to child processes, too. The fix was to use the 'arch' command to force xcodebuild to run on arm64. arch -arm64 xcodebuild ... 'arch' can also be run with no arguments to print the current environment (arm64 or i386 etc). You could then cater your pipeline to the different build environments.
Mar ’21