Cannot read property 'replace' of undefined [XCUITest] at replace

Simulator udid not provided
[XCUITest] Using desired caps to create a new simulator
[XCUITest] TypeError: Cannot read property ‘replace’ of undefined
[XCUITest] at replace (/Applications/
[BaseDriver] Event ‘newSessionStarted’ logged at 1559900324717 (11:38:44 GMT+0200 (CEST))
[W3C] Encountered internal error running command: TypeError: Cannot read property ‘replace’ of undefined
[W3C] at replace (/Applications/



import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.ios.IOSDriver;

import io.appium.java_client.ios.IOSElement;

import io.appium.java_client.remote.AutomationName;

import io.appium.java_client.remote.MobileCapabilityType;

public class baseios {

public static void main(String[] args) throws MalformedURLException {

// TODO Auto-generated method stub

DesiredCapabilities d = new DesiredCapabilities();

d.setCapability(MobileCapabilityType. DEVICE_NAME , “iPhone 6”);

d.setCapability(MobileCapabilityType. PLATFORM_NAME , “IOS”);

d.setCapability(MobileCapabilityType. AUTOMATION_NAME ,AutomationName. IOS_XCUI_TEST );

d.setCapability(MobileCapabilityType. APP , “//Users/hhhh/Desktop/”);

IOSDriver<IOSElement> driver = new IOSDriver<>( new URL(“”),d);

could anyone solve this issue. I am working on Macintosh HD

I solved this problem by specifying PLATFORM_VERSION when I set my desired capabilities. To know what platform version your virtual device is running you can use this command: xcodebuild -showsdks
I started having this problem right after upgrading my Appium Desktop version. Not sure if it’s related, but timing was suspicious.