Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Xcode source editor extension?

I created a source editor extension but don't understand how to use it. It works fine in debugging version of Xcode (with gray icon) but I cannot find a way to install this extension to "real" Xcode. Documentation is quite obscure for this topic. What I have tried - 1. Build and run host application. 2. Move resulting .appex file into PlugIns directory of Xcode. Nothing worked for me.

I use macOS Sierra and Xcode 8.

like image 977
Alexander Doloz Avatar asked Oct 13 '16 10:10

Alexander Doloz


People also ask

What is extension Xcode?

Overview. You build extensions to the source editor in Xcode using XcodeKit. Source editor extensions can read and modify the contents of a source file, as well as read and modify the current text selection within the editor.

What is XcodeKit?

A buffer you use to access and modify the text contents and text selections in a source editor.


2 Answers

There is a nice tutorial on github page of SwiftInitializerGenerator extension: https://github.com/Bouke/SwiftInitializerGenerator#installation

like image 123
Tomáš Kohout Avatar answered Oct 19 '22 03:10

Tomáš Kohout


Installation:

  1. Archive extension project (Product > Archive).
  2. (From Organizer window) 'Export...' > 'Export as a macOS App'.
  3. Double click the app you just exported, (it will run the App). Quit it. That is the actual install.

A few notes:

If you open 'System Preferences' > Extension, it should show under 'Xcode Source Editor'.

Move extension to the trash, reopen 'System Preferences', extension is gone. Guessing this is the uninstall how to.

Move extension out of the trash and reopen 'System Preferences', it will reappears.

You must run the Extension App at least once. The registration is managed through macOS Launch Services.

like image 8
bauerMusic Avatar answered Oct 19 '22 03:10

bauerMusic