https://github.com/qfish/XAlign
配置好Cocoapods
Install & Update
Via source
Clone this repo
Then build the XAlign target in the Xcode project and the plug-in will automatically be installed in ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
Restart Xcode.
Via command-line
curl -fsSL http://qfi.sh/XAlign/build/install.sh | sh
Manually
Download this package XAlign.tar.gz
Unpack it, copy or move the XAlign.xcplugin to the following path:
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/
Tips: To quickly go to Finder type Shift + Cmd + G. If there is no Plug-ins directory, you should make one.
Restart Xcode.
Uninstall
curl -fsSL http://qfi.sh/XAlign/build/uninstall.sh | sh
or Delete the following directory:
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XAlign.xcplugin
Usage
In Xcode
Xcode -> Edit -> XAlign
Auto Align Shortcut (default)
Shift + Cmd + X
You can choose the shortcut in the Settings panel, Xcode -> Edit -> XAlign -> Setting.
Trouble-Shooting
wiki
New version Xcode ? Try this in your terminal :
Get current Xcode UUID
XCODEUUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
Write it into the Plug-ins's plist
for f in ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/*; do defaults write "$f/Contents/Info" DVTPlugInCompatibilityUUIDs -array-add $XCODEUUID; done
Restart your Xcode, and select Load Bundles on the alert