Xcode command line tool - how to run in terminal?

后端 未结 3 688
猫巷女王i
猫巷女王i 2021-02-14 03:00

When you create a Command Line Tool project in Xcode you get this, in main.m:

#import 

int main(int argc, const char * argv[])
{
         


        
3条回答
  •  失恋的感觉
    2021-02-14 03:15

    Assuming your executable is named "my_program", and it's in the "/foo/bar/Debug" directory:

    cd /foo/bar
    ./my_program
    

    If you aren't sure how to find the program file itself, you can right-click it (i.e.: the "product") and "Show in Finder" as shown in this screenshot:

    enter image description here

提交回复
热议问题