Browser is launched instead of app

Hello Everyone,

I am trying to automate app with real device.
But, then "appium.io" website is launched in my device instead of app being launched.

Observation:-
I could notice as soon as I run my eclipse ,a session is being created and that session have browser as desired capability.I am not sure if this is related.

Environment Details:-
Appium version:- 1.6.5-beta
Xcode:-Version 8.2.1
Device:- iphone 6 plus

Script
I am running the script from command prompt with the following command
appium --app “xx.ipa” --browser-name “” -a 127.0.0.1 --device-name “iPhone 6s” --show-ios-log --automation-name “XCUITest” --udid xxxxxx

Logs:-
appium_log.txt (882.0 KB)

Code
Code.txt (2.9 KB)

Remove this line from your code
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME,"");

Thanks @upendraupadhyay but it didn’t help.:frowning: Same issue

When you start appium, leave off all those parms. Instead, pass them as capabilities when you create your session from your java code. Don’t specify browserName anywhere.

please share error log

after removing broswser line

Thanks for your reply …If I run without --udid parameter it throws me “Error: Sdk ‘10’ was not in list of simctl sdks”
So I ran appium with only --udid parameter and here is the log
appium_log1.txt (78.1 KB)

Thanks @upendraupadhyay …Please find attached the appium log after removing browser line

Your Log shows safari browser is set
Note When you set Both App Path Safari Browser Capability
it will launch Browser first

[Appium] Creating new XCUITestDriver (v2.30.0) session
[Appium] Capabilities:
[Appium] browserName: ‘Safari’
[Appium] platformName: ‘iOS’
[Appium] deviceName: ‘iPhone 6 plus’
[Appium] platformVersion: ‘10.1.1’
[Appium] udid: ‘***************************’
[debug] [XCUITest] XCUITestDriver version: 2.30.0
[BaseDriver] Session created with session id: 8fbea25e-6a23-4ca5-836c-b406f9af0da5
[debug] [XCUITest] Xcode version set to ‘8.2.1’ (tools v8.3.0.0.1.1490382677)
[debug] [XCUITest] iOS SDK Version set to ‘10.2’

//Try this
System.out.println(“Start to Test DC”);
File app = new File("/Users/abc.ipa");
DesiredCapabilities caps= new DesiredCapabilities();

    System.out.println("New Devices");
    caps.setCapability("platformName", "IOS");

    caps.setCapability("deviceName", 574765658856);
    caps.setCapability("udid",548756785345));
    caps.setCapability("app", app.getAbsolutePath());
    caps.setCapability("automationName","XCUITest");
    caps.setCapability("xcodeConfigFile","/Users/Desktop/abc.xcconfig");

    caps.setCapability("platformName", "iOS");
    caps.setCapability("platformVersion", "10.1.1");
  

    driver=new IOSDriver<IOSElement>(new URL("http://127.0.0.1:4723/wd/hub"),caps);
    driver.manage().timeouts().implicitlyWait(60, TimeUnit.DAYS.SECONDS);

You should not need the ‘udid’ parm to start the appium service. You just need to make sure you include it as a desired cap when instantiating your driver session. Also, like was mentioned, you still appear to be passing in a browserName capability.

Thanks a lot @Brian_Watson and @upendraupadhyay

I can launch app successfully now.Thanks again guys!