Authorize a non-admin developer in Xcode / Mac OS

109,498

Solution 1

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>

Solution 2

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 :)

Solution 3

$ dseditgroup -o edit -u <adminusername> -t user -a <developerusername> _developer

Solution 4

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.

Solution 5

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.

Share:
109,498

Related videos on Youtube

Andrew Cain
Author by

Andrew Cain

Updated on July 08, 2022

Comments

  • Andrew Cain
    Andrew Cain almost 2 years

    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?

  • Mecki
    Mecki about 12 years
    +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!
  • wcochran
    wcochran about 12 years
    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.
  • jowie
    jowie almost 12 years
    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.
  • eonil
    eonil over 10 years
    This works for me and I have no issue until now. Noted just for reference.
  • dsjoerg
    dsjoerg over 10 years
    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>
  • Kheldar
    Kheldar over 10 years
    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
  • Russ Van Bert
    Russ Van Bert about 10 years
    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.
  • MoralCode
    MoralCode over 9 years
    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"
  • iphonic
    iphonic over 9 years
    You have to add -u <root-account> to make it work, please add this in the answer as second option if first didn't work.
  • Marmoy
    Marmoy almost 9 years
    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>
  • András Aszódi
    András Aszódi about 7 years
    Does not seem to work on macOS "El Capitan" with XCode 7.3. @Kheldar's solution worked for me.
  • b01
    b01 over 6 years
    This worked to add me to the group but only after I used @Kheldar suggestion to su into a root account first.
  • user963601
    user963601 over 3 years
    Simply using sudo DevToolsSecurity -enable worked for me: stackoverflow.com/a/9725547/9636