140

I recently upgraded to 10.7.3, and when I try to debug my iOS project in the simulator for the first time after logging in, I'm prompted with the following two alerts:

Developer Tools Access needs to take control of another process for debugging to continue. Type your password to allow this.

gdb-i386-apple-darwin needs to take control of another process for debugging to continue. Type your password to allow this.

My user is an admin user. I never saw these alerts before. How do I get them to stop?

EDIT

I've verified that I'm a member of the _developer group using id -a.

Heath Borders
  • 30,998
  • 16
  • 147
  • 256
  • 3
    I believe you need to add yourself to the `_developer` group like this: http://stackoverflow.com/questions/1837889/authorize-a-non-admin-developer-in-xcode-mac-os but if you're already part of the `_developer` group (as I am) then I'm not sure what's changed. I know the `/etc/authorization` file has changed in 10.7.3, and a few tests show that I can eliminate some of the prompts by editing that to always `allow` debug, but with default rules it seems to fail the `_developer` group test. :( I'm noting what I've found so someone else might dig up more details and make more sense of what broke. – Cyberfox Feb 05 '12 at 02:58
  • 5
    lame that this was closed. – Walrus the Cat Oct 02 '13 at 22:39
  • Not sure why this was too localized; it's a duplicate of the question (with answer) found here: http://stackoverflow.com/a/11416025/2063546 – Ian Dec 10 '13 at 14:04
  • This was asked first. The other is the duplicate. – Heath Borders Dec 10 '13 at 14:29

10 Answers10

225

There's a much simpler solution for this. Try running the following command:

sudo /usr/sbin/DevToolsSecurity --enable

--EDIT--

If you're on Ventura, see Mark's answer

Heath Borders
  • 30,998
  • 16
  • 147
  • 256
kenster
  • 3,177
  • 1
  • 16
  • 11
  • Thank you! This is great. The man page for `DevToolsSecurity` explains exactly what's going on. – zmccord Mar 30 '12 at 16:48
  • 13
    Worked for me, but why the heck did Apple add this barrier ? You upgrade from a working version of XCode, and immediately find yourself having to Google their strange error messages, trying to find out how to continue using XCode. Terrible service. – Mike Gledhill Mar 08 '13 at 08:00
  • 17
    Didn't work for me either: `Developer mode is already enabled.` – Yar May 27 '16 at 19:03
  • This worked for me with Xcode 8 on an iMac running a TeamCity agent on Mac OS Sierra. – Ben Thomas Mar 03 '17 at 03:17
  • Apple is garbage. I also want to keep it disabled, yet I still have to put in Admin?? – Tim Johnsen May 13 '19 at 21:48
  • Worked for me with 10.2. BTW, this started popping up everytime since 10.2, not with the previous XCode versions. – Thread Pitt Jul 01 '19 at 17:56
  • Doesn't work with Eclipse CDT with GDB debugger. `Developer mode is already enabled.` – Danijel Sep 19 '19 at 07:11
20

enable develoer mode: In Terminal run this: DevToolsSecurity -enable

omxian
  • 430
  • 4
  • 6
12

Per Zev Eisenberg's answer, reinstalling Xcode 4.2.1 worked. However, it might be easier to just patch the /etc/authorization file with the following diff.

        <key>system.privilege.taskport.debug</key> 
        <dict>
            <key>allow-root</key>
            <false/>
            <key>class</key>
-           <string>user</string>
+           <string>rule</string>
            <key>comment</key>
            <string>For use by Apple.  WARNING: administrators are advised
             not to modify this right.</string>
            <key>default-button</key>
            <dict>
            ...
            </dict>
            <key>default-prompt</key>
            <dict>
            ...
            </dict>
-           <key>group</key>
-           <string>_developer</string>
            <key>shared</key>
            <true/>
-           <key>timeout</key>
-           <integer>36000</integer>
+           <key>k-of-n</key>
+           <integer>1</integer>
+           <key>rule</key>
+           <array>
+               <string>is-admin</string>
+               <string>is-developer</string>
+               <string>authenticate-developer</string>
+           </array>
        </dict>
Heath Borders
  • 30,998
  • 16
  • 147
  • 256
  • 1
    I had done the same thing as above. The problem now is that I am not able to get internet wifi. I am not sure how this is happening. – Nareshkumar Feb 15 '12 at 16:51
  • 1
    I've tried DevSecurityTools, adding myself to the _developer group and these modifications. I'm still being prompted to give access. So far, I've not been able to find anything that removes the prompt. – drekka Jun 29 '12 at 01:24
  • 1
    Changing system.privilege.taskport by executing ```security authorizationdb write system.privilege.taskport allow``` made my password prompts to disappear – Jin Sep 03 '14 at 00:30
9

I modified the rule for system.privilege.taskport and the alert doesn't show up anymore.

  1. Open the file /etc/authorization.
  2. Find the rule system.privilege.taskport. Under the line <key>class</key>, change <string>rule</string> to <string>allow</string>
Emily
  • 91
  • 1
  • 2
  • Posting a diff is a little nicer. – Heath Borders Apr 19 '12 at 13:38
  • I've tried all the other suggestions and this is the only one that worked. Thanks. – drekka Jun 29 '12 at 01:37
  • This might work but it might also open up a security hole in your sandbox. I am a bit wary. – n13 Aug 15 '12 at 10:40
  • Thanks! But /etc/authorization is deprecated on the mavericks. Do you know what should I use now? – Andrew Slabko Aug 13 '14 at 09:18
  • 1
    Like I commented above, it also works by executing ```security authorizationdb write system.privilege.taskport allow``` in the command line. – Jin Sep 03 '14 at 00:31
  • 1
    I don't even have that file: `/etc/authorization: No such file or directory`. I am not using XCode, but Eclipse CDT with GDB debuuger, and I am having the same problems. Any idea? – Danijel Sep 19 '19 at 07:07
9

I had same issue with my mac 10.12.5 & Xcode9 Run this command :

sudo security authorizationdb write system.privilege.taskport allow 

Then enter your password.. Check if it still prompt you. Good luck..

Ash
  • 5,525
  • 1
  • 40
  • 34
9

Reinstalling Xcode 4.2.1 after upgrading to 10.7.3 seems to have fixed it for me.

Zev Eisenberg
  • 8,080
  • 5
  • 38
  • 82
  • We will have to this once again when either Mac OS 10.8 or iOS 5.1 launch. Word is they are making the Xcode app an actual .app for ease of updating through App Store. – Ivan Karpan Feb 19 '12 at 12:20
  • Xcode 4.3 is already delivered in this manner. I haven't had this password issue since installing it. – Zev Eisenberg Feb 20 '12 at 00:22
5

I'm on macOS Ventura and receive

enter image description here

TL;DR

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

As per https://stackoverflow.com/a/1837935/5506988

What was tried

sudo /usr/sbin/DevToolsSecurity --enable says it's already enabled.

After entering my username and password, it works but then I have to do this every time I launch the debugger.

If I run sudo security authorizationdb write system.privilege.taskport allow it prevents the prompt but only until the next restart.

I tried following the existing answers that ask you to update /etc/authorization - which has been deprecated since macOS mavericks and is now /System/Library/Security/authorization.plist but I couldn't edit this file (I even tried this) but since my $USER isn't an owner of the file so I can't force overwrite it even with sudo.

I tried

sudo /usr/libexec/PlistBuddy -c "Set :rights:system.privilege.taskport:class allow" authorization.plist

But of course, the same applies but instead this fails silently.

If I run id -a it returns 204(_developer) so I am part of the developer group even before running the dcsl command

What fixed it for me was

sudo dscl . append /Groups/_developer GroupMembership <username>
Mark
  • 1,337
  • 23
  • 34
2

I just turned debugging off in (edit scheme) -> uncheck debug executable. But I also do all of my debugging on another console, so if you are developing and need the debugger then it wont help. I only have this issue with an old version of Xcode 8.2.1 since I am running the code on an old Mac using El Capitan.

Newer mac and Xcode version 10 doesn't seem to have this issue.

Tim Johnsen
  • 144
  • 10
0

Something has been modified on file /etc/authorization, I've a Lion without v10.7.3 and it has the following code

Lines 5807-5814

    <key>k-of-n</key>
    <integer>1</integer>
    <key>rule</key>
    <array>
        <string>is-admin</string>
        <string>is-developer</string>
        <string>authenticate-developer</string>
    </array>

After the update the file contains many modification due to new language supported but the lines corresponding to debugging authorization differ from the lines shown above in

Lines 7675-7676

    <key>group</key>
    <string>_developer</string>

I can't apply these differences to my 10.7.3 Lion installation because it's a production machine and I can't risk to corrupt it

I've all necessasy permission as shown from command id -a

uid=501(dave) gid=20(staff) groups=20(staff),
401(com.apple.access_screensharing),
402(com.apple.sharepoint.group.1),
12(everyone),
33(_appstore),
61(localaccounts),
79(_appserverusr),
80(admin),
81(_appserveradm),
98(_lpadmin),
100(_lpoperator),
204(_developer)
Heath Borders
  • 30,998
  • 16
  • 147
  • 256
dafi
  • 3,492
  • 2
  • 28
  • 51
-4

no need code. no need reinstall xcode. Do these steps:

1.close xcode.

2.open Keychain access.

3.double click your Keychain(the key icon which create from keychain.p12)

4.go to access control panel(name maybe not right)

5.enable all app access this.

6.save.

7.run your xcode project.

8.it works well.

zszen
  • 1,428
  • 1
  • 14
  • 18