-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generating schemes with BuildableProductRunnable for watchOS targets causes errors in Xcode 14 beta #1226
Comments
I've tested creating new schemes for watchOS targets in Xcode 14.0 beta 2 and 13.0, and it looks like in both cases Xcode uses It looks like If this is appropriate, it looks like some sort of change could be made here: https://github.com/yonaskolb/XcodeGen/blob/2.29.0/Sources/XcodeGenKit/SchemeGenerator.swift#L323 |
Sounds like this may be fixed in the beta 3 which came out yesterday: Swinject/Swinject#511 (comment) I haven't downloaded the new beta yet to verify that. |
I don't believe this issue was fully fixed. In beta 4 (and also beta 3, based on a report from my colleague), it's true that the DVTAssertion is no longer thrown, but instead this issues causes xcodebuild to say there are no compatible watchOS simulators. This can be seen with the original repro case when running a different xcodebuild command: xcrun simctl list devices watchOS
# Pass the device id of a valid watchOS simulator
xcodebuild -project Foo.xcodeproj -scheme Foo -destination "platform=watchOS Simulator,id=<device id>" build This results in an error like the following:
When performed on Xcode 13, this succeeds. |
A change like this does seem to fix my issue: diff --git a/Sources/XcodeGenKit/SchemeGenerator.swift b/Sources/XcodeGenKit/SchemeGenerator.swift
index 60922f2..db4062d 100644
--- a/Sources/XcodeGenKit/SchemeGenerator.swift
+++ b/Sources/XcodeGenKit/SchemeGenerator.swift
@@ -320,10 +320,11 @@ public class SchemeGenerator {
)
let profileAction = XCScheme.ProfileAction(
- buildableProductRunnable: runnables.profile,
+ buildableProductRunnable: nil,
buildConfiguration: scheme.profile?.config ?? defaultReleaseConfig.name,
preActions: scheme.profile?.preActions.map(getExecutionAction) ?? [],
postActions: scheme.profile?.postActions.map(getExecutionAction) ?? [],
+ macroExpansion: runnables.profile.buildableReference,
shouldUseLaunchSchemeArgsEnv: scheme.profile?.shouldUseLaunchSchemeArgsEnv ?? true,
askForAppToLaunch: scheme.profile?.askForAppToLaunch,
commandlineArguments: profileCommandLineArgs, But I have no idea if it breaks anything else 😅 If I can find more ways to validate this, perhaps I can open a PR. |
With an example
project.yml
like this:And performing the following steps:
When using Xcode 14 beta 2, the final step errors with:
The cause appears to be in the profile action of the scheme. If we manually edit the generated scheme in the follow way:
Then the assertion failure stops and the xcodebuild command completes successfully.
A couple projects appear to have run into versions of this issue: Swinject/Swinject#511, square/Valet#282.
This seems like a bug in Xcode 14 which may be fixed in future betas, but I wanted to let you know in the meantime!
The text was updated successfully, but these errors were encountered: