I just got back into iOS / WatchKit development after a ~8 year break. I'm having a really hard time making an app for the watch, because
Simulator is not helping because random things seem unsupported (most recent example being WCSession.transferFile, which apparently is a bug)
On device is not helping because the loop to get it to run on device is completely out of hand, and I was not able to get either logging or debugging to work when running on device. (My main problem is that if I do CMD R in Xcode with my Watch selected as target, it builds, and says running, but never launches the app. If I launch the app manually I find it's not the most recent version. I have to go and remove it from the watch, and re-add it, which then causes Xcode to not be able to run it anymore, which means I have to restart Xcode. What.)
So my question to more experienced devs is: what's your debug cycle when writing Apple Watch apps?
I'm running Xcode 12, watchOS 7.1, on Mac OS 10.15.7 (not Big Sur which may be some cause of issues)
Some steps that help for on device debugging:
To re-install the watch app, select the iPhone app in Xcode and build and run that. This will also re-build and re-install the watch app as needed.
Open the app manually on the watch
I still haven't figured out how to get a debugger or console, but for now my hack is to have a label on the watch that I use as my on device console.
This is almost certainly an Xcode 12 issue. At least since Xcode 12.5 my app has not worked with watch simulator (it can't connect to the phone simulator) and I get no debugger with a real device.
Using Xcode 12.3 seems to work.
I created an application for Apple watch Model MJ3T2B/A using health kit. It is with watch OS version 2.0. I used Xcode version 7.3.1 to create the app and installed it in my iPhone using diawi. I am not able to run it directly since it said deployment version of watch app is 2.2 and the one i am using is 2.0.
When i enable Show App in Apple Watch it is automatically getting disabled after some time in iPhone(iOS 9.3.2) watch application. Do i need to use different xcode version to create my app? I am not getting any OS updates also in my iPhone app. It says watch OS 2.0 and software is upto date.
I got what was the issue. It is the deployment target which keeps me from installing the watch app. I changed the deployment target to 2.0 in Project->Build settings and now i am able to install the application
For me it helped to check "Window" > "Devices and Simulators". For the iPhone to which the relevant Apple Watch is paired, the name of the Apple Watch was shown as <null>. After unpairing the iPhone (right click > "Unpair Device") and pairing it again, the issues was gone.
Afterwards I was able to select the WatchKit App in the Schemes list and select the entry for "My iPhone + My Apple Watch" in the Device list and Run/Debug the app.
It has also sadly shown that the issue re-appears multiple times during the day and I have to repeat these steps.
I had to add ClockKit.framework as an Optional library under the watch app Extension "Link Binary With Library" Build Phases because I was using the WatchOS 5.0 function called CLKFullColorImageProvider which was causing the app to crash. But, before I did this, I set the deployment target to match that of the Watch OS (4.3 in my case) so the app would run from XCode and dump out the error. So, it seems that changing the deployment target is a good way to get the app to install in order to debug other problems.
I found this answer here: https://forums.developer.apple.com/thread/108598
I had a similar issue where the Apple Watch app would fail to install my Development Apple Watch App. I was able to finally get it installed by increasing the Bundle Number the iOS App and the WatchKit App.
I'm new to working with Apple watch. I'm trying to install the hello world watchkit app into iwatch OS Version(1.0) that has been paired with my iPhone5c OSversion(9.1). When I try to choose the Build target device from the list of devices in Xcode it clearly shows that "Unavailable device" target. Below is the error message.
I did mouse over on the The OS version installed on watch apple watch doesn’t support Watchkit Extention products. Please see the below image for your reference. I would like to know what is the exact issue here and how can I fix it by steps and attach the device with Xcode 7.2 to run.
The answer is that the OS on your Apple Watch is lower than it'll support for testing, they changed some of the API in Watch OS v2. If you update to OS v2 you should be able to use it for development.
I have a WatchKit app that runs fine in the Simulator. But when I try to run it on an actual device it never finishes installing and never provides any error message or feedback.
The iOS app installs and runs fine. I bring up the Apple Watch app on the iPhone and it lists the app and shows the correct icon. Selecting that, the "Show App on Apple Watch" switch is on. Underneath it it says, "Installing...". And it stays there.
I can also see the app icon on the Apple Watch. Selecting it just shows the spinning wheel indicator as if it is trying to load.
Things I've tried based on other suggestions I've found here, on the Apple Developer forums, and around the web:
Verified that all app bundle IDs are correct and match.
Verified that the deployment target is iOS 8.2.
Verified that the WatchKit App runs in the simulator.
Verified that my provisioning profile includes my Apple Watch's UDID.
Verified that my Apple Watch shows up as a "Paired Watch" in Devices.
Deleted the app from my phone, and then rebooted my phone, watch, and Macbook before reinstalling.
None of the above work. Any suggestions?
Thanks!
Thomas Aylesworth
A friend who works on the USA Today iOS team, including the Apple Watch app, suggested I go to the project settings for the WatchKit App target and set "Skip Install" to NO. Sure enough, after doing this, I was able to install.
I've found it very useful for reading the iPhone console log. (Not to be confused with crash logs).
Use Xcode --> Window --> Devices -- select your plugged in iPhone, and make sure the log screen lower left arrow is down.
In my case, I had invalid provisioning profile entitlements, which were corrected via the Apple Dev portal, and re-downloading the profiles -- after making sure the entitlements were correctly being set in the WatchKit App Capabilities.
Check Info.plist file. In my experience if there is something added there that is not supposed to be there, it will cause this behavior. I added NSLocationWhenInUseUsageDescription and it caused this same issue.
I have found a similar problem due to my storyboard referencing an image which I later deleted (I no longer actually used it anymore). This gave the symptom of running ok on simulator but not deploying fully on hardware as you are seeing. To exclude this potential problem go through each image view on your apple watch storyboard and look out for the exclamation mark against image view entries.
I had the same problem but for me it actually turned out that the Apple Watch was running a WatchOS version lower than what what I had in XCode. I could not see a runtime warning about this (it just silently failed), but when selecting WatchKit scheme in XCode with device connected there was a small warning about version requirement.
You can also try deleting the watch app on the watch by long tapping on the icon and then you should get the giggle UI with a X on 3rd party apps. You can then delete the watch app and retry the install.
I was getting this error too, and I got it to install, after creating a new project from scratch in the non-beta Xcode, and copying my assets and code into the new project. I had the same problem, and tried everything that people suggested on other posts, without any success, including everything that you listed above.
Apparently, there was something incompatible with the way the project was stored in the beta Xcode, that I had created for the WatchKit app.
Here's what works for me with iOS 8.3 and Watch OS 1.0.1:
Make sure your app is finished installing on your iPhone.
Restart the iPhone by holding down the Home button and Wake/Sleep buttons.
Launch the TestFlight app on your iPhone.
Staying in TestFlight, go to your app's detail page and toggle the Install on Apple Watch to the On position.
Press the Home button on your iPhone to exit the TestFlight app.
Press the digital crown on the Watch to get to the Home screen. An icon for your Watch app should appear and begin installing.
make sure your app support 64Bit, otherwise it cannot run on Watch,just spinning there.
Did you add a custom entry to the of your Info.plist of the WatchKit App
This isn't allowed and it will fail validation and will just sit on Install...
Checkout the device console log for information on it
Yeah, had that problem too.
I deleted the Xcode Beta (and the .dmg) downloaded it again and installed it.
Don't have that problem anymore.
In my case, I disconnect the iPhone and the Mac, reconnect them via data line. Then something appear on my watch, a choice, agree or disagree, agree it. After that, Xcode begin to install symbols for watchOS 2.1:
When this is done, you can check it in Library->Developer->Xcode->watchOS DeviceSupport->Watch1,1 2.1 (13S661)->Symbols
Then I disconnect the watch and iPhone, reconnect it. Now I can install WatchKit App on my watch.
I have followed the answer by #hunterleebrown to see the log and found that the WatchOS version is not updated (i.e. Watch OS version is lower than the required version).
Here is the screenshot [ The log says (4th line): The system version is lower than the minimum OS version specified for bundle at ... ...]:
Then I went to the iPhone's watch app's-->general settings-->Software Update and found the watch OS is not updated (which is obvious). Then I downloaded the update and installed it. Then it worked!
Note: I also tried quitting XCode, restarting iPhone and Watch but didn't work for me.
Press "Trust this device on Apple Watch"
I had the same endless installation issue ending with a Time Out error and I finally fixed it thanks to this answer: https://stackoverflow.com/a/61636074/2854405
I had to:
Unpair my iPhone (from the "Devices and Simulators" screen),
Exit Xcode
Replug my iPhone
Trust the iPhone again when it was prompted
Start Xcode
Rebuild
I also had the same issue.
#SwampThingTom suggestion is good, but it changes the archive format as well size increases too.
In my case, the issue was DER entitlements not working only watch app, mobile app was fine.
Make the changes as per the comment over here This Code Signature is no longer supported when building app on iPhone 12
Upgrade to Xcode 13.1
In my case I resolved this problem when selecting the WatchApp target to creating AdHoc.
So, for example, there is three targets in project:
Demo;
Demo WatchKit App;
Demo WatchKit Extension;
If create AdHoc with Demo target, you will get infinite installation.
If create AdHoc with Demo WatchKit App target, the problem goes away.
application context: ios7, xcode 5, written with titanium appcelerator (sdk 3.1.3GA), previous version compatibility was as the image says (directly from itunes connect)
the complete error is
this bundle does not support one or more devices. supported by the revious app version. your app update must continue to support all devices previously supported. your declare supported device in Xcode with the Targeted Device Family build setting. Refer to QA1623 for additional information: https://developer.apple.com/library/ios/qa/qa1623/_index.html
Now. I checked in the building settings as what the message says and the results is attached as images.
as you can see, I should cover all the apple devices (iphone/ipad), but still giving me the same error. anybody knows why?
thanks in advance
Your app was previously supported iPad too. You cannot drop support for a device family (iPhone or iPad) in an update. Make your app universal in project settings>General tab.
The solution for my problem was to simply rebuild the archive from titanium (publish app to apple store) and then archive the app.
I have selected Universal device for universal target.
no issue were found.
so it seems actually there's no problem in the process, but still don't know why there was that device compatibility problem.