The easiest way is to simply install Xcode 7 side by side with Xcode 8 - this works fine - and upload your project to 7. Create a target companion companion, but do nothing with it. Close Xcode 7 and open Xcode 8 in the same project / workspace and you will see a companion. If you use Swift, you will need to upgrade the language (Xcode 7 uses Swift 2, Xcode 8 uses Swift 3); The IDE will suggest some changes directly when trying to compile, but others that you may need to change manually.
Alternatively / more inconveniently, you can create a new target (e.g., Safari extension) in Xcode 8, and then delete extraneous files (e.g. JavaScript to insert content) and edit / replace the plist in the extension with the plist of the additional companion. Key property <string>com.apple.Safari.extension-companion</string> for NSExtensionPointIdentifier ; also make sure that NSExtensionPrincipalClass implements the protocol for companion extensions (both of these keys are under NSExtension ).
Remember that I had mixed results with this approach. Sometimes it works, sometimes Safari pretends that it does not see the extension companion at all, sometimes the extension cannot see the companion until you restart it, and then it can ... If you can see the extension companion, it should (note the warning here about if the concomitant accident crashes), and I did not find any protocols that help fix these problems. Trying to debug an extra companion using Xcode 8 doesn't work for me either.
I am sorry that Apple did not insist so much on βthinkingβ and simply supported Native Messaging like every other modern browser.
source share