Hello everyone,
I am currently building a swift library that has a technical limitation of running tests in iOS Simulator with Rosetta only (since it depends on a library that can only, for now, build it for iOS Simulator x86_64).
Currently, I can run this swift library tests in XCode with an iPhone Rosetta target, but I want to understand how to run these tests from the command line. I am not an expert in xcodebuild tool, so if anyone can help me, I would appreciate a lot.
I have tried, without success, running:
xcodebuild -scheme MyLibrary -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath build -verbose EXCLUDED_ARCHS=arm64 VALID_ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO test
In which I get an error similar to:
xctest (17305) encountered an error (Failed to load the test bundle. If you believe this error represents a bug, please attach the result bundle at [...] MyLibraryTests' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))))
I suspect it's not running xctest
with arch -x86_64
. So I have also tried:
arch -x86_64 xcodebuild -scheme MyLibrary -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath build -verbose EXCLUDED_ARCHS=arm64 VALID_ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO test
But result is the same.
I want to understand what is the command that XCode runs the tests in iOS Simulator with Rosetta. Other IDEs prints the command line used, but I could not find any setting that would tell XCode to print it.
Any help appreciated.
Thanks in advance, --Thiago