19

I have the Xcode 8 GM installed and am trying to mess around with the editor extensions. I've followed the tutorial on this site:

https://littlebitesofcocoa.com/239-creating-an-xcode-source-editor-extension

but for some reason when I run the extension to test it, it doesn't show up in the editor menu at all.

Is there something that the tutorial is missing or is there something else I need to do to get the extension to show up in the editor menu?

Thanks for the help.

RPK
  • 1,830
  • 14
  • 30

3 Answers3

36

I figured it out.

By default, the project was not signed. Clicking on the project and going to the general settings and selecting Enable Development Signing on both the macOS app and the Extension target fixed the issue.

RPK
  • 1,830
  • 14
  • 30
  • 1
    I am having the same issue but Enable Development Signing didn't solve the problem. Did you find something else about the issue? – BlackM Sep 14 '16 at 22:43
  • 2
    I’ve found in some instances killing com.apple.dt.Xcode.AttachToXPCService allows things to work. Why? No idea. – Lloyd Sargent Sep 22 '16 at 17:51
  • 1
    might be nice if Apple would have a popup like, "Hey this won't do a darn thing until you sign it..." – quemeful Jul 25 '17 at 01:35
  • Weird, both solutions didn't work for me, without any useful warnings! – Itachi Sep 22 '17 at 02:16
  • Make sure that the macOS project you create is a `Cocoa App`, not a `Game` or `Command Line Tool`. – Guy Kogus Jun 06 '18 at 10:43
  • I opened my Xcode 9 extension in 10 and ran it. Same problem, not showing up in menu. Even tried creating a basic new extension and it too doesn't show up in the menu. No idea what to do. – mretondo Sep 28 '18 at 16:31
  • 1
    Look in the Console of the Debug Area. If there's a message similar to "IDEExtensionManager: Xcode Extension does not incorporate XcodeKit:" then go to the target of the extension, tab 'General' > Frameworks and Libraries and add XcodeKit *with* 'embed and sign'. In the template, Apple did add the Cocoa framework, but forgot XcodeKit. – Elise van Looij Dec 29 '20 at 16:01
  • To expand on this, selecting "Sign to Run Locally" in Xcode 12.5 didn't work for me. Although it might with further exploration. Sticking with the answer here and selecting signing as "Development" worked fine. – Justin Vallely Jul 23 '21 at 20:19
17

If you attempt to follow Apple's Create Xcode Extension guide, and then attempt to test your extension, you'll notice that the menu option doesn't show up.

If you examine the log, you'll notice it says:

IDEExtensionManager: Xcode Extension does not incorporate XcodeKit

Elise van Looij's solution pointed me in the right direction.

What I had to do was:

  1. Xcode Extension Target > General tab

  2. Update XcodeKit.framework to Embed & Sign.

    By default Apple's template has it as Do Not Embed. Note: You should leave Cocoa.framework as Do Not Embed.

  3. Importantly, you should kill the test instance of Xcode (the one with a black background).

    If you don't kill the app, it'll continue to not show up.

  4. You can now run your extension and it'll show up as the last menu option in the Editor menu.

This was tested in Xcode 12.4.

Senseful
  • 86,719
  • 67
  • 308
  • 465
0

An update for XCode 14.0

Apart from making sure XcodeKit.framework is set to Embed & sign. The problem for me looks like it was actual Xcode 14.0. Once I updated to 14.1 everything worked like a charm!

Kwnstantinos Nikoloutsos
  • 1,832
  • 4
  • 18
  • 34