WebDriverAgent constantly requests password to enable UI Automation on macOS Monterey

I updated my machine to:

  • macOS Monterey Version 12.4
  • Xcode Version 13.4 (13F17a)
  • iOS Version 15.4.1 (19E258) device real (iPhone 11)
  • iOS Version 15.5 (19F77) device real (iPhone 11)

I executed this command on host machine which is wirelessly connected to X code.

$ automationmodetool enable-automationmode-without-authentication
Setting up machine to allow Automation Mode without requiring user authentication... succeeded.
$ automationmodetool
Automation Mode is disabled.
This device DOES NOT REQUIRE user authentication to enable Automation Mode.

but I still get this exception Underlying Error: Timed out while enabling automation mode.

My devices constantly requests password to enable UI Automation.