简体   繁体   English

如何安装Xcode源代码编辑器扩展?

[英]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. 它在调试Xcode版本(带有灰色图标)时工作正常但我找不到将此扩展安装到“真正的”Xcode的方法。 Documentation is quite obscure for this topic. 文档对于这个主题来说非常模糊。 What I have tried - 1. Build and run host application. 我尝试过 - 1.构建并运行主机应用程序。 2. Move resulting .appex file into PlugIns directory of Xcode. 2.将生成的.appex文件移动到Xcode的PlugIns目录中。 Nothing worked for me. 没有什么对我有用。

I use macOS Sierra and Xcode 8. 我使用macOS Sierra和Xcode 8。

在SwiftInitializerGenerator扩展的github页面上有一个很好的教程: https//github.com/Bouke/SwiftInitializerGenerator#installation

Installation: 安装:

  1. Archive extension project (Product > Archive). 归档扩展项目(产品>归档)。
  2. (From Organizer window) 'Export...' > 'Export as a macOS App'. (从“管理器”窗口)“导出...”>“导出为macOS应用程序”。
  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'. 如果您打开“系统偏好设置”>“扩展程序”,它应显示在“Xcode源代码编辑器”下。

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. 注册通过macOS Launch Services进行管理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM