I have an iPhone app on Xamarin working. I just added a Watch extension project. I can deploy the app on my iPhone device, but when I try to install it on my Watch device, it fails when it reaches near 100% (icon visible with progress), and then uninstalls. There is no error message either. Any idea why?
Does your provisioning profile include the watch device? Please see:
https://developer.xamarin.com/guides/ios/watch/deployment/device/
Testing iOS apps on a real iPhone or iPad has always required the device to be registered on the Dev Center...
Watches are no different - you now need to add your Apple Watch device before deploying apps to it. Find the watch's UDID using Xcode (Windows > Devices list)...
When you know the Watch's UDID, add it to the device list in the Dev Center:...
Once the Watch device has been added, ensure it is selected in any new or existing development or ad-hoc provisioning profiles you create:
So once you add your watch to the Devices in your Apple iOS Portal, you will have to regenerate and re-download your provisioning profile after including the watch device in the profile.
Related
I am trying to run my first WatchKit application on Apple Watch (watchOS 7) from latest XCode (12.0).
I can select emulator as a destinantion, but I have no idea how to add my real watch to the list, so I can start testing on a real device.
I have iCloud account, and it seemed sufficient to run iPhone applications, but not Apple Watch.
How do I make it work?
Ok, I am not the sharpest tool in the shed.
Apart from assigning a proper Team to the Project, make sure you have your iPhone (to which the Apple Watch is paired) connected to your Mac via cable.
The "connect your iPhone using cable" was not thet obvious to me. I assumed it got the device from iCloud account.
Xcode "Run" operation fails to install a watchOS app on a real Apple Watch device with error description:
The host is not paired with the device.
Context:
First time ever trying to install a watchOS app from Xcode onto an Apple Watch device for testing/debugging
The watchOS app is an official Apple SwiftUI tutorial example
Assume latest versions of MacOS, Xcode, watchOS, Watch device, etc.
The selected scheme is the watchOS app target
The selected device is "[my Apple Watch name] via [my iPhone name]"
The Apple Watch is in fact paired with the companion iPhone, despite what the Xcode error says
The Apple Watch has not yet trusted this particular Xcode, Mac, developer account, or app. The Apple Watch should have received a "trust/don't trust" notification, but did not; this may be a bug on Apple's part.
However, we can force the notification to pop up by simply restarting the Apple Watch device. The Watch should receive the notification immediately upon restarting. Click "Trust" in the notification on the Watch. Then retry, from Xcode, the "Run" operation. The watchOS app should now install OK on the Apple Watch device.
What needs to be done is restarting both devices, iPhone and paired Apple Watch, connect iPhone to computer with cable. When the trust/don't trust notification appears on the Apple Watch or iPhone obviously choose 'trust'. Then the app will install again.
What it stops from running on your watch sometimes is if you have a simulator debug session open still. It says it can't install because there is another debug session running (but not on your watch..)! Closing this simulator session will allow you to install on your watch.
Other times xCode is building fine and thinks it's running the app on your watch, but it runs an old version and you don't see any changes made. Then you have to delete the app from your Apple Watch.
What also sometimes stops it from running on the Apple Watch are in Xcode the Preferences->Accounts->Profiles. Installing them manually will help in that case.
If nothing works uncouple your apple watch from your iPhone and recouple again.
Why isn't this still been resolved? I see people complaining about it for several of years now. Is this bug only related to standalone apps?
I have an app with development certificates and provisioning profile and I need that to be installed in
a customer device.
I don't have UDID of the device that customer is trying out.
I would like to solve this problem without disturbing customer of asking his UDID and all.
You have to add UDID in provisioning profile and sign the app with that so that you can run it on the device.
Speaking of development provisioning profile.
You have to install the development provisioning profile in the device then only you can run the app in the development device.
Use for Development was removed from Xcode in Xcode 6 and later. It is no longer possible to do this for devices using Xcode 6 or later, even with the Devices page
Try going to Window->Devices. You should see your attached device in the list so right click on the device and select Show Provisioning Profiles.It will show a window where you can add your profile.
I've tested my Apple Watch app on the simulator and it runs perfectly...However I couldn't test my app on the actual Apple Watch device:
I ran my iPhone app in Xcode.... Once completed it will install the app on Apple Watch.
Then, Apple watch app will launch and stuck on launching screen with "loading" spinner on the Apple Watch device.
The Apple watch will just close itself and this error will appear in Xcode:
You need to run the your iphone app scheme not the watchapp or extension scheme, once you will installed your iOS application on your device with watch kit support.
After installing the iPhone, you need to check your watch, application will automatically installed on Watch. If still you are not able to see the application then you need to visit application "Apple Watch" and scroll down to see your application and turn on apple watch support for your application.
If you are running the Watch OS2 app then after deploying the app on the Watch, you will need to reboot the Watch. Once rebooted, the Watch app will now run and not stuck anymore, loading time is about a few seconds only.
I am having a heck of a time trying to get this to work. At this point, I am only trying to create little test apps in xcode and "build and run" them on xcode-not on my phone.
I have a provisioning profile for my phone in the xcode organizer, but that is the only one I have.
Do I also need a separate provisioning profile for the desktop sdk?
You don't need provisioning profiles for developing on iphone simulator.
If you also want to develop on your device, first register the device when creating the provisioning profile, then upload the provisioning profile to your device.
Apple's documentation is pretty clear and easy to follow on this issue.
Good luck.
Edit: 1- You need provisioning for developing on the device, thats why it gives you a provisioning error when you try running with -iphone device xxx.
2-The blank white screen on the simulator has nothing to do with provisioning, you succeded to run your code on the simulator, but either your code does nothing or you did not link your uiwindow to your views
3-Base sdk defines that dropdown menu on the topleft. If you select iphone 3.1.2 as base sdk in project settings, you can only see simulator/device 3.1.2 on the dropdown menu, if you select 2.0 as your base sdk you will see device/simulator 2.0,2.1,2.2.1,3.0,3.1.2,... on the dropdown menu. Since you selected 3.1.2 as base sdk you don't see earlier versions on the dropdown menu.
You don't need provisioning profiles to run an app in the simulator, if that's what you mean. Just make sure you're Build-and-Go-ing for a simulator - iPhone Simulator 3.0, say - and you should be good to go.