xcode.plugin.zsh 769 B

123456789101112131415161718192021222324
  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. if [[ -d $(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app ]]; then
  18. alias simulator='open $(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
  19. else
  20. alias simulator='open $(xcode-select -p)/Applications/iOS\ Simulator.app'
  21. fi