10

When I use bundle id named like bellow. I have that error Unable to install "MyApp"

(My app bundle: ilyabiryuk.bundle.Ropes) But if I rename bundle like .watchkitapp It starts perfectly on simulator but give an error when I start it on my real watch(Series 3 42mm, watchOS 8.7.1) How to fix that? (IDE: Xcode 14 beta 6 (14A5294g))

3 Answers3

12

In the watch app info.plist, make sure the entry WKCompanionAppBundleIdentifier is present and that its value is the bundle ID of the iOS app.

vomi
  • 993
  • 8
  • 18
  • There is a one but: As I saw Xcode 14 doesn't create dependences between watch and iOS app, so you have to create them by your own – Plutonictoast1 Sep 16 '22 at 19:18
  • I just had this issue on Xcode 14, tried many things including adding ```WKCompanionAppBundleIdentifier``` but it didn't work. Ended up doing something w/ the automatic provisioning and then it worked. (nothing new was added to the ```info.plist```) – app4g Nov 26 '22 at 09:24
2

Bundle IDs should be as following:

  • iPhone app bundle ID: com.myname.myapp
  • Watch app bundle ID: .watchkitapp
  • Watch extension bundle ID: .watchkitapp.watchkitextension

Note that Watch app and extension DOES NOT have parent application and start by a point (ie. relative bundle ID).

chepiok
  • 193
  • 12
  • To confirm: BundleID for target WatchOS app should be ".watchkitapp" without com.appname? because when I do that I get Error: "The app identifier ".watchkitapp" cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string to try again." – Ask P Dec 26 '22 at 03:56
0

For anyone tried all answers above. Here is what I got that finally worked:

  1. Clean Build Folder
  2. Add your iOS app bundle to WKCompanionAppBundleIdentifier

Your simulator will scream that provisioning failed, ignored it.

  1. Add your iOS app bundle to the Watch's Build Identifier field.

Your simulator will scream that .watchkit 2.0 error and still will not work. Ignore it.

  1. Save and close Xcode
  2. Relaunch Xcode, and then build.
  3. Worked for me with steps above.
Legolas Wang
  • 1,951
  • 1
  • 13
  • 26