How to run the iOS tests running even if the Mac gets asleep?

I am using contrab to schnedule the test script every 10 mins and in case of Android, even if the Mac gets into lock-screen, the tests are being executed. But, in case of the iPhone, if the Mac gets into lock-screen, the tests are paused and they resume once the Mac is turned on. How can I have the tests running on the iPhone even when the Mac is locked?

-> Appium version 1.15.1
-> MacBook Pro + macOS Mojave v 10.14.6
-> iPhone 6s with iOS 12.4

I would try WakeOnLan: https://community.spiceworks.com/topic/1990806-wake-on-lan-wol-on-a-mac

Sorry, I had a misunderstanding. I want to about how to let it run even on lock screen.

So, I have found a way to do it from here https://apple.stackexchange.com/a/292747. Someone with the authority can close this thread. Thank you!