diff --git a/WebDriverAgentLib/Commands/FBCustomCommands.m b/WebDriverAgentLib/Commands/FBCustomCommands.m index 21b67173f..5b1ce72ae 100644 --- a/WebDriverAgentLib/Commands/FBCustomCommands.m +++ b/WebDriverAgentLib/Commands/FBCustomCommands.m @@ -556,6 +556,13 @@ + (NSString *)timeZone ? [elementCache elementForUUID:(NSString *)request.parameters[@"uuid"]] : request.session.activeApplication; id keys = request.arguments[@"keys"]; + + if (![destination respondsToSelector:@selector(typeKey:modifierFlags:)]) { + NSString *message = @"typeKey API is only supported since Xcode15 and iPadOS 17"; + return FBResponseWithStatus([FBCommandStatus unsupportedOperationErrorWithMessage:message + traceback:nil]); + } + if (![keys isKindOfClass:NSArray.class]) { NSString *message = @"The 'keys' argument must be an array"; return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:message