Distributed Xcode Source Editor Extension not appearing in editor menu

I have built an XcodeSourceEditorExtension which I can:

  • Run locally from xcode (launching greyed out xcode etc)
  • Archive successfully
  • Upload/Distribute to TestFlight
  • Download and launch the application from TestFlight
  • See the app and extension in System Preferences>Extensions>(Added Extensions|Xcode Source Editor)

I have checked the boxes but the extension never appears in the Xcode>Editor menu.

Have tried all "fixes" I have read about, including re-installing xcode. However, nothing seems to work. All TestFlight testers have the same issue.

Have also run the following terminal commands:

pluginkit -m -p com.apple.dt.Xcode.extension.source-editor
pluginkit -m -p com.apple.dt.Xcode.extension.source-editor -A -D -vvv

which generates the following output:

+    com.cheekyghost.<appName>.XcodeExtension(1.0)

+    com.cheekyghost.<appName>.XcodeExtension(1.0)
	            Path = /Applications/<appName>app/Contents/PlugIns/<appName>Extension.appex
	            UUID = ********-****-****-****-************
	       Timestamp = 2022-07-26 10:40:39 +0000
	             SDK = com.apple.dt.Xcode.extension.source-editor
	   Parent Bundle = /Applications/<appName>.app
	    Display Name = <appName> Extension
	      Short Name = <appName>Extension
	     Parent Name = <appName>

 (1 plug-in)

I feel like I'm missing something but can't for the life of me see what. Has anyone else run into this issue while distributing an Xcode source extension?

An update - after a bit of digging in logs I found that Xcode is logging an error on launch when it tries to load the extension:

IDEExtensionManager: Xcode Extension does not meet code signing requirement: com.cheekyghost.<appName>.XcodeExtension (file:///Applications/<appName>.app/Contents/PlugIns/<appName>Extension.appex/), Error Domain=DVTSecErrorDomain Code=-67050 "code failed to satisfy specified code requirement(s)" UserInfo={NSLocalizedDescription=code failed to satisfy specified code requirement(s)}

upon checking using code sign am getting the following when using the command:

codesign -vvvv -R="anchor apple" <appname>.app
...
--prepared:/Applications/<appName>.app/Contents/PlugIns/<appName>Extension.appex
--validated:/Applications/<appName>.app/Contents/PlugIns/<appName>Extension.appex
--prepared:/Applications/<appName>.app/Contents/Frameworks/lib_InternalSwiftSyntaxParser.dylib
--validated:/Applications/<appName>.app/Contents/Frameworks/lib_InternalSwiftSyntaxParser.dylib
--prepared:/Applications/<appName>.app/Contents/Frameworks/libswift_Concurrency.dylib
--validated:/Applications/<appName>.app/Contents/Frameworks/libswift_Concurrency.dylib
<appName>.app: valid on disk
<appName>.app: satisfies its Designated Requirement
test-requirement: code failed to satisfy specified code requirement(s)

I can't seem to get details on what is causing the last failure: test-requirement: code failed to satisfy specified code requirement(s)

I can't seem to get details on what is causing the last failure:

test-requirement: code failed to satisfy specified code requirement(s)

That error makes sense to me. To start, I recommend that you read TN3127 Inside Code Signing: Requirements, which provides vital background to this issue.

You’re seeing the message above because you’ve passed -R="anchor apple" to codesign. That argument says test this specific requirement. The message is telling is that the test failed. And it failed because your requirement, anchor apple, tests whether the code was signed by Apple as Apple code.

I suspect that what’s going on here is that Xcode’s requirement check has not been updated to account for TestFlight — which uses a different designated requirement structure than standard App Store distribution — and so the TestFlight build is failing. However, that’s just a guess. I don’t have an easy way to determine exactly what code signing requirement Xcode is testing here.

I can see a couple of ways forward here:

  • You could release your extension to the App Store app proper. If that version works, that pretty much confirms my theory.

  • You could open a DTS tech support incident and I’ll track down exactly what requirement it’s testing.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks, I came to the same conclusion after a few more hours debugging and trying other source editor extension projects 😅

I have created a tech support ticket which has movement and have since provided a sample application that has the same outcome. Am hoping to get an answer soon, in the meantime I have distributed a developer signed build to get some testing from a internal small pool to prepare for the release. Hopefully the timing all works out, if not once am happy enough with it I will just be releasing it to the public store as you suggested and going from there.

Cheers,

Michael

For those following along at home, this seems to be a bug in Xcode (r. 91871693), one that’s fixed it in the current Xcode 14 beta (14.0b4, 14A5284g).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Sorry for infrequent updates - can confirm latest Xcode Beta resolves the TestFlight issue. Submitting to the store over the next day so will post back if the issue is resolved for current Xcode (13.4.1)

Update: Just to confirm that AppStore releases will install fine and appear in Xcode 🎉 Unique testing experience for this one - looking forward to Xcode 14 being released so can get back into a testing process 😅

Distributed Xcode Source Editor Extension not appearing in editor menu
 
 
Q