How to run Watch App in XCode - ios

I created a watch app, following Apple's guide lines, but not sure how to run it in the simulator.
When I select the Watch App scheme and run it, the iPhone simulator appears, and I can see WatchKit extension running, dumbing some logs
2014-11-19 13:28:56.991 WatchApp WatchKit Extension[61833:6371439] <WatchApp_WatchKit_Extension.InterfaceController: 0x7b652010> init
2014-11-19 13:28:56.992 WatchApp WatchKit Extension[61833:6371439] <WatchApp_WatchKit_Extension.InterfaceController: 0x7b652010> will activate
But nothing happens on the simulator's screen.

What you run your WatchKit extension, you need to go to Hardware > External Displays and select an Apple Watch (there are two sizes, either works).
After this, you can make changes to your code in Xcode and run it, and the changes will be reflected in the WatchKit simulator without you having to mess with enabling the simulator again.

If your Watch simulator screen appears, but is black, then that means you have not run the correct target from Xcode. Go back to Xcode and select the "xxx Watch App" target, then run the simulator again. Your external display should now show the Watch App.

Related

Download my application on the simulator. Xcode

After my Xcode simulator runned an old version of my application i clicked "erase all content and settings". Now my simulator doesn't show the application at all.
The app i made previews perfectly on the canvas in Xcode, but the app doesn't appear in the simulator.
I am running Xcode 11.5.
How do i get the updated app to run in the simulator?
Just try to reopen Xcode and chose any simulator you want and wait until app will open
Press Command + r, then Xcode will build the app and install it in your simulator. Might take 30 seconds or so, when it is done the app will launch automatically.

Xcode does not deploy or launch Apple Watch simulator

I change the scheme to Apple Watch and hit run, the watch simulator shows up but my app icon is not even seen on the home screen of watch.
I have been trying for days now. I tried cleaning project, cleaning build folder, removing derived data, removing files in the watchOS DeviceSupport, restarting Xcode(9.2), restarting Apple Watch Simulator
(External Displays option does not shows Apple Watch Alternatives by the way)
Can you help with the possibilities that might cause this issue?
What else should I try?
Xcode does not launch my app on the watch simulator :/ this is the summary of the issue.
On the iOS(iPhone) simulator launch the Apple "Apple Watch" app (not your app) scroll all the way down to the buttom, down there your app should have a loading icon next to it, wait 20 minutes if the icon haven't shown up on the watch, restart your computer, with the option to relaunch all apps ticked to off, launch xcode, then try the above mentioned.
When trying out my first watchOS app, I was seeing the same behaviour. I could not find the app's icon in the simulator. The following is what I did.
I stopped the app in Xcode.
Launched it again.
This time I opened the main app in the iPhone simulator also.
The icon for the app appeared in the watch simulator among other apps and the app launched.
For ~10 seconds a loading indicator was shown.
I was able to continue debugging normally from then on.

Cannot run my app on iPhone because it's not paired with a watch?

I updated one of my apps to also run a little code on Apple Watch. I do not own an Apple Watch. After taking the time to do this, I found that Xcode refused to run my app on my phone, because the phone is not paired with an Apple Watch. Is it supposed to work that way? What about all of the customers who do not yet own an Apple Watch? Can they not use the app any longer?
Obvious it is. Because if you don't have an iWatch, you have to run your app on simulator only. To get iWatch simulator, click on iOS simulator -> Hardware -> External Displays, and then select Apple Watch-32mm OR Apple Watch-42mm. Firstly run your app on iPhone simulator then run iWatch app, that automatically will run on iWatch simulator.
If you just change your iphone app and run it without watch.
Click the button (it will open like drop down) of on your xcode near app run and stop buttons, just select your iphone app (its name without watchkit) and run it. It will show you just phones in selectable devices for emulators.
Other one (watchkit) show you phones + watch like "iphone 7 + Apple Watch Series 38 mm". If you select watchkit and run it. It will expect apple watch.

Can I debug code in the parent iOS App when it is awoken by a WatchKit App/Extension?

I want to debug code in the application:handleWatchKitExtensionRequest:reply: method of my AppDelegate.
If I debug the WatchKit App then when it launches the iOS App to call this method, the debugger is not attached. Is there a way to get the debugger to attach to the iOS App when it is launched from WatchKit as opposed to the Xcode run/debug command?
Yup.
Run your WatchKit application via Xcode, then manually launch your associated iOS application on the simulator.
Once it's launched, use the Debug menu in Xcode to Attach to Process…. You'll see your iOS application running there.
You'll then have two active debug sessions accessible in the Debug Navigator (⌘+6). You can switch between them there.
After you run your WatchKit app and it is attached to the debugger, manually open your iPhone app in the simulator by tapping on its icon. Then in Xcode go to Debug -> Attach To Process in the menu and select your iPhone app. Now Xcode should be attached to both your WatchKit extension and your iPhone app and you can set break points in either the iPhone app or your extension.

Apple Watch App Image Control

I have just downloaded Xcode 6.2 (Beta) and tried my first app on Apple Watch. I have tested the app successfully by putting a simple static label and ran the app perfectly. However, when I am trying to put an Image control on the Interface Controller, it shows up onn the storyboard but not when the app is launched in the Apple Watch Simulator.
Here is what storyboard shows
But this is what happens when I run the app
I am not an expert not even intermediate level iPhone developer but just a learner, so may be I am missing some thing basic.
Any help will be appreciated.
Thanks
Select the image file in XCode
Open Utilities View in XCode (The right most icon in the screenshot below)
Select you watch app target check box under "Target Membership"
heading.

Resources