Using Xcode 10 running in Mojave I can't get a simple test source editor extension working. I use to be able to do it under Xcode 9 High Sierra. I created a bare bones source editor extension. I then run it but doesn't show up under the debut Xcode (black icon) Editor menu. Also doesn't show up in System>Extension list. Rebooting didn't help either. I tried downloading LineX extension from the Mac App Store but it wouldn't work either.
Can't get a Source Editor extension working in Xcode 10
2.7k views Asked by mretondo AtThere are 5 answers
My Xcode Source Editor extensions have, on more than one occasion, disappeared from Xcode. Each time they have disappeared, I always eventually got them to reappear––until Xcode 12. With Xcode 12 I was unable get any Source Editor extensions to show up in System Preferences/Extensions, until today.
I just found the answer to why Xcode Source Editor extensions keep disappearing: It has to do with my maintaining older versions of Xcode on my my MacOS Catalina system. I keep Xcode versions 10, 11, and 12 on my development system, and according to this thread that I found: https://github.com/nicklockwood/SwiftFormat/issues/494
The thread quotes from The article XcodeKit and Xcode Source Editor Extensions by Zoë Smith, March 25th, 2019, says:
Finally, when multiple copies of Xcode are on the same machine, extensions can stop working completely. In this case, Apple Developer Relations suggests re-registering your main copy of Xcode with Launch Services (it’s easiest to temporarily add lsregister’s location to PATH first):
% PATH=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support:"$PATH"
% lsregister -f /Applications/Xcode.app
After issuing these terminal commands my Source Editor Extensions are now, once again, available!
Renaming or moving the Xcode will fix the issue. Since High Sierra since /usr/libexec/xpccachectl
(the preferred solution) does not seem to exist in this version of the OS.
To fix quickly:
- Quit Xcode
- Rename Xcode in the applications folder temporarily.
- Launch renamed Xcode
- Quit Xcode
- Name it back to old value
Faced a similar issue when was trying to run Xcode Source Editor extension (Xcode 11.2.1). As a result - my extension didn't appear in "Editor" menu.
Here's a list of all my actions (after following them the problem has gone):
Make sure that signing for both host app and extension is set to "Automatic" and Signing Certificate is set to "Development" (or any other except "To Run Locally").
Then:
- Go to Xcode settings, select "Accounts" tab, select your Apple ID account (add it if you don't have yet)
- In "Teams" table select your team (you should have at least one - Personal Team)
- Click "Download Manual Profiles"
- Click "Manage Certificates...", then click a "+" button and choose "Apple Development"
Xcode might ask you a password for your development keychain (NOT your system one) - leave password field empty and press Return.
Hope this helps, good luck!
It's now fixed but I have no idea how. After working on it for four days I about gave up. I wanted to retry LineX extension but I first searched my drive for all files containing LineX and deleted them Except for the one in the Applications folder. I restarted the Mac and went to bed. Next morning its was working. LineX and two other extensions plus my extension showed up in System>Extensions and now are working. I hate when something starts working but you don't know why but I guess it's better than not working.