Add the Watch Target
Open the workspace, not the project, if your app uses any CocoaPods plugins:
open ios/Runner.xcworkspace1. Create the watchOS app target
Section titled “1. Create the watchOS app target”File → New → Target…
Select the watchOS tab → App → Next.
Fill in the target options
Field Value Product Name CarpWatch(any name works, this guide usesCarpWatch)Interface SwiftUI Language Swift Project RunnerEmbed in Companion Application RunnerActivate the scheme
When Xcode offers to activate the new scheme, choose Activate.
Set the deployment target
Select the
CarpWatch Watch Apptarget → General → Minimum Deployments → watchOS 8.0 or later.
Xcode creates a group CarpWatch Watch App containing CarpWatchApp.swift,
ContentView.swift and assets; a target and scheme of the same name; and an
Embed Watch Content build phase on the Runner target.
2. Bundle identifiers and signing
Section titled “2. Bundle identifiers and signing”The watch app’s bundle identifier must be the iOS app’s identifier plus exactly one component:
| Target | Bundle identifier |
|---|---|
Runner |
dk.carp.myapp |
CarpWatch Watch App |
dk.carp.myapp.watchkitapp |
Xcode normally gets this right when you use Embed in Companion Application. Verify it
under the watch target → Signing & Capabilities → Bundle Identifier, and check
that the build setting INFOPLIST_KEY_WKCompanionAppBundleIdentifier on the watch target
points at the iOS bundle identifier.
Set the same Team on both targets and let Xcode manage signing. With manual signing you need a second provisioning profile for the watch app’s identifier.
3. Link the AWARE framework into the watch target
Section titled “3. Link the AWARE framework into the watch target”The AWARE framework ships inside carp_aware_package as pre-compiled binaries. Xcode
already resolved them along with the plugin, so all that is left is linking them into
the watch target.
Select the watch target
CarpWatch Watch App→ General.Add the framework
Under Frameworks, Libraries, and Embedded Content, press + and pick
carp-aware-watchfrom the list of package products → AddLeave it on Do Not Embed
The binaries are static libraries and require no embedding and signing
This results in two AWARE watch modules:
com_awareframework_ios_sensor_applewatch_shared and
com_awareframework_ios_sensor_applewatch_watchOS including the other
packages they require.