Automatically enable Xcode "Developer Mode" on computer lab workstations

6

3

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?

smokris

Posted 2012-06-20T21:04:13.413

Reputation: 1 352

Answers

14

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

smokris

Posted 2012-06-20T21:04:13.413

Reputation: 1 352

0

I'm not a directory expert, but this didn't work for me. I found this answer at http://nikhedonia.com/xcode-development-from-non-admin-user/

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

mackworth

Posted 2012-06-20T21:04:13.413

Reputation: 101

0

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

John Slaughter

Posted 2012-06-20T21:04:13.413

Reputation: 1