Search code examples
xcodeswiftuiwatchkitprovisioning-profilewatchos

How to set Bundle Ids, App Identifiers and Provisioning Profiles to publish a WatchOs App made with SwiftUI and XCode?


I made a watchOS app with Xcode 12 and SwiftUI but I really struggle trying to publish it. An watchOS app has three pieces of code:

  • the app
  • the watchkit app
  • the watchkit extension

I've tried to use the same bundle id for all (in the format: com.domain.appname). That failed. So I've tried to use a different bundle id for each as follow (knowing I've create the 3 App Identifiers and the 3 Provisioning Profiles matching those on developer.apple.com).

  • the app (bundle id: com.domain.appname)
  • the watchkit app (bundle id: com.domain.appname.watchkitapp)
  • the watchkit extension (bundle id: com.domain.appname.watchkitextension)

This failed to build with this error: enter image description here

So I cannot build or Archive my app. Then I've used the same bundleId for both App and Extension like this:

  • the app (bundle id: com.domain.appname)
  • the watchkit app (bundle id: com.domain.appname.watchkitapp)
  • the watchkit extension (bundle id: com.domain.appname.watchkitapp)

With these settings I can build and archive the app. However when I try to upload it to the app store (with XCode or with the external app called the transporter) I got this error:

enter image description here

So at this point I'm lost... Is there someone here who has been able to publish a watch os app using swift UI and Xcode and who can tell me how to use Bundle Ids, App Identifiers and Provisioning Profiles to do so. Thanks


Solution

  • In Target > General > Bundle Indentifier

    They should be incremental for the extension targets

    • Main app = com.domain.appName

    • Watch app = com.domain.appName.watchkitapp

    • Watch extension = com.domain.appName.watchkitapp.watchkitextension

    Your extension isn't unique (it doesn't add the extension part) from what I can see.

    Also, your Version and Build in the same area should match all 3 Projects