Keychain fails on iOS 10 simulator for library tests

Originator:moegoestohell
Number:rdar://29489461 Date Originated:02-Dec-2016 02:28 PM
Status:Open Resolved:
Product:Developer Tools Product Version:8.2 Beta 2
Classification:Crash/Hang/Data Loss Reproducible:Always
 
This was first filed as a duplicate of rdar://28143970 and rdar://27950922

This bug is still present in Xcode 8.2 beta 2


Summary:
Accessing the Keychain from the iOS 10 simulator using Xcode 8 beta 2–5 fails with error code -34018 unless Keychain Sharing is enabled for library tests if they are not contained in an app.

Steps to Reproduce:
1. Create a framework project with a unit test that accesses the keychain (or check out https://github.com/bitstadium/HockeySDK-iOS)
2. 

Expected Results:
Reading and writing from the keychain is not possible

Actual Results:
e.g. Function SecItemAdd returns the following error code: -34018

Version:
Xcode version 8.2 beta 2 
OS X version 10.11.6 (15G1108) (also on latest stable version of 10.12)

Notes:
Workaround: enable Keychain Sharing in the target settings’ Capabilities tab. Then Keychain works as expected.


Configuration:
It does not occur in Simulators < iOS 10.
The current workaround is to create a dummy app.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!