More Related Content
Similar to 打造你專屬的Xcode plugin (20)
打造你專屬的Xcode plugin
- 2. Overview
• Xcode plugin template
• 窺探Xcode runtime
• 寫plugin⼀一些⼩小撇步
• 好東⻄西要與好朋友分享
- 5. Xcode plugin簡介
• 附檔名為.xcplugin
• 放在~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/
- 6. Xcode template
• Infos.plist
!
$ defaults read /Applications/Xcode.app/Contents/Info.plist | grep
DVTPlugInCompatibilityUUID
DVTPlugInCompatibilityUUID = "A2E4D43F-41F4-4FB9-BB94-7177011C9AED";
- 7. Xcode template
• 設定Building Settings
參數名稱值說明
Installation Build
Products Location
${HOME} Product根⺫⽬目錄
Installation
Directory
/Library/Application
Support/Developer/
Shared/Xcode/Plug-ins
這是⼀一個相對路徑,會被上
⾯面設定所影響。
Deployment Location YES Installation Directory
Wrapper Extension xcplugin Xcode plugin的附檔名
- 12. ⼩小撇步3
• Find a control
http://stackoverflow.com/questions/2715534
• 接收所有的通知
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(listenAll:) name:nil object:nil];
• Hack private API
swizzle method https://github.com/rentzsch/jrswizzle
- 13. ⼤大功告成
• MCLog - 利⽤用Regular Expression過濾console log
https://github.com/yuhua-chen/MCLog
- 15. 上架吧
• GitHub
• Alcatraz - The package manager for Xcode.
http://alcatraz.io/
• clone下來
• package.json加上資訊
• 發pull request