Unable to install test app on Apple Watch

I repeat this older thread, as it does not show on the forum with my added post !


https://forums.developer.apple.com/message/298938#298938


I answered to KMT answer (I read the referenced thread)

---------------

Looks like that triggered the name change dialog.


Can you just right click on the watch name without that happening? Try it on the phone, on the left so see what I'm looking for.

Otherwise, this sounds like what others went thru (routine pairing v o o d o o ) in this SO thread - seen it ? [ filter does not like v o o …]


https://stackoverflow.com/questions/30792520/in-xcode-i-see-no-paired-apple-watch-even-though-the-watch-is-paired-and-the-w

-------------------------


So, my question now


I run in the same problem.


I just got the Apple Watch (4, OS 5.1.1) and use XCode 10.1. OSX 10.13.6


I can create the app + WatchOS on simulator without problem. But not on device.


The watch is paired with iPhone.


I connect iPhone with USB

=> get the message :

The iPhone "iPhone XS" can not be used because it requires iTunes 12.9 or later. Do you want to download the latest version of iTunes now?


I ignore the message (as I think iTunes 12.9 requires Mojave, isn't it ?). Could it be the problem ???


In XCode, I select the scheme iPhone Xs of *** + Apple Watch of ***

I run, it compiles OK, but at the end says:


"Finished running myApp on Apple Watch of ***" in the XCode bar

Plus alert:

App installation failed

The host is not paired with the device.


I have checked in XCode Devices:

- on the left, I see iPhoneXS of ***

- but not the Watch

- On the right of Devices window, I see the PAIRED WATCHES:

Apple Watch of ***


I also checked that Apple Watch is listed with an UDID in the Devices list


The scheme was in Debug mode.

So, I changed to release mode, and get the message in Scheme that paired devices not available for debug.


So, Compile again, but then get message :

Could not launch 'Autonomie' on iPhone XS ***

There was an error preparing Apple Watch de *** for development.

Try reattaching the device to which Apple Watch de *** is paired. The device rejected the pairing attempt.


So I unpaired the device.

Reattached

Truted the host


Run again, just to get again the message

The host is not paired with the device.


I do not see which and where I should pair.

Answered by Claude31 in 352051022

I finally found the cause.


I had to accept on the watch to trust the computer.


I used this set up (everything may not be needed):

- opened XCode

- connected the iPhone to which the watch is paired to the Mac through cable

- rebboted the watch

- accepted to trust (the Yes / no answers are "hidden" bellow the watch bottom: need to scroll)


After this, first attempt to compile di generate the app on the watch.

Now, I reste the list of devices in XCode.


I can compile an App to the iPhone.


But when I try to compile with watch extension, I get error:


Could not launch 'App' on iPhone XS ***

There was an error preparing Apple Watch de *** for development.


Try reattaching the device to which Apple Watch de *** is paired. This device is no longer connected.


I did the following again


So I unpaired the device. (Device window in Xcode, right click oh iPhone Device > unpair)

Reattached (click +, wait some time, select iPhone) ; but in fact, reattched automatically as soon as I unlock iPhone XS.

Trusted the host


But no change

TMI.

Can you run the app using Xcode on that iPhone that is connected to your computer?

If no - stop and fix that.

If yes - is your Apple Watch paired to that iPhone?

If no - stop and fix.

If yes - it should work.

Can you run the app using Xcode on that iPhone that is connected to your computer?


If I compile the version of the App alone (a different project, without the watch extension), yes.

But with the watch extension, No. In fact, I get now the message in the scheme that scheme is unavailable

There was an error preparing Apple Watch de *** for development. Try reattaching the device to which Apple watch is paired. The device is no longer connected

=> I unpaired the iPhone from Device window and reattached (it reattached automatically as soon as unlocked iPhone)


If no - stop and fix that.

How could I select to compile the app alone ? (sorry for this very basic question)


If yes - is your Apple Watch paired to that iPhone?

If no - stop and fix.

If yes - it should work.


EDITED

Found an interested thread here, with a proposed analysis and solution:

h ttps://github.com/xamarin/xamarin-macios/issues/4345


OK, so the issue was that at some point I must've clicked "Don't trust this computer" on my Apple watch when I connected my iPhone to my work computer. Opening the macOS Console app and selecting the Apple watch was the only tool that gave me an error message that led me to suspect that my watch was set to not trust my computer. To fix, I had to unpair and re-pair my apple watch to my iphone, plug it in via USB and oppen XCode and/or the Console app until I got the dialog on my watch asking to trust the computer. This time I made sure to select "Trust this computer."

Now I see the device in Visual Studio 2017 Windows, but still getting a message that "debugging is not supported in this configuration." and to start without debugging.

Starting without debugging fails first attempt due to timeout due to length of time it takes to deploy. Worked second time once watch app was already installed.
I will test further in VS for Mac (just tested in VS 2017 Windows after re-pairing the watch and trusting the computer)



I'm keen to try it, but how do I unpair nthe watch from the iPhone without risking to loose all configuration (such as eSim activation) ?

Should it be done in XCode?

Device window in Xcode, right click on iPhone Device > unpair

Reattached (click +, wait some time, select iPhone)

Trusted the host


I did this, but still gets the error:

App installation failed

The host is not paired with the device.


Good news however, as also explained in this github thread:

I can go into the Watch app on the phone and manually install the Watch app and then run it (so provisioning etc, should be fine)

But if you install it from the iPhone you can't debug while running the app on the watch.


If app's name were "MyApp":


In Xcode at the top left most drop down field you should be able to select either 'MyApp' (and then the attached device or one of the simulators) or 'MyApp WatchKit App' (and then the attached 'iPhone + Watch' or the 2 simulators). It can take a long time to download into the watch through this procedure.

In fact, I select 'MyApp WatchKit App'.


Then, I select iPhone + Watch as destination.


As for debugging, I do this on simulator for the time being.


But I am very concerned that the problem I have hides some more critical issus in the set up of watch / iPhone on XCode. But what ?

>Then, I select iPhone + Watch as destination.


Try it again. If that option is available then the devices are paired and you should not see:

"App installation failed

The host is not paired with the device."

I tried a lot of times.

Option is available and marked as such in XCode!


I can transfer "manually" from iPhone to the Watch, without problem. So sure, devices are paired.


But not run from Xcode. Is it a different pairing ? Should I modify the code signing option (it is now automatic by XCode)

"I tried a lot of times" -

and I assume you are saying that each time you tried you got:

"App installation failed - The host is not paired with the device."


I don't think leaving 'automatic code signing' will get you out of this hole - I think it will only dig a hole next to the one you are in.


Look at "Window" (at the top) "Devices and Simulators" to see if there is information there.


Check out:

https://developer.apple.com/library/archive/documentation/General/Conceptual/WatchKitProgrammingGuide/ConfiguringYourXcodeProject.html

and explore the "Product"/"Scheme"/"Edit scheme" option described in that.

I will try all this out and report here.


Thanks.

Accepted Answer

I finally found the cause.


I had to accept on the watch to trust the computer.


I used this set up (everything may not be needed):

- opened XCode

- connected the iPhone to which the watch is paired to the Mac through cable

- rebboted the watch

- accepted to trust (the Yes / no answers are "hidden" bellow the watch bottom: need to scroll)


After this, first attempt to compile di generate the app on the watch.

I had this problem: (MacBook Pro 2015, iPhone 7s, Watch Series 6 44mm), Xcode 12.4, IOS 14.4, Watch OS 7.3 + slow internet)

My solution (as described in another reply) was to
  1. Be sure the watch and iPhone work..connect..communicate

  2. de-power the watch (by holding the side button until it reboots)

  3. Then reconnect the iPhone to the computer

  4. Re-power the watch

  5. Wait for the 'trust this computer' to appear ON THE WATCH!

...
Then ..after 2 days of trying everything else..from trying to find folders (that don't exists), reinstalling Xcode, re-pairing the watch, shutting down and restarting Xcode, deleting 'Derived Data', clean builds, etc etc ..and machines..etc..all to no frustrating avail.
...
Hope this helps someone else..maybe?
Unable to install test app on Apple Watch
 
 
Q