Skip to content

Embed watchOS apps in PlugIns directory for Xcode 16+#1614

Open
BigBalli wants to merge 1 commit intoyonaskolb:masterfrom
BigBalli:fix/watchos-plugins-embed
Open

Embed watchOS apps in PlugIns directory for Xcode 16+#1614
BigBalli wants to merge 1 commit intoyonaskolb:masterfrom
BigBalli:fix/watchos-plugins-embed

Conversation

@BigBalli
Copy link
Copy Markdown

@BigBalli BigBalli commented Apr 2, 2026

Summary

Starting with Xcode 16, watchOS apps must be embedded in the parent app bundle's PlugIns/ directory instead of the legacy Watch/ directory. Without this change, installing on device fails with:

MyWatchApp.app is a Foundation extension and must be embedded in the parent
app bundle's PlugIns directory, but is embedded in the parent app bundle's Watch directory.

Changes

In PBXProjGenerator.swift, the "Embed Watch Content" copy phase now checks the project's xcodeVersion:

  • Xcode 16+: dstSubfolderSpec = .plugins (13), dstPath = ""
  • Xcode < 16: dstSubfolderSpec = .productsDirectory (16), dstPath = "$(CONTENTS_FOLDER_PATH)/Watch" (unchanged)

Test plan

  • Existing tests pass (the test fixture uses the default xcodeVersion 14.3, so it continues to use the legacy Watch/ embedding)
  • Verified with a real watchOS project on Xcode 26.4 that the generated project installs correctly on device

Fixes #1613

Starting with Xcode 16, watchOS apps must be embedded in the parent
app bundle's PlugIns/ directory (dstSubfolderSpec=13) instead of the
legacy Watch/ directory (dstSubfolderSpec=16). Gate the behavior on
xcodeVersion so older projects continue to work.

Fixes yonaskolb#1613
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.

watchOS app embedded in Watch/ instead of PlugIns/ — fails on Xcode 26

1 participant