Reading from Keychain Xcode 9 Simulators Returns Nothing

Since I use Xcode 9, all unit tests related to the keychain are broken. This also happens with Xcode GM. As I observed, there are no errors when reading and writing OSStatus, but reading from the key fob does not return anything and causes a crash for all unit tests using keychain. I already came across something similar when Apple released Xcode 8 with an iOS 10 simulator that didn't work, and Apple fixed that in Xcode 8.2. Anyone else run into this issue with iOS 11 simulator? Any idea on this?

+4
source share
2 answers

Finally, we found the problem. As @Gix said, the problem is with unit tests inside our system. In the SDK tests, there is no application context, so it does not have / keychain. But in fact, we did not want to transfer tests from the SDK to the application, as you did @Gix. That way, we could fix the problem by simply adding the application target to the SDK project, and then set this as the host for the SDK unit tests. Unit tests now pass. But I still don't understand why its only failure in the new xCode. We understand that this is not a problem with the iOS 11 simulator, because the same crash happens with iOS 10 simulators in xCode9. Thus, this limitation is a property of the xCode9 simulator application, which can be fixed with the solution I provided. It is still messy, but it works,and you don’t need to transfer tests from SDK to application!

+9

, , , , .

, . 3 , 1 - , 1 - /, 1 - Pods. , .

Valet ( ), , , . , .

, !

+1

Source: https://habr.com/ru/post/1685951/


All Articles