How to prevent app falling in sleeping status on Mac?
You can disable the App Nap feature on any app by finding it in Applications, Get Info, then uncheck App Nap.  



The App Nap checkbox doesn't appear for all apps - &amp; I can't figure out what determines that.

Otherwise, you can disable it globally from Terminal using the command
defaults write NSGlobalDomain NSAppSleepDisabled -bool YES