I can't run a watchkit app from a new project. If I run Apple's sample project it runs fine. If I add watchkit to my existing project by adding a target for watchkit. Then run it I get a black screen with the time even though in my storyboard I have an interface controller that is set to main that has a blue background. This line of code gets called.
- (void)willActivate {
// This method is called when watch view controller is about to be visible to user
[self.listTable setNumberOfRows:5 withRowType:@"List"];
NSLog(@"%@ will activate", self);
}
My main app(iPhone app) for iPhone doesn't get run on the simulator.
This is basically what I see.
The WatchKit framework provides infrastructure for creating watchOS apps, including an extension delegate that manages background tasks, extended runtime sessions, and Siri intents. The framework also performs other support tasks, such as accessing information about the user's Apple Watch.
To build a watch-only app, start a new project in Xcode, select the Watch App template, and click Next. Provide a name, and choose the interface, life cycle, and language for your watch app. Select the options to include a notification scene template or unit and user interface tests, and click Next.
In watchOS 2, not only does the WatchKit extension run on the user's Apple Watch, it is delivered inside the user's Watch app.
When you run, did you change the scheme to the WatchKit App target? Or did you just build & run the iOS app as usual? For now you can't run both the iOS app target and Watch App target at the same time.
You have to switch schemes/targets as shown here, then pick the same simulator & display the watch UI as you've already done, (in the simulator -> "Hardware" tab -> External Display -> Apple Watch):
You also have to add/edit schemes to view the Glance or Notification parts of the storyboard. See the "Readme" file in the sample Lister project for more details.
I had a similar issue. Here is a couple of things you can try (solved it for me)
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With