I am running a script in my Xcode project in the Scheme's Build->Post-actions "Run Script". It runs fine but I would like to see the console output of that script. It doesn't seem to be included in the Log Navigator tab, where can I find this log?
Asked
Active
Viewed 7,126 times
46
-
I see pre-build actions logs in Xcode 14.3. – Vlad May 30 '23 at 15:31
1 Answers
76
The output from those scripts doesn't seem to be logged anywhere by default. Your best bet is to manually redirect the output of the script to a known location. For example, add the following as the first line of your script:
exec > /tmp/my_log_file.txt 2>&1
This will redirect all following output to stdout and stderr to your specified log file.

digitalvision
- 2,552
- 19
- 23
-
For some reason even after adding this, neither the folder or files are visible in the project directory but if I use terminal I can see all the files. To print the output of log file you can use: cat /tmp/my_log_file.txt – nr5 Mar 16 '21 at 07:06