watch-os-2

Why sending message from WatchKit extension to iOS and getting back a reply is so slow?

江枫思渺然 提交于 2019-12-06 02:46:26
问题 I am using sendMessage method to send a message from WatchKit extension to an iOS app. It takes about 230 ms on average to receive a reply. The time does not depend on whether the iOS app is on screen or running in the background. 230ms is roughly the time it takes for light to travel the Earth circumference and back. But the phone is sitting 30 cm from my watch when I am testing this. Questions : Why is it so slow? Is it supposed to be so slow? Is there a way to make it faster? An

How to use xcodebuild in Xcode 7 with a watch extension

我与影子孤独终老i 提交于 2019-12-06 00:36:34
问题 Our command used to be like this xcodebuild -configuration Release -target "xxx" -sdk iphoneos9.0 -scheme "xxx" archive Now in Xcode 7, we get this error: Build settings from command line: SDKROOT = iphoneos9.0 === BUILD TARGET xxx WatchKit Extension OF PROJECT Mobile WITH CONFIGURATION Release === Check dependencies target specifies product type 'com.apple.product-type.watchkit2-extension', but there's no such product type for the 'iphoneos' platform How do we specify to use iOS 9.0 SDK and

watchOS2 - CMSensorRecorder

吃可爱长大的小学妹 提交于 2019-12-06 00:26:46
I want to use the historical accelerometer data from the Apple Watch and my accDataList is always nil. I instantiated CMSensorRecorder in the init function of the class. Does someone had this problem before? func startMovementDetection(){ self.cmSensorRecorder?.recordAccelerometerFor(self.recorderDuration) self.startDate = NSDate() } func extractHistoricalAccelerometerData(){ var accDataList = self.cmSensorRecorder!.accelerometerDataFrom(self.startDate, to: NSDate()) NSLog("AccDataList : \(accDataList)") if accDataList != nil { accDataList = accDataList as CMSensorDataList for accData in

watchOS 2 working with CocoaPods

╄→尐↘猪︶ㄣ 提交于 2019-12-05 18:30:19
Has anyone gotten CocoaPods working with watchOS 2? I tried using ‘use_framework!’ with ‘platform :watchos, ‘2.0’ but it says "[!] Invalid Podfile file: Unsupported platform watchos2 . Platform must be :ios or :osx .. Updating CocoaPods might fix the issue.” I am on the latest version of CocoaPods. CocoaPods currently doesn't support watchos. There is a work in progress issue here for adding support for it. CocoaPods released new version which is 0.38.0 and now supports watchOS 2. http://blog.cocoapods.org/CocoaPods-0.38/ According to the blog above, deployment target can be set to watchOS 2

WatchOS Unit Testing

血红的双手。 提交于 2019-12-05 11:39:43
问题 I am building an app for Apple Watch and want to write a simple unit test. I looked around and didn't find a single way to add a unit testing bundle for watchOS code. Xcode supports unit tests for iOS, macOS and even tvOS but not for watchOS. Has anyone ever done it and if yes what is the trick? 回答1: No, watchOS does not currently (as of watchOS 3) support unit or UI testing. What you can do is cross-compile non-watchOS-specific code to a shared library, then unit test that on another

Xcode 7.0 Beta fails to launch a watchOS 2 App on Apple Watch

人盡茶涼 提交于 2019-12-05 08:01:45
Tried a public sample code project and my own project. Observe no problem with watchOS 1. watchOS 2 App installs and operates successfully on the real Apple Watch and the simulator, but it won't support the debug mode launching the app on the device by Xcode. Tried to allow the system to create the Provisioning files and manually create the Provisioning files for the development mode. Test on 10.10, 10.11. Steps to Reproduce: Set up the Provisioning files on build settings, watchOS 2 environment and etc. Go to the scheme on the left top of the Xcode 7.0 beta and choose the iPhone and Apple

Duplicating target for WatchOS2 with App and Extension on Xcode

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 02:44:34
问题 I have a project with a WatchOS2 target along with an Extension. I want to duplicate both the WatchOS App target and the extension. However, when I duplicate the WatchOS App target it is still linked to the old extension. Since we no longer have access to build phases for WatchOS App I cannot change it in the Embed App Extension Phase. Inital State WatchAppTarget1 (Embed Extension - WatchAppExtension1) WatchAppExtension1 Final State WatchAppTarget1 (Embed Extension - WatchAppExtension1)

WatchOS 2 (beta 5): watchAppInstalled returns false

霸气de小男生 提交于 2019-12-04 17:39:47
问题 The Watch App is installed on the watch and I can tap and run it on the Watch, but watchAppInstalled method returns false. Also, I can only install the Watch App using Xcode 7. If I try to install the Watch App using the Watch iOS app (from Apple) by turning on the switch, the Watch App gets deleted right after the installation completes. Update: This bug is fixed in Xcode 7 beta 6 回答1: Apple Documentation says: The session must be configured and activated before accessing this property. So,

WCSession and Today Widget

自古美人都是妖i 提交于 2019-12-04 15:59:13
问题 I've an app with a today extension and a watch app. From the main app WCSession works fine and data is transferred to the watch and received correctly but when I try to send or receive data through the WCSession in the today widget the property paired and watchAppInstalled of the session are set to false so calling transferUserInfo: does nothing and session:didReceiveUserInfo: is never called. I know I can open the app using openURL and then send the new data but I want to do that without

WatchKit CoreLocation issue

核能气质少年 提交于 2019-12-04 10:14:08
I am trying to read current location coordinates in WatchKitExtension ExtensionDelegate. This does though not return any value. The very same code used in WatchKitExtension InterfaceController does return the location. (tried this out of desperation as I could not find an error in the code) I would need to perform this code in ExtensionDelegate as I would like to pass the retrieved location on to a ClockKit Complication. Here the code in ExtensionDelegate: (after self.locationManager.requestLocation() the delegate functions didUpdateLocation / didFailWithError do not get called) import