在没有开发人员帐户的情况下,使用带有iOS模拟器的HealthKit尝试 [英] Try HealthKit with the iOS Simulator without developer account

查看:92
本文介绍了在没有开发人员帐户的情况下,使用带有iOS模拟器的HealthKit尝试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在没有iPhone开发者帐户的情况下在iOS模拟器中测试HealthKit应用.我添加了一个启用了com.apple.developer.healthkit功能的授权文件,当我构建该应用程序时,它似乎包含了该文件包,但是当我尝试访问HealthKit API时,模拟器会引发以下错误:

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.}

没有开发者帐户,是否可以选择在iOS模拟器中尝试HealthKit?

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

推荐答案

您需要将权利添加到项目中.

You need to add the entitlement to the project.

转到Project Settings >> Capabilities

向下滚动列表到HealthKit并将其转到ON

Scroll Down the list to HealthKit and Turn it ON

如果您是在真实设备上进行测试,则还需要从Apple开发人员帐户中为该特定appID添加该权利,并更新Provisioning配置文件并再次下载.

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.

这篇关于在没有开发人员帐户的情况下,使用带有iOS模拟器的HealthKit尝试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆