Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After reimaging a computer lab workstation, the first time a user tries to build and run an Xcode 4 application, Xcode pops up the "Enable 'Developer Mode' on this Mac?" prompt, requesting an administrator password.

How can I automate this process (via a script), so that I don't have to go around to every workstation, create a new Xcode project, build and run it, and enter the admin password each time the workstations are reimaged?

share|improve this question
up vote 8 down vote accepted

As an administrator, run the following commands in Terminal (or Remote Desktop):

/usr/sbin/DevToolsSecurity -enable
/usr/sbin/dseditgroup -o edit -t group -a staff _developer
share|improve this answer

I'm not a directory expert, but this didn't work for me. I found this answer at

When you run an Xcode project from a standard (i.e., non-admin) user, you might be asked to enter credentials of a user in the “Developer Tools group.”

You can fix this by adding the (current) user to the group:

sudo dscl . append /Groups/_developer GroupMembership

share|improve this answer

This kinda works:

/usr/sbin/dseditgroup -o edit -t group -a staff _developer

BUT if your users are bound to AD, they won't be in staff. Log in as one of those users and type this in Terminal to find out what group you're in:

ls -l ~

And get back stuff like this:

drwx------+  6 USERID  AD\Domain Users   204 Jul 22 09:31 Desktop

That will show you what group you belong in, for example: "AD/Domain Users" So for my lab, that command would be:

/usr/sbin/dseditgroup -o edit -t group -a "AD/Domain Users" _developer
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .