Repeated Popup: Xcode wants to access key "com.apple.dt.XcodeDeviceMonitor" in your keychain
Posting this solution for Xcode 8 because no one else has:
- Open Keychain Access.
- Search for XcodeDeviceMonitor.
- Drag the item to the System Keychain on left.
- Enter admin password.
That finally fixes it.
open [keychain access] > type "xcode" in the search area > double click [com.apple.dt.XcodeDeviceMonitor] > click [access control] > select the first option [allow all applications to access this item]
Don't forget to click Save Changes!
hope it helps.
The following worked for me (running macOS 10.12.1 and XCode 7.3).
Note that the problem with other solutions is that they operate on the (temporary) login keychain entry, which is removed when XCode quits, so a solution appears to be to create the entry in the System keychain instead.
I tried using Keychain Access to move the entry from the login to the System keychain but it failed with various obscure errors (e.g. "An error has occurred. Unable to add an item to the current keychain")
Instead, I used the security command to create a new entry in the System keychain that's (almost) identical to the temporary one.
The only difference is the password which I couldn't be bothered to extract (and I'm unsure whether it's important).
Open Terminal, paste and execute the following command (after suitable editing if XCode isn't in the normal location):
sudo security add-generic-password \
-s 'com.apple.dt.XcodeDeviceMonitor' \
-a session-token \
-p anyoldstring \
-T /Applications/Xcode.app \
-T /Applications/Xcode.app/Contents/Developer/Library/Xcode/Tools/XcodeDeviceMonitor \
/Library/Keychains/System.keychain
Disclaimer - my sole objective here was to prevent the annoying alert.
I've no idea whether this will break anything.
You're messing with the System keychain: what could possibly go wrong ?