Hi,
Overview
I am using Xcode Cloud for my multi platform app.
The macOS test case fails, however the iOS test case runs and succeeds.
I don't have any UI test cases written, the test case are simple and have nothing platform (macOS) specific.
Questions
- What can I do to fix this?
- Is there any user privileges needed to launch the macOS app for testing? I ask because when I ran the UI tests locally it launched the app and asked for my macOS user password. Just wondering if that is the reason it didn't launch in Xcode Cloud.
Error:
<Appname> encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/resultbundle.xcresult.(Underlying Error: Could not launch "AppnameTests. The LaunchServices launcher has returned an error. Please check the system logs for
the underlying cause of the error. (Underlying Error: The operation couldn't be completed. Launch failed. (Underlying Error: Launch job spawn failed) )))
× Could not launch "<Appname>"
× Could not launch "AppnameTests"
× AppnameUITests.testExample()
Failed to get launch progress for <XCUIApplicationImpl: 0x600000564630 <BundleID> at /Volumes/workspace/TestProducts/Debug-Dev/<Appname>.app>: Could not launch "app name". The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error. (Underlying Error: The operation couldn't be completed. Launch failed. (Underlying Error: Launch job spawn failed))
AppnameUITests.swift:28
* AppnameUITests.testLaunchPerformance)
Failed to get launch progress for «XCUIApplicationimpl: 0x60000054630 <BundleID> at /Volumes/workspace/TestProducts/Debug-Dev/<Appname>.apps: Could not launch "<Appname>". The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error. (Underlying Error: The operation couldn't be completed. Launch failed. (Underlying Error: Launch job spawn failed))
AppnameUITests.swift:37 g
* AppnameUITestsLaunchTests.testLaunch)
Failed to get launch progress for «XCUIApplicationimpl: 0x60000054630 <BundleID> at /Volumes/workspace/Testroducts/Debug-Dev/<Appname>.apps: Could not launch "<Appname>". The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error. (Underlying Error: The operation couldn't be completed. Launch failed.
AFAICT this is a limitation of Xcode Cloud. If your Mac app uses restricted entitlements [1], you encounter exactly this error.
SteveM-JC wrote:
Thanks for filing the bug and posting the bug number; it was instrumental in me being able to track this down.
The restricted entitlement factor is the reason why some apps work and some apps don’t, and why an app can transition from working to not working. In your case, the Keychain Sharing capability is backed by a restricted entitlement, and that’s why adding that capability ‘broke’ this.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] That is, an entitlement that must be authorised by a provisioning profile. See TN3125 Inside Code Signing: Provisioning Profiles.