Xcode 8 Extension Not Visible In Editor Menu
Asked Answered
H

3

20

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.

Hasa answered 12/9, 2016 at 14:23 Comment(0)
H
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.

Hasa answered 13/9, 2016 at 14:26 Comment(8)
I am having the same issue but Enable Development Signing didn't solve the problem. Did you find something else about the issue?Bacillus
I’ve found in some instances killing com.apple.dt.Xcode.AttachToXPCService allows things to work. Why? No idea.Bickford
might be nice if Apple would have a popup like, "Hey this won't do a darn thing until you sign it..."Yapon
Weird, both solutions didn't work for me, without any useful warnings!Dry
Make sure that the macOS project you create is a Cocoa App, not a Game or Command Line Tool.Interest
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.Secretin
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.Platter
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.Honaker
E
20

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.

Expiry answered 20/4, 2021 at 18:13 Comment(3)
that's weird, but it doesn't work for me on Xcode 12.4 :(Plangent
does not work for me Xcode 14.2 (14C18)Multicellular
Fixed the problem for me in Xcode 15.2.0Littlefield
S
2

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!

Soffit answered 11/12, 2022 at 8:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.