xcode.plugin.zsh 829 B

12345678910111213141516171819202122232425
  1. #xc function courtesy of http://gist.github.com/subdigital/5420709
  2. function xc {
  3. xcode_proj=`ls | grep "\.xc" | sort -r | head -1`
  4. if [[ `echo -n $xcode_proj | wc -m` == 0 ]]
  5. then
  6. echo "No xcworkspace/xcodeproj file found in the current directory."
  7. else
  8. echo "Found $xcode_proj"
  9. open "$xcode_proj"
  10. fi
  11. }
  12. function xcsel {
  13. sudo xcode-select --switch "$*"
  14. }
  15. alias xcb='xcodebuild'
  16. alias xcp='xcode-select --print-path'
  17. alias xcdd='rm -rf ~/Library/Developer/Xcode/DerivedData/*'
  18. if [[ -d $(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app ]]; then
  19. alias simulator='open $(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
  20. else
  21. alias simulator='open $(xcode-select -p)/Applications/iOS\ Simulator.app'
  22. fi