I will try to this code but could not Allow permission.
let popup = XCUIApplication(bundleIdentifier: "com.apple.springboard")
if isExists(popup) {
let button = popup.alerts.firstMatch.buttons["Allow"]
button.tap() //<-- *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil (NSInvalidArgumentException)
}