Application focus is lost, if left idle

Hi Team,

We are facing issue while executing scripts using appium.
If we are debugging scripts, after few minutes application on mobile gets closed.
Due to which object properties are not found in device.
Delay is also required in screen, then my script fails.

Please suggest a solution for same.

Appium has an idle timeout, after which the server shuts down, NewCommandTimeout. We set ours to 2100 seconds (35 minutes)