How to run xcode from terminal?

后端 未结 7 2444
挽巷
挽巷 2020-12-23 11:37

My question is very simple: suppose there is an xcode project a.xcodeproj, could I open it with the command: xcode a.xcodeproj?

If I try this, I receiv

7条回答
  •  北荒
    北荒 (楼主)
    2020-12-23 12:00

    Xcode should be the default application for .xcodeproj files, so this should work:

    $ open a.xcodeproj
    

    If that opens a different application, you can force it to use xcode:

    $ open -a Xcode a.xcodeproj
    

    If you want the command xcode to work, you can just alias it:

    $ alias xcode="open -a Xcode"
    

    then you can just xcode a.xcodeproj (and add this to ~/.bash_profile)

提交回复
热议问题