I am trying to create a source editor extension in Xcode 16, I just created a blank macOS project and added an extension target. I also changed "XcodeKit.framework" to Embed and sign, but when I run the extension on my Mac, I can't see the command under "Editor" menu.
I even tried to clone a sample extension from online and run it, even in this project I'm unable to see the commands under "Editor" menu.
Has anyone faced this issue?
Geting Xcode to recognise your source editor extension can be tricky. There are two cases to consider:
-
Debugging
-
Production
I recommend you start with the debugging case. When you create a new source editor extension target, Xcode create a scheme for it. That scheme isn’t very useful out of the box. Do this:
-
Use your primary copy of Xcode for this work. Ideally it’d be the one in the Applications folder.
-
Select the extension scheme in Product > Scheme.
-
Choose Product > Scheme > Edit Scheme.
-
In the Run action, switch to the Info tab.
-
On the Executable popup, choose Other and select your primary copy of Xcode.
-
Make sure Debug Executable is not checked.
-
Close the sheet and then choose Product > Run.
-
Xcode should launch a second copy of itself. In the Dock, you’ll see the icon with an orangey tint. Bring that to the front.
-
In this copy, open a test project and navigate to a source file. Your extension should be visible at the bottom of the Editor menu.
I just tried this today (Xcode 16.2 on macOS 15.3.1) and it worked a treat. I use the macOS > App template for the container app project and the macOS > Xcode Source Editor Extension template for my extension target. Oh, and as you noted, I had to change the XcodeKit setting to Embed & Sign.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"