c++xcodexcode-command-line-tools

Compile and execute cpp in xcode, and add additional execution instructions, Such as iconv command


Sorry, I'm new to Xcode and not very familiar with it, I use Xcode (command line tool project with external build system) to compile cpp files and automatically execute cpp unix executable files. After the program is compiled (command+R), I set the settings as shown in the screenshot below to automatically execute. Is there any way for me to execute also add additional commands? Such as iconv.

my scheme settings

The following line is what I ultimately want to execute. ./myFile argument1 | iconv -f big5

But my Xcode looks like it's executing only ./myFile argument1

really thanks


Solution

  • On the same place where you setup the build scheme, you can also add a post-build script.

    A screenshot of adding a post-build script: Screenshot of adding a post-build script

    *Older versions of Xcode might have different GUI, but the idea should be about the same.