Closed seshness closed 5 months ago
Does changing the scheme to match fix it? I think it wouldn't, since I think it's related to copying outputs. I'm also surprised that https://github.com/MobileNativeFoundation/rules_xcodeproj/commit/d44b4ed4f99e214e352ff8eb36edcb3fee3bd836 didn't fix this. We are probably doing something else wrong, possibly order related, between the host extension and the app.
Changing the scheme to include askForAppToLaunch = "Yes"
does not fix it :(
Thanks for the pointer! I'll try poking at the copy outputs phase.
I think I found a significant difference between the vanilla Xcode project & Bazel project. In the vanilla Xcode version there's a 'Target Dependency' in the main application for the extension. In the Bazel-generated project there's a BazelDependencies
Target Dependency but no extension.
If I add the extension manually in Xcode and attempt to launch in the simulator, I see an error:
Simulator device failed to install the application. An application bundle was not found at the provided path. Provide a valid path to the desired application bundle.
The path to the bundle uses Debug-iphoneos
instead of Debug-iphonesimulator
🤔
I saved the log output to this gist: https://gist.github.com/seshness/c83f895b7c97c572fea5df454bcdd708#file-investigation_02-md
What constructs paths for the Xcode launch action?
After #3005, I got the same error as you related to Debug-iphoneos
. I tracked it down to a bug in Xcode when SUPPORTED_PLATFORMS
of the extension doesn't include both simulator and device platforms. I'll get a fix for that soon.
Description
👋 I have an iOS application with a share extension using
rules_xcodeproj
.When I make code changes to my application and run the share extension scheme in Xcode to start MobileSafari in a simulator, I don't see my changes reflected.
Reproduction steps
I created a couple of minimal repos to repro what I'm seeing:
rules_xcodeproj
In the Vanilla Xcode case, I can
ShareExtension
scheme with Safari in a simulator.In the Bazel +
rules_xcodeproj
case, I need tobazel run //:xcodeproj
).ShareExt
scheme with Safari in a simulator.Expected behavior
I would like running the extension's scheme only to be sufficient to see code changes to the extension.
rules_xcodeproj version
1.18.0
Xcode version
15.3 (15E204a)
Bazel version
7.1.1
rules_apple version
3.4.0
rules_swift version
1.17.0
Additional information
I tried comparing the two generated schemes:
SampleSharingApp.xcodeproj/xcshareddata/xcschemes/ShareExtension.xcscheme
rules_xcodeproj
:SampleSharingAppBazel.xcodeproj/xcshareddata/xcschemes/ShareExt.xcscheme
and noticed Vanilla Xcode sets
askForAppToLaunch = "Yes"
whereas the Bazel-generated scheme suspiciously does not.