- Created a fresh Xcode project using the macOS App template.
- Set up a Xcode Cloud Workflow with a "Test - macOS" action. Using the latest environment available, currently Xcode 14.1 (14B47b) and macOS Ventura 13 RC 2 (22A380).
- App builds and tests run fine locally in Xcode 14.1 (14B47b).
But on Xcode Cloud, this is resulting in a code signing error when the test-without-building
step is reached.
Foo (7828) encountered an error (Failed to load the test bundle. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/resultbundle.xcresult. (Underlying Error: The bundle “FooTests” couldn’t be loaded. The bundle couldn’t be loaded. Try reinstalling the bundle. dlopen(/Volumes/workspace/TestProducts/Debug/Foo.app/Contents/PlugIns/FooTests.xctest/Contents/MacOS/FooTests, 0x0109): tried: '/Volumes/workspace/TestProducts/Debug/FooTests' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/FooTests' (no such file), '/Volumes/workspace/TestProducts/Debug/Foo.app/Contents/PlugIns/FooTests.xctest/Contents/MacOS/FooTests' (code signature in <AEE218C5-FDB4-3327-B270-99D8A86530EB> '/Volumes/workspace/TestProducts/Debug/Foo.app/Contents/PlugIns/FooTests.xctest/Contents/MacOS/FooTests' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/System/Volumes/Preboot/Cryptexes/OS/Volumes/workspace/TestProducts/Debug/Foo.app/Contents/PlugIns/FooTests.xctest/Contents/MacOS/FooTests' (no such file), '/Volumes/workspace/TestProducts/Debug/Foo.app/Contents/PlugIns/FooTests.xctest/Contents/MacOS/FooTests' (code signature in <AEE218C5-FDB4-3327-B270-99D8A86530EB> '/Volumes/workspace/TestProducts/Debug/Foo.app/Contents/PlugIns/FooTests.xctest/Contents/MacOS/FooTests' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?))))
I was able to narrow the command line flags Xcode Cloud is using to reproduce it locally. Running xcodebuild test -scheme Foo CODE_SIGN_IDENTITY=-
locally results in a similar error.
Same here. I tried a dozen times, and gave up last night. I now run the iOS iPadOS tests, but leave the macOS tests out. The file does exist in the artifacts, the tests run properly locally, but they fail to run outside my world.