I made a command line tool as a Cocoa Application in XCode and when I archive it, it generates a .app file that contains the underlying executable file. To actually run it, I need to execute that underlying file which is located at AppName.app/Contents/MacOS/AppName. Is there any way I can have it build just the executable? I don’t want to have to create a post build step that copies the executable out of the .app file.
Thanks
When you create an Xcode project you choose the project type. Cocoa Application and Command Line Tool are two of the choices. Apparently you created a Cocoa Application but modified the template provided main.m file to execute as a Command Line Tool. However, once a project has been created it cannot be converted to another project type. Xcode will still treat it as the project type you created it as.
You can solve your problem by creating a new project, this time with type Command Line Tool, copy in the same software, and build. The build product will be a UNIX command line program just as you wish.