我在设备上访问Keychain时遇到了问题。这种情况只会发生在从Xcode启动应用程序时,如果我自己启动应用程序(通过点击其图标),那么Keychain将可以正常工作。模拟器中也没有问题。
控制台输出:
Jan 27 14:33:24 iPhone MyApp[4305] <Error>: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn't be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
Jan 27 14:33:24 iPhone securityd[77] <Error>: securityd_xpc_dictionary_handler MyApp[4305] delete The operation couldn’t be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements)
我正在使用Xcode 6.1.1和装有iOS 8.1.1的iPhone 5。
值得注意的是,我尝试调试的应用程序在一个Cocoa Touch框架目标中包含访问钥匙串的代码(这可能是问题的来源)。
预配配置文件是通用的:iOSTeam Provisioning Profile: *
(由Xcode管理)。