蘋果為了避免類似 Xcode Ghost 事件的再次發生,Xcode8 禁用了插件機制,而開放了另一種形式:Source Editor extensions,但是這種形式局限性太大。本文介紹Xcode 8 繼續使用插件。
Tips:使用之前請先備份Xcode,安裝插件后不可打包上傳Appstore,使用請謹慎!
原Xcode 插件安裝目錄
tips:如果遇到插件引起Xcode crash的情況,可在改目錄下刪除對應插件
~/Library/application/ Support/Developer/Shared/Xcode/Plug-ins對Xcode進行重簽名
鑰匙串訪問 -> 證書助理 -> 創建證書 名稱:XcodeSigner 身份類型:自簽名根證書 證書類型:代碼簽名
期間允許所有權限
sudo codesign -f -s XcodeSigner /Applications/Xcode.app重啟Xcode,選擇 load bundles
通過 Alcatraz 安裝插件后,重啟Xcode不出現 load bundles 提示框,執行“修改UUID”,再重啟Xcode。 某些插件無法通過Alcatraz安裝,可直接通過github下載打開。
大部分插件還是能夠正常使用,以下列舉若干。
AdjustFontSize
快捷鍵:? + 或者 ? -A simple plugin for Xcode to adjust font size without going into Settings → Fonts & Colors and changing each source type. Simply hit ? + or ? - and all fonts will be adjusted. Plugin respects different font sizes per each syntax type.
AllTargets is a plugin for Xcode. The plugin intends to auto select targets depending of the selected configuration when you add files to the PRoject.
AMMethod2Implement
快捷鍵:Ctrl+AA simple Xcode plugin to generate implement code for the selected method, selector and const string, currently, only support objective-c.
Xcode plugin for fixing bug in Xcode 6+: if you input “@”, auto completion does not work, you still need to press “ESC” to show the auto completion list.
This is a convenient and fast approach to create property. You do not need to type @property and nonatomic when you declare a property.
Auto-Importer-for-Xcode(無效)
快捷鍵:? + ctrl + HQuickly import your headers on the fly without having to manually go to the top of your file and type the import statement.
Xcode plugin for C Style Comment(uncomment) /**/
CleanHeaders-Xcode
快捷鍵:command+|An Xcode plug-in to format your import headers in a systematic manner. It simply removes duplicates, spaces and sorts them alphabetically making it much more easier to read and avoid duplicate imports. Works with @imports, #include, #import and import.
A plugin for Xcode that shows colours and allows you to modify them. It works for both UIColor and NSColor in Swift and Objective-C.
With thanks to the genius who suggested this plugin, GitDiff displays deltas against a git repo in the Xcode source editor once you’ve saved the file. To use, copy this repo to your machine, build it and restart Xcode. Differences should then be highlighted in orange for lines that have been modified and blue for new code. A red line indicates code has been removed. Hover over deleted/modified line number to see original source and after a second a button will appear allowing you to revert the change.
This plugin is used to autocompletion enum members for Objective-C
Highlight the String which is same to selected string.
injectionforxcode
快捷鍵:ctrl+=Injection for Xcode is an Xcode plugin (available via Alcatraz) or AppCode that dynamically inserts new Swift / Objective-C code into a running app in order to speed up your build process. It does this without making any changes to your project.
IntelliPaste-for-Xcode
快捷鍵:Shift+Cmd+VIntelliPaste is an Xcode plugin that makes copy-pasting methods and RGB colors easier.
KSHObjcUML
快捷鍵:Select Product->Objc-UML or Swift-UMLKSHObjcUML can show oriented graph of dependencies between Objective-C and Swift classes in your project. This plugin is based on objc-dependency-visualizer.
Can’t remember whether that image you just added to the project was called button-separator-left or button-left-separator? Now you don’t have to, because this will autocomplete your imageNamed: calls like you’d expect. Just type in [NSImage imageNamed: or [UIImage imageNamed: and all the images in your project will conveniently appear in the autocomplete menu. You’ll even get a handy preview of the image you’re about to select.
SCXcodeSwitchExpander is a small Xcode plugin that expands switch statements by inserting missing cases.
VVDocumenter-Xcode
快捷鍵:///Writing documentation is so important for developing, but it is really painful with Xcode. Think about how much time you are wasting in pressing ‘*’ or ‘/’, and typing the parameters again and again. Now, you can find the method (or any code) you want to document to, and type in ///, the document will be generated for you and all params and return will be extracted into a javadoc style, which is compatible with appledoc, Doxygen and HeaderDoc. You can just fill the inline placeholder tokens to finish your document.
XAlign(無效)
快捷鍵:Shift+Cmd+XAn amazing Xcode plugin to align regular code. It can align anything by using custom alignment patterns.
http://www.cnblogs.com/shidaying/p/6232254.html
新聞熱點
疑難解答