xcode.plugin.zsh 847 B

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