Try HealthKit with the iOS Simulator without developer account

混江龙づ霸主 提交于 2019-12-07 20:19:19

问题


I would like to test a HealthKit app in the iOS Simulator without an iPhone Developer Account. I added an entitlement file with the com.apple.developer.healthkit capability enabled and when I build the app it seems to include the file in the bundle but then when I try to access the HealthKit API the Simulator throws this error:

Error Domain=com.apple.healthkit
Code=4 "Missing com.apple.developer.healthkit entitlement."
UserInfo=0x7fc939f091c0
{NSLocalizedDescription=Missing com.apple.developer.healthkit entitlement.}

Is there any option to try HealthKit in the iOS Simulator without a Developer Account?


回答1:


You need to add the entitlement to the project.

Goto Project Settings >> Capabilities

Scroll Down the list to HealthKit and Turn it ON

If you're testing on a real Device then you also need to add that entitlement from your apple developer account for that specific appID and update Provisioning profile and download it again.




回答2:


The easiest way is to download the example app from:

https://developer.apple.com/library/ios/samplecode/Fit/Introduction/Intro.html

and play with it.



来源:https://stackoverflow.com/questions/26434322/try-healthkit-with-the-ios-simulator-without-developer-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!