【问题标题】:Try HealthKit with the iOS Simulator without developer account在没有开发者帐户的情况下使用 iOS 模拟器试用 HealthKit
【发布时间】:2014-10-17 22:35:02
【问题描述】:

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

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

是否有任何选项可以在没有开发者帐户的情况下在 iOS 模拟器中试用 HealthKit?

【问题讨论】:

  • 现在可以使用 XCode7

标签: ios entitlements healthkit


【解决方案1】:

您需要将授权添加到项目中。

转到Project Settings >> Capabilities

向下滚动列表至HealthKit,然后将其转至ON

如果您在真实设备上进行测试,那么您还需要从您的苹果开发者帐户中为该特定 appID 添加该权利,并更新配置文件并重新下载。

【讨论】:

    【解决方案2】:

    最简单的方法是从以下位置下载示例应用程序:

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

    和它一起玩。

    【讨论】:

      猜你喜欢
      • 2017-09-06
      • 1970-01-01
      • 2018-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多