127

I'm running Xcode 4.3.2, under Lion 10.7.3, but every time I'm installing my iPhone app on the device it keeps asking me for an Admin user name and password.

I've done everything suggested here, and even have reinstalled Xcode:

Another StackOverflow related question

But without success so far.

Here is a picture of the window that is appearing all the time:

Xcode 4.3.2 keeps asking for an Admin user name and password

Any other suggestions on how to solve this problem?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
neowinston
  • 7,584
  • 10
  • 52
  • 83

11 Answers11

227

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

Then I moved the Developer Certificate to "login", which is always unlocked, and now everything works perfectly. The annoyance of xCode asking for the password is gone.

Please see this picture for more details: enter image description here

neowinston
  • 7,584
  • 10
  • 52
  • 83
  • 15
    Right Click on the item. Go to Get Info, Then go to Access Control, Select Allow all item to access this item. It will definitely work.. – Pratik Somaiya Mar 13 '13 at 06:33
  • I had to restart xcode before I could create the ipa after this. – Luca Carlon Jul 28 '14 at 11:09
  • 1
    This also works for other applications, e.g., I have encrypted email Microsoft Outlook in Mac OS, it keep popup this windows. And now it's gone!! – Guoqiang Huang Dec 05 '15 at 03:50
  • 2
    I would add that this could potentially be a security risk, as it allows signing an application without providing password, but that's what it's main goal is and absolutely, it works – Przemysław Wrzesiński Jul 29 '16 at 18:59
  • I understand what you mean, and agree. But the annoyance for entering the password all the time just kills the workflow. Thanks for your comment. – neowinston Jul 29 '16 at 19:44
67
  1. Go to "Keychain Access"
  2. Double click the Private Key under the certificate use to code sign your App
  3. Add "Xcode" to "Always allows these applications:" under the "Access Control" section list.
Sanjer
  • 152
  • 2
  • 9
zszen
  • 1,428
  • 1
  • 14
  • 18
  • 1
    This is the most elegant way of fixing the problem. Thanks! – Carlos Ricardo Dec 10 '13 at 21:55
  • This is definitely the best solution. +1! But the screenshot of Winston also helped me. Just add one to make your answer more clear and it will be the perfect answer! – arniotaki May 05 '14 at 06:32
  • 1
    It didn't work for me. After change and save, the "access control" change back after you open it again. – cuble Jan 29 '15 at 14:16
  • When you try to save changes by tick marking "Always allows these applications:" then also prompt for Admin user name and password. – Parth Dabhi May 12 '16 at 06:39
  • 1
    Something strange is going on in latest Sierra. Xcode is already listed in the applications to always allow, but still get the prompt dialog. – Dalmazio Jan 06 '17 at 09:04
34

Here is how I fixed it on Xcode 7.2 (also works in 7.3):

  1. Open KeyChain.
  2. Select System, Choose Certificates category.
  3. Select developer certificate and double click the private key.
  4. Check Access Control and tick on 'Allow all item to access this'.
  5. Restart Xcode and run the app on device.
Kampai
  • 22,848
  • 21
  • 95
  • 95
Alvin George
  • 14,148
  • 92
  • 64
24

Hopefully these steps solve your problem.

  • Open Keychain Access.
  • In the top-left corner, unlock the keychain (if it is locked).
  • Choose the System keychain from the top-left corner.
  • Find your distribution certificate and click the disclosure triangle.
  • Double-click ‘Private key’ under your distribution certificate.
  • In the popup, go to the Access Control tab.
  • Select ‘Allow all applications to access this item’.
  • Save the changes.
  • Close all windows.
  • Run the application.
Kampai
  • 22,848
  • 21
  • 95
  • 95
Muhammad Naeem Paracha
  • 2,335
  • 2
  • 18
  • 23
15

I did follow this to resolve above problem:

  1. Go to Keychain Access

  2. Select System >> Your certificate >> Right click "Get Info"

  3. Certificate information window will open >> Select "Trust" section

  4. From drop down option select "Always Trust"

enter image description here

Kampai
  • 22,848
  • 21
  • 95
  • 95
  • 5
    Do not do this. I did this with the "Apple Worldwide Developer Relations Certification Authority" certificate in the System keychain, making it trusted, and it seemed to work, Xcode no longer continuously asked me at each launch to allow codesign or other Xcode tools to access the keychain. The problem is, when I tried to submit an app to the app store, everything looked fine, but it would not accept. I had to open a technical support incident, in which they told me to return the certificate to its "system defaults" setting. Then the app store would finally accept my submission. Big headache. – Dalmazio Jan 12 '17 at 23:10
  • when submit app to app store, everything looked fine, but it would not accept. – JohnRaja May 17 '19 at 12:57
  • Same as above, this "solved" the issue but then all my signing requests were denied. – James Whiffin Jan 26 '22 at 08:05
3

In my case the required certificate with private key was saved in System keychain, Certificates category. To fix the problem I've exported the certificate (including the private key), and moved it to login keychain, Certificates category.

Yulia
  • 1,087
  • 9
  • 16
3

Note: In my case this answer didn't work. As one of the comments mentions it is a more elegant way, so please try it first if that works.


Try this only if the above doesn't work because I'm not sure if this is the best approach. It works fine for me.

  1. Open Keychain Access App in your MacOS. Next in the left bar, under "System Keychains" click to open "System". Search for your (provisioning profile in my case) "iPhone developer..." certificate in the list and click on the arrow to expand it. Please refer to this screenshot: Keychain Access App in MacOS
  2. Double click the expanded item which opens your private key in a pop-up. Go to Access Control tab and select the option, "Allow all applications to access this item". Please refer to this screenshot: Access control tab of private key for our certificate
  3. Click "Save changes". Enter your credentials- username and password when prompted. Close the popup of private key. Quit Keychain and follow the above steps again to check if the changes have been saved successfully.
  4. Quit Xcode app and open it again. Now when you run your iOS project with this certificate it should not ask for password.
Dhananjay M
  • 1,851
  • 22
  • 18
  • _**Closing Xcode and reOpening**_ it after your change was the main and important solution. thanks, my friend. – AmerllicA Nov 16 '22 at 20:03
1

command+c the distribution certificate in the system keychain

command+v in the session login keychain

rockdaswift
  • 9,613
  • 5
  • 40
  • 46
1

In my case I just moved to a new Mac. Running an app project in simulator was no problem and also running it on devices worked fine at first. However, when running the project on device the second time, XCode suddenly brought up the following message asking for a key chain password

Codesign wants to access key "App Development: Some Name (Some Company)"

Problem was, that neither my Mac password did not work nor any other known password...

After some searching I found the solution: Restart your Mac...!

After the reboot the entry is still in the keychain but it is grayed out and cannot be selected, unlocked or used in any way.

I have no idea what this is about, but know XCode can run the project without any problem again.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
1

Enter the MacBook password and click on always allow.

Muhammad Umair Saqib
  • 1,287
  • 1
  • 9
  • 20
0

Please follow these below steps enter image description here

Right click on private key and select "Get Info" enter image description here

enter image description here

click "Save changes" then enter your credentials- username and password when prompted. Close the popup of private key. Quit Keychain and follow the above steps again to check if the changes have been saved successfully.

Quit Xcode app and open it again. Now when you run your iOS project with this certificate it should not ask for password.