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


#1

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/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:382:61)
[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/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/node-simctl/lib/simctl.js:382:61)

code:
import java.net.MalformedURLException;

import java.net.URL;

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/UICatalog.app”);

IOSDriver<IOSElement> driver = new IOSDriver<>( new URL(“http://127.0.0.1:4723/wd/hub”),d);

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