1. Create the watchOS app target
1
File → New → Target…
Select the watchOS tab → App → Next.
2
Fill in the target options
3
Activate the scheme
When Xcode offers to activate the new scheme, choose Activate.
4
Set the deployment target
Select the
CarpWatch Watch App target → General → Minimum Deployments →
watchOS 8.0 or later.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
The watch app’s bundle identifier must be the iOS app’s identifier plus exactly one component:
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
The AWARE framework ships insidecarp_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.
1
Select the watch target
CarpWatch Watch App → General.2
Add the framework
Under Frameworks, Libraries, and Embedded Content, press + and pick
carp-aware-watch from the list of package products → Add3
Leave it on Do Not Embed
The binaries are static libraries and require no embedding and signing
com_awareframework_ios_sensor_applewatch_shared and
com_awareframework_ios_sensor_applewatch_watchOS including the other
packages they require.