Mac OS X wants to use system keychain when compiling the project
Asked Answered
S

13

120

I am asked to type in the system admin user name and password when I compile my Xcode project. The whole message is

Mac OS X wants to make changes. Type an administrator's name and password to allow this. Mac OS X wants to use system keychain.

Does anyone have a solution for this?

Summons answered 18/4, 2012 at 6:53 Comment(0)
S
3

I found that problem to be of provisioning profiles. I deleted all previous provisioning profiles and then reinstalled one I needed.

Summons answered 15/10, 2012 at 15:17 Comment(0)
A
304
  1. Open Keychain Access.
  2. In the top-left corner, unlock the keychain (if it is locked).
  3. Choose the System keychain from the top-left corner.
  4. Find your distribution certificate and click the disclosure triangle.
  5. Double-click ‘Private key’ under your distribution certificate.
  6. In the popup, go to the Access Control tab.
  7. Select ‘Allow all applications to access this item’.
  8. Save the changes.
  9. Close all windows.
  10. Run the application.
Assurance answered 2/12, 2013 at 9:0 Comment(7)
I am not finding any distribution certificate dropdown. where to find this?Infestation
@AnanthSrinivasan, PVCS just means the list of accounts listed on the main window. Double click on the account that forces you to enter admin name and password.Miscall
This is also the only good way to make sure it works on an automated build server without interrupting for credentials.Sinker
I found that, on El Capitan, you need to double click the private keys that match the format yourhostname.domain.identity and then do steps 6-8.Glasgow
On El Capitan at Step 8 I'm getting the window asking "Keychain Access wants to modify the System keychain" and to enter my password. This is good. After that in another pop-up window it asks "OS X wants to make changes. Type an administrator's name and password to allow this." - and none of the credentials work here...Look
wouldn't it be better as far as security to only allow Xcode and relating tools access to this private key?Folder
Not sure I like this solution from a security perspective... The proper solution and the system's default state, is just to move your distribution certificates from your system keychain to your login keychain.Ishmael
O
33

The problem is with the Developer Certificate on Keychain which is under "System", on the left hand panel, which is always locked and requiring my password to unlock!

So just move the Developer Certificate to "login", which is always unlocked. Now your problem gets solved.

Okinawa answered 24/5, 2013 at 12:50 Comment(4)
This helped me, except I couldn't move the keychain to 'login'. However, removing the certificate from System keychain is what I think solves this problem.Arissa
This is only suitable for building from Xcode GUI, when you are building from CLI (like in CI environment) the Key & Cert have to be in the System keychain.Look
Great! worked for me. My certificate was under "System", moved it to "Login".Tinkle
Nothing worked for me except this one. Note that i couldn't move it, i had to delete and just drag the certificate manually to "Login"Apophthegm
R
16
  1. Open Keychain Access

  2. Click on System in left pane

  3. Unlock the System keychain top left (if it is locked)

  4. Sort the System items by Kind so that the keys are at the top

  5. Look for the private key that keeps asking for password

  6. Double click on it and choose Access Control

  7. Choose "Allow all applications to access this item"

  8. Save changes, lock the System keychain and quit the Keychain app

  9. Restart the application that keeps asking to modify your keychain

Rodolphe answered 22/11, 2016 at 7:11 Comment(4)
As a best practice, for step 7, only allow the specific application(s) you're trying to give access to. Because security.Epigeous
How does this differ from the answer provided years prior?Poppyhead
When I answered it, the answer was 2years old, and the answer didnt work for me, so I wrote down the steps I took to make it work, hence the 5 upvotes. Don't come here and update his answer then ask me why mine is different.. If it was the same I'm sure everyone would've downvoted it like you..Rodolphe
I fail to save the changes at step 8. I enter the admin pass (asks me twice), however, when I reopen the key, the changes have not been saved! Why is this so?Kaylee
D
5

I was getting this problem because I had duplicate certificates in my login and System keychains. By opening Keychain Access and deleting all certificates from System that were also in login solved this problem. Hope this helps.

Demoss answered 27/4, 2013 at 20:24 Comment(1)
This is only suitable for building from Xcode GUI, when you are building from CLI (like in CI environment) the Key & Cert have to be in the System keychain. On one Mac I have the same situation: duplicate in login and System keychain and everything works just fine, but not on another for some reason...Look
S
4

Move your private key from System to login in keychain access.Then move your developer certificate into login.This worked for me.

Shawana answered 29/5, 2013 at 8:27 Comment(0)
S
3

I found that problem to be of provisioning profiles. I deleted all previous provisioning profiles and then reinstalled one I needed.

Summons answered 15/10, 2012 at 15:17 Comment(0)
S
2

In my case I went to Keychain Access, selected "system" in "Keychains" (top left). Then for each item: right click, "Get Info", "Access Control" and added Xcode in "Always allow acces by these applications:" list.

Spirituous answered 14/12, 2012 at 9:19 Comment(0)
J
1

I followed a solution similar to what @krafter did but, instead of giving access to everything in the system keychain, I only needed to give add xcode to the provisioning profile under keychain -> system -> "your provision profile" -> get info -> Access Control then just added xcode. This is what worked for 4.6

Jadwiga answered 13/2, 2013 at 0:8 Comment(0)
C
1

Access Control settings no longer appear to save for private keys which are stored in the System keychain, so attempting to add Xcode to the whitelist there did not work for me.

In order to retain Access Control changes, I had to copy the private key + certificate to the Login keychain. This kept Xcode from bothering me when code signing archives for distribution.

Note that Xcode will halt distribution if the certificate's Trust settings are changed (e.g. Always Allow for Code Signing); you must keep these set the System Default.

I hope there is a better solution than this, because this doesn't feel right. But it works for now.

Clinton answered 17/12, 2019 at 18:35 Comment(0)
R
0

Yes - run XCode with administrator privileges only. It needs administrator rights to perform a whole bunch of tasks, installations, debug sessions and such.

Ruthven answered 18/4, 2012 at 7:6 Comment(2)
how can i change the xcode prefs so that it runs with admin previliges ?Summons
I mean, run it from a user that is defined as administrator.Ruthven
S
0

Are you sure it says "Mac OS X" not something developer tools related?

It is normal if Developer Tools wants to enable Developer Mode on your Mac, thus, you don't need to enter an administrator password every time you start debugging your app in the simulator for the every first time after each Xcode launch.

But if you don't have enabled Developer Mode, when it was offered by Xcode, then be prepared, that Xcode will ask for an administrator password for the every first time you launch debugging in the simulator after each Xcode launch.

Swear answered 18/4, 2012 at 7:9 Comment(3)
yes it says MAC OS X and when i compile the build for simulator it does not show me this message and when i run any project on the device it shows me the messageSummons
i found that problem to be of provisioning profiles. i deleted all previous provisionning profiles and then reinstalled one i needed to solve the problemSummons
Ya Agree with @developersaremad. I got solution... ThanksOrthodoxy
M
0

You need to add your OSx user name to the _developer group. Worked for me.

sudo dscl . append /Groups/_developer GroupMembership <username>
Mattah answered 27/10, 2013 at 5:56 Comment(0)
U
0

It seems that Xcode not refresh the team selection so selecting it again from the general tab of the targets solved it.

Uboat answered 21/6, 2016 at 13:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.