I have a Mac Mini that I use as a build platform, from within Visual Studios 2017 for Windows, to write and debug iOS apps.
I've noticed that when I establish a connection between VS and the Mac, I have to log into the Mac remotely (I use TigerVNC) before launching the connection process. If I don't establish a remote desktop session on the Mac, the connection will fail part way through because the Mac has gone back to sleep (i.e., the power LED has gone dark).
This is a different behavior than what I'm used to when accessing a Windows machine remotely. For them, once you establish a connection, the machine stays awake until the connection is closed, and the sleep timeout period expires.
Is this by design for Macs? Is there a setting that I can change to make it stay awake without first creating a desktop session?