I just spent a week reading the internet (six times) trying to get a companion watch app to work on my Apple Watch. I finally succeeded, and I want to share some things that may help others avoid a lot of stress.
First, there is a trick to setting up the Target when you first setup your environment. I am doing a combination of Flutter using Cocoapods and Swift (on the watch). Assuming you have your existing Flutter app you need to go to File>New>Target and select WatchOS and then App. That gives you a dialog where you give it a Project Name like MyWatchApp (this is what will be dispayed on the Watch). You will choose the option for adding to existing ios app. You're going to add it to Runner (or what your app name is). Create it. For whatever reason it leaves out one critical setting that if you don't fix it will never deploy to your devices. With your watch target selected go to Build Settings and search for Supported Platforms. If it is empty put watchOS in there. Then go back to the General tab and your watch app should show in Supported Destinations.
I did not have to add this to my Runner/Info.plist to make it work. I saw this in a lot of posts. I think this may have been a technique to migrate from pre Xcode 15 that used the watch Extension Kit.
<key>WKCompanionAppBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
If you are starting from Xcode 15 I don't think it is necessary.
It's also helpful in testing and local builds to make sure your laptop, phone, and watch are all on the same wifi network and that network is a 2.4 ghz network.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: