[SOLVED] Xcode internal error, need to take control of another process for debugging


I'm new to Xcode, Swift and macOS, only getting started.
When I open my Swift playground project for the first time since I turned the computer on, I see an error popup on the top saying "Internal error occurred, source editor functionality is limited"

Immediately after a password window open asking for my admin password to take control of another process for debugging. Once I enter the password, the above error disappear and everything works nicely.

Could anyone please tell me how to give permission to Xcode to take control of that process by default so I don't need to enter my password every single time I open my project?

I would appreciate any help.
Thank you.

How did you create the playground? When you open the playground, are you double-clicking on it? Are you the owner of the playground file? Are you trying to debug the playground using an externally-connected debugger?

What you are saying is contrary to my experience. To use a playground environment:

1 - If it's a new playground, I open up Xcode, select New>Playground, go through the creation dialog, and, there is a new playground file that I own.

2 - If I am re-using an existing playground, I either double-click on the playground file, or open Xcode and use the Open menu item to open the playground file.

In either of these scenarios, I do not need to give my password, either in an admin or non-admin account. Now, if I try to open a playground I do not own, or try to connect to a running playground instance with lldb as an external debugger, I may have to provide my admin credentials.

This is what I do as well. I created the playground as you described in 1. and I open it in Xcode as you described in 2.
As far as I know I don't use any external debugger, I have not installed anything else but Xcode from the App Store.

It is a fresh install of macOS Catalina 10.15.6, only 1 user, Xcode version 11.6.
Is there any way I could have a look exactly what is this "other process" that Xcode need to connect to and require admin password or is there anything to check in the project or Xcode settings maybe? Or maybe any security setting in macOS?

Thank you.

There is something funky going on. Is this a new playground, or have you been building on this playground prior to Catalina install?

You might want to ask over on the Xcode thread in the Apple Developer forums. There's folks over there with more specialized knowledge about Xcode.

Do you have Command Line Tools installed? That can sometimes cause issues if it's not version synchronized with Xcode. You might want to blow away Xcode, including anything in ~/Library/Developer/Xcode, and do a clean re-install of Xcode.

What do you have in your playground? Does this all happen on a newly created playground? An experiment you might try is to create a new playground, get out of Xcode, shutdown your computer, restart your computer, then open the blank playground.

1 Like

Thank you.

I did find the solution on the Apple Developer forum as suggested.
the problem was that when I launched Xcode for the first time I did not enable developer mode and so this is why it was ask me for the password each time.

Enabling developer mode did solve the problem.
For those who get the same problem, in the terminal run the following command to enable developer mode:

DevToolsSecurity -enable

That's interesting. Never had to run that. However, I've been using my current account settings for a long time, stretching back to OSX 10.1, and I've using Xcode and its predecessors for all that time. Must been grandfathered in during some upgrade over the years.

Good to know!

Don't need to run the command if you choose to enable developer mode the very first time you run Xcode after installation. But then it seems Apple did not bothered to add an option in preferences to turn it on and off. That's why a terminal command.

It could be also that it is a new security feature that comes auto enabled when you upgrade from an older version of Xcode and macOS not sure why you never had to do this. For me it was a fresh, new install of both macOS and Xcode, no upgrade.