Depending on the project requirements, these are the necessary changes it running:
- Set the correct
ARCHS
(standard or only x86_64) - Add
XcodeKit.framework
dependency (Embed and Sign) to the extension target - If Swift code needs to be parsed, Embed and Sign the following library:
$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib
It's a state issue with how macOS automatically handles plugins.
- Make sure you have no other bundle with the same Bundle ID installed on the system
- Uncheck it from the Extensions list in System Preferences
- Clean rebuild the extension
- Run the debug build
- Command + Q Xcode
- Make sure you actually quit Xcode so that it doesn't have a dot on the dock
- Check the extension entry in the Extensions page
- Run this command
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f "/path/to/Extension.app"