Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to close WatchKit app

Is there a way to close a WatchKit app?

In iOS Simulator there is home button (cmd + shift + h) that will trigger closing app event. I was wondering if there is something similar in WatchKit emulator?

The problem - I have one WKInterfaceController and I never receive "didDeactivate" method call.

like image 351
Kostiantyn Koval Avatar asked Dec 13 '14 20:12

Kostiantyn Koval


2 Answers

No, this functionality is not currently available in the iOS Simulator. The current implementation is not a full simulator of the watch, it is just a simulator for WatchKit implemented as an external display attached to the simulated iPhone (not as a separate device).

The closest thing at your disposal is to just turn off the external display by going to the Hardware -> External Displays menu and choosing "Disabled"

like image 196
Jeremy Huddleston Sequoia Avatar answered Nov 18 '22 18:11

Jeremy Huddleston Sequoia


Quoting from https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/DesigningaWatchKitApp.html

During testing, you can lock and unlock the simulator to verify that your
activation and deactivation code is working as expected. 
When you use the Hardware > Lock command to lock the simulator, 
WatchKit calls the didDeactivate method of the current interface controller. 
When you subsequently unlock the simulator, 
WatchKit calls the willActivate method of the interface controller.
like image 2
Legolas Avatar answered Nov 18 '22 18:11

Legolas