Skip to content
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

Use remote-runnable launch actions for Apple Watch schemes #798

Merged
merged 5 commits into from
Mar 26, 2020

Conversation

daltonclaybrook
Copy link
Contributor

Resolves #736

This PR fixes an issue that prevents a Watch app from being launched using the generated scheme. The BuildableProductRunnable launch action has been replaced with a RemoteRunnable action, and the host app has been added as a BuildActionEntry. This more closely matches the scheme that Xcode generates when creating a new Apple Watch app target and seems to work correctly when building/running the target from Xcode.

@daltonclaybrook
Copy link
Contributor Author

@yonaskolb Let me know if there are any changes you think need to be made, stylistic or otherwise.

@daltonclaybrook
Copy link
Contributor Author

@yonaskolb Is there any interest in getting this bug fixed? My team at Peloton has recently started using XcodeGen and we're loving it ❤️, but we currently have a hack-fix in place for this issue in particular. If this is not the best approach, please let me know.


$0.it("generates scheme with remote runnable for watch") {
let xcscheme = try self.makeWatchScheme(appType: .watch2App, extensionType: .watch2Extension)
try expect(xcscheme.launchAction?.runnable).beOfType(XCScheme.RemoteRunnable.self)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the opposite check elsewhere? To ensure we only make it a RemoteRunnable in this case, and a BuildableProductRunnable elsewhere?

@brentleyjones brentleyjones self-assigned this Mar 26, 2020
Copy link
Collaborator

@brentleyjones brentleyjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brentleyjones brentleyjones merged commit 039f6c3 into yonaskolb:master Mar 26, 2020
@daltonclaybrook daltonclaybrook deleted the watch-app-scheme branch March 26, 2020 13:15
@tschob
Copy link

tschob commented Mar 31, 2020

@daltonclaybrook Did you encounter this issue with a standalone watch app?

When debugging my schemes, I also noticed the difference between Xcode and XcodeGen regarding RemoteRunnable. But even with your fix, I am not able to create a scheme for a companion app (builds app + watch target). I assume that my (basic) setup is currently not supported with XcodeGen, but I also might simply miss the trick which let XcodeGen understand that it should pick the watch app as executable instead of the app target.

@daltonclaybrook
Copy link
Contributor Author

@tschob I tested this fix with a companion watch app. I will try to test again soon now that it's merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to install watchOS app
3 participants