114

I use a standard user account for my daily tasks on Mac OS. Since upgrading to Snow Leopard I am asked to do the following when a program is run from within Xcode:

"Type the name and password of a user in the 'Developer Tools' group to allow Developer Tools Access to make changes"

While I know the admin username/password, this is annoying (though only required once per login).

The developer tools access is asking for rights to "system.privilege.taskport.debug" from application gdb-i386-apple-darwin.

What is the best way around this?

10 Answers 10

141

You need to add your macOS user name to the _developer group. See the posts in this thread for more information. The following command should do the trick:

sudo dscl . append /Groups/_developer GroupMembership <username>
7
  • 2
    This solution worked for me for about 10 minutes, and then for some reason it started asking for my username/password again. I tried typing it into Terminal again, but it no longer responds.
    – jowie
    Jun 19, 2012 at 11:33
  • This works for me and I have no issue until now. Noted just for reference.
    – eonil
    Oct 11, 2013 at 3:19
  • 9
    This solution didn't work for me until I added -u <name-of-account-with-root-access> to the options. So my full command was dscl -u <root-account> . append /Groups/_developer GroupMembership <my-account>
    – dsjoerg
    Dec 27, 2013 at 20:00
  • 2
    You should consider using 'merge' instead of 'append' if you add this line to a continuous integration script. Merge will not add it if it already exists. See 'man dscl' for more details. Apr 24, 2014 at 6:49
  • 1
    This worked to add me to the group but only after I used @Kheldar suggestion to su into a root account first.
    – b01
    Oct 26, 2017 at 13:07
25

Finally, I was able to get rid of it using DevToolsSecurity -enable on Terminal. Thanks to @joar_at_work!

FYI: I'm on Xcode 4.3, and pressed the disable button when it launched for the first time, don't ask why, just assume my dog made me do it :)

4
  • 2
    +1 for mentioning DevToolsSecurity. I had no idea such a tool exists. I had the opposite problem, I wanted do disable it again and thanks to this tool I finally was able to :) Just replaced -enable with -disable and that works as expected!
    – Mecki
    Mar 29, 2012 at 1:43
  • 1
    This command seems to have no effect at all. Xcode 4.3 still requires authentication from someone on the _developer group regardless whether -enable or -disable is used.
    – wcochran
    May 7, 2012 at 17:36
  • Just to clarify, this step is, at least in some cases, in addition to adding the user to the _developer group with dscl -u <root-account> . append /Groups/_developer GroupMembership <my-account>
    – Marmoy
    Jul 21, 2015 at 7:28
  • Does not seem to work on macOS "El Capitan" with XCode 7.3. @Kheldar's solution worked for me. Mar 19, 2017 at 16:55
9
$ dseditgroup -o edit -u <adminusername> -t user -a <developerusername> _developer
1
  • 7
    In my humble opinion, this answer really could benefit from a bit more explaining on what it does. It's not that I don't like typing sudo rm -rf / on my system, but you get my point. :D
    – Kheldar
    Feb 11, 2014 at 9:54
8

You should add yourself to the Developer Tools group. The general syntax for adding a user to a group in OS X is as follows:

sudo dscl . append /Groups/<group> GroupMembership <username>

I believe the name for the DevTools group is _developer.

4

Ned Deily's solution works perfectly fine, provided your user is allowed to sudo.

If he's not, you can su to an admin account, then use his dscl . append /Groups/_developer GroupMembership $user, where $user is the username.

However, I mistakenly thought it did not because I wrongly typed in the user's name in the command and it silently fails.

Therefore, after entering this command, you should proof-check it. This will check if $user is in $group, where the variables represent respectively the user name and the group name.

dsmemberutil checkmembership -U $user -G $group

This command will either print the message user is not a member of the group or user is a member of the group.

1
  • 2
    Thanks! This worked for me! The commands that worked for OS X Mavericks were dscl . append /Groups/_developer GroupMembership username and dsmemberutil checkmembership -U "username goes here" -G "group goes here"
    – MoralCode
    Oct 31, 2014 at 0:13
2

Answer suggested by @Stacy Simpson:

We are struggling with the issue described in these threads and none of the resolutions seem to work:

As I'm new to SO, I cannot post in either thread. (The first one is actually closed and I disagree with the localization reasoning...)

Anyway, we created a work-around using AppleScript that folks may be interested in. The script below should be executed asynchronously prior to launching your automated test:

osascript <script name> <password> &

Here is the script:

on run argv
    # Delay for 10 seconds as this script runs asynchronously to the automation process and is kicked off first.
    delay 10

    # Inspect all running processes
    tell application "System Events"
        set ProcessList to name of every process
        # Determine if authentication is being requested
        if "SecurityAgent" is in ProcessList then
            # Bring this dialogue to the front
            tell application "SecurityAgent" to activate
            # Enter provided password
            keystroke item 1 of argv
            keystroke return
        end if
    end tell
end run

Probably not very secure, but it's the best work-around we've come up with to allow tests to run without requiring user intervention.

Hopefully, I can get enough points to post the answer; or, someone can unprotect this question. Regards.

1

For me, I found the suggestion in the following thread helped:

Stop "developer tools access needs to take control of another process for debugging to continue" alert

It suggested running the following command in the Terminal application:

sudo /usr/sbin/DevToolsSecurity --enable
1

Here is a better solution from
Mac OS X wants to use system keychain when compiling the project

  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.
1

I am on Snow Leopard and this one didn't quite work for me. But the following procedure worked:

  1. First added another account with admin privileges by ticking "Allow user to administer this computer" under Accounts, for example an account with username test
  2. Logged into the test account
  3. Launched Xcode, compiled and ran my iPhone project. All ok, no errors were thrown related to permissions
  4. Logged out of the test account
  5. Logged in with the another account having admin privileges
  6. Took away the admin priviliges from the test account by removing the tick from "Allow user to administer this computer" under Accounts
  7. Logged back into the test account
  8. Deleted the iPhone project directory and again checked out from the repository (in my case svn)
  9. Launched Xcode, compiled and ran the project. I didn't get any errors and the App ran well in the iPhone Simulator.
0

After you run:

sudo dscl . append /Groups/_developer GroupMembership <username>

per the answer above, you may still get prompted to enter in your own password:

We need authorization from an admin user to run the debugger. This will only happen once per login session.

What it really means is any _developer groupmember user so just your non-admin user/password will work here but to get rid of it completely (no prompts after a reboot) you'll also need to run:

sudo DevToolsSecurity -enable

(running it with sudo as an admin user/as root will make it so you can do it remotely without a gui password prompt)

Not the answer you're looking for? Browse other questions tagged or ask your own question.