Failed to prevent system sleep during UI testing. Error code: -536870211

I get this error when I try to run unit tests (yes, it says "UI testing", but I don't have any UI tests). On both simulator and device, whether I run/build the app before or not. How do I solve this?

Any hints what can be done when this happens?

It happens now for me with Xcode 13...

-536870211 translates to 0xe00002bd which is kIOReturnNoMemory, which is not what I was expecting )-:

I presume that, like yanfromvancouver, you’re hitting this on a unit test. If so, does the problem reproduce if you create a new dummy project from one of the built-in templates?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you, Quinn for the quick answer!

Sorry, I didn't update this thread, but restarting everything helped. It seems to be some kind of illegal/strange state.

This is still happening for me with latest Xcode beta on Ventura. It's bloody annoying when it starts happening. It's even continuing after a reboot!

I've filed a Feedback on it, if that helps: FB11344760 with this info

Details

Failed to prevent system sleep during UI testing. Error code: -536870211

Domain: IDEFoundationErrorDomain

Code: 1

User Info: {

    DVTErrorCreationDateKey = "2022-08-22 22:52:06 +0000";

}

--

System Information macOS Version 13.0 (Build 22A5321d) Xcode 14.0 (21322) (Build 14A5284g) Timestamp: 2022-08-22T17:52:06-05:00

Failed to prevent system sleep during UI testing. Error code: -536870211
 
 
Q