Is there somehow to change automatically my Bundle Identifier for my Companion App?

Hello!

In my project here we have 3 build modes / schemas for our iPhone app: Dev, Stage, Prod. And each one has one bundle identifier, for example, com.myproject.app-Dev, com.myproject.app-Stage and com.myproject.app.

How do I can get each bundle identifier and store it inside the WKCompanionAppBundleIdentifier key automatically? Is it possible? Because, sometimes we need to build manually the Stage version here and XCode says the info.plist key for WatchOS App is different from the iPhone App.

Replies

You not only have to change the WKCompanionAppBundleIdentifier key every time you change your iOS app's bundle identifier; you also have to change your watchOS app's bundle identifier. The root bundleID must match between iOS and watchOS. (e.g., com.myproject.app/com.myproject.app.watchkitapp -> com.myproject.app-Dev/com.myproject.app-Dev.watchkitapp).