Target Duplication for WatchOS2 with Xcode App and Extension

I have a project with the goal of WatchOS2 along with the extension. I want to duplicate the purpose of the WatchOS application and the extension. However, when I duplicate the purpose of the WatchOS application, it is still related to the old extension. Since we no longer have access to the build phases for the WatchOS application, I cannot change it in the extension phase of the Embed application.

Inital state

  • WatchAppTarget1 (built-in extension - WatchAppExtension1)
  • WatchAppExtension1

Final state

  • WatchAppTarget1 (built-in extension - WatchAppExtension1)
  • WatchAppExtension1
  • WatchAppTarget-Duplicate (insert extension still pointing to - WatchAppExtension1)
  • WatchAppExtension-Duplicate

However, if you change the purpose of the WatchOS application to accept a duplicate extension as an option for embedding (other than manually editing .pbxproj)

+4
1

, , , WatchOS, , Xcode Build phase.

project.pbxproj , , /* Begin PBXNativeTarget section */, (, ) , :

productType = "com.apple.product-type.application.watchapp2";

:

productType = "com.apple.product-type.application"; productType = "com.apple.product-type.framework";

Xcode, , " ", "Target Dependencies" "Embed App Extension" . , project.pbxproj WatchOS productType = "com.apple.product-type.application.watchapp2";

WatchOS, iOS-, !

+6

Source: https://habr.com/ru/post/1610637/


All Articles