使用HealthKit莫名崩溃

今天在测试自己写的框架,[JYAuthorizationManager](www.baidu.com),然后在测试`HealthKit`权限的时候老是莫名的闪退,下面是系统的log:

1
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthShareUsageDescription must be set in the app's Info.plist in order to request read authorization for the following types: HKQuantityTypeIdentifierStepCount'
原因指的是plist文件里面没有加权限描述,但其实我已经加过了。于是各种找原因,才发现了解决方法: > 健康的权限描述里面不能有*中文*。我也是醉了。。。

! HealthKit的权限描述

参考:https://www.jianshu.com/p/780521c34de9

Command /usr/bin/codesign failed with exit code 1 解决办法

苹果开发者账号好像今天就过期了,虽然昨天续费了,但是在真机测试的时候,遇到了一下的错误:

1
Command /usr/bin/codesign failed with exit code 1

以往对于这种证书签名错误,xcode会弹出提示框,然后点fix来解决,但这次没有弹框,网上查了一下,如下方法可以解决。
点击xcode偏好设置->Locations->Derived Data,点击箭头定位到目标文件夹,将此文件夹清空并清空回收站,然后重启下电脑即可。

参考:https://segmentfault.com/a/1190000000712103