0%

strace in mac

February 19, 2026

C

1. Purpose

In linux we can use strace to investigate all of the system call in a program. This tool is unfortunately not available in Mac OS and in this article we explore a third party tool to achieve the same functionality in mac.

2. Installation

We simply follow the installation steps in

Note that we may need to add the bin/ directory into our $PATH variable manually, to do this, we write the following in ~/.zshrc:

export PATH="$PATH:/Users/<user-name>/Library/Python/3.9/bin"

Now the executable strace should be detectable.

3. Result

Compile your C program by gcc such as gcc -o some_app some_app.c, then

strace ./some_app

we should see the colored logging in our terminal: