I have a few unit tests to verify that the way I work with Keychain is correct and data are in same form when I load them.
Tests were running ok until update to XCode 9. At the moment, KeychainService return -50 (not saved).
According to this question, it was solved by adding Host to unit tests. However, my tests are in framework project and there is no app to use as a host.
let query = [
kSecClass as String : kSecClassGenericPassword as String,
kSecAttrAccount as String : key,
kSecValueData as String : data ] as [String : Any]
SecItemDelete(query as CFDictionary)
SecItemAdd(query as CFDictionary, nil)
What is recommended solution? I expect just some configuration in XCode, moving tests into app is not a proper solution for me.
SecItemAdd
return -50 – Phoenix