title: macOS: How to redirect STDERR / STDOUT of a process AFTER started, using Terminal?
body: <p>In macOS one can normally get some appreciable console / shell output by executing a process by executing it's binary directly in the Terminal via:</p>
  
  <pre><code>/Applications/SOME_APPLICATION.app/Contents/MacOS/SOME_APPLICATION
  </code></pre>
  
  <p>This can be very useful from time to time for debugging and catching errors that occur. With the introduction of Catalina (10.15), direct execution of applications in this fashion is discouraged from scripts, etc. and causes various problems, ultimately requiring the use of <code>/usr/bin/open</code>. </p>
  
  <p><strong><em>How can we redirect STDERR / STDOUT of a process after it's been started?</em></strong> </p>
  
  <hr>
  
  <p>There has been some discussion on this topic <a href="https://stackoverflow.com/a/593764/320681">previously for Linux</a>, but it's not clear as to whether some of this will work out for macOS now.</p>
  
  <p><a href="https://github.com/nelhage/reptyr" rel="nofollow noreferrer">reptyr</a> would be fantastic if it could be repurposed for macOS since it already works mostly for FreeBSD.</p>