简体   繁体   中英

Repeated Popup: Xcode wants to access key “com.apple.dt.XcodeDeviceMonitor” in your keychain

Starting in MacOS Sierra, I've started to get this popup periodically from XCode, even after pressing 'Always Allow'.

弹出

I've tried deleting the "com.apple.dt.XcodeDeviceMonitor" item in Keychain. This regenerates the key, but doesn't fix the issue.

It's an open discussion topic on the Apple forums , but no one seems to have a solution.

Posting this solution for Xcode 8 because no one else has:

  1. Open Keychain Access.
  2. Search for XcodeDeviceMonitor.
  3. Drag the item to the System Keychain on left.
  4. 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 (eg "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

I reported this to Apple as a bug and after several suggestions the same as some of those mentioned here that didn't work they came back with the following, which has worked:

"Sorry about the trouble. We'll dig a bit more into this. In the mean time, if you don't need the iCloud gauge, you can temporarily disable it by doing this:

  1. Go to Terminal.app.
  2. Type this in to enable an User Defaults
    defaults write com.apple.dt.Xcode iCloudGaugeDisabled -bool YES
  3. Relaunch Xcode "

This issue has popped up again for me this past fall. I think the issue may stem from the security hole that apple had where the root user account was left un password protected. I reset my password for the root user account (to the same password as it was previously). I didn't notice the relationship at the time, but after reading this support item, I suspected that this could be the issue.

https://support.apple.com/en-us/HT201609

I reset my password for the login keychain (again to the same password) following these steps and the issue has since gone away.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM