iOS Simulator gets started while running appium tests on real iOS devices in MAC

When I’m trying to run the appium scripts on real iOS devices, I see simulator gets started first and then tests run on real device. How can I overcome this issue?

Environment details:

Appium - v1.6.3


iOS device - iPhone 7s plus

iOS device OS - 10.2.1

Here i’m adding capabilities which I used:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "iOS");
capabilities.setCapability(CapabilityType.VERSION, "10.2.1");
capabilities.setCapability("deviceName", "iPhone 6s Plus");
capabilities.setCapability("deviceID", "a5910cb33f60a3301f69ac3222e937c6ac565a17");
capabilities.setCapability(CapabilityType.PLATFORM, "iOS");
capabilities.setCapability("appPackage", "com.idmetrics.fleetApp");
capabilities.setCapability("app", "/Users/CH0006/Library/Developer/Xcode/Archives/2016-12-15/CatfishAir 15-12-16, 2.39 PM.xcarchive/Products/Applications/");
capabilities.setCapability("automationName", "XCUITest");
capabilities.setCapability("autoAcceptAlerts", true);
capabilities.setCapability("waitForAppScript", "$.delay(8000); $.acceptAlert();");


When I provided device name as what I see in General settings (say ‘My iPhone7s’) I see error says ‘Invalid device type’. So that I have device name as ‘iPhone 6s Plus’, then it started working but simulator gets started.


Instead of deviceName, use udid.

capabilities.setCapability("udid", "a5910cb33f60a3301f69ac3222e937c6ac565a17");

Reference -

When I tried that, I see error:

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): deviceName can't be blank.

when u are running your test on real device than your should be always .ipa

Your capabilities change to .ipa file instead of .app.