java – Hi All. Could you please help me to resolve the below issue?


I am using mac system for iOS automation using Appium. After setting all desired capabilities and I am getting the below error :

“Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: The desired capabilities must include either an app or a bundleId for iOS”

Host info: host: ‘IN-G6XW22FRH1-CTS’, ip: ‘fe80:0:0:0:1455:b9b4:2319:9738%en0’
Build info: version: ‘4.15.0’, revision: ‘1d14b5521b’
System info: os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘13.6.1’, java.version: ‘17.0.8.1’
Driver info: io.appium.java_client.ios.IOSDriver
Command: [null, newSession {capabilities=[{browserName=chrome, appium:deviceName=iPhone 14, platformName=IOS, appium:platformVersion=16.4}], desiredCapabilities=Capabilities {browserName: chrome, deviceName: iPhone 14, platformName: IOS, platformVersion: 16.4}}]
Capabilities {browserName: chrome, deviceName: iPhone 14, platformName: IOS, platformVersion: 16.4}

Code :

package iosdevices;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.ios.IOSDriver;

public class firstIosTest {

public static void main(String[] args) throws MalformedURLException {
    // TODO Auto-generated method stub
    firsttest();

}

public static void firsttest() throws MalformedURLException
{
DesiredCapabilities cap = new DesiredCapabilities();
 cap.setCapability("platformName", "iOS");
  cap.setCapability("platformVersion", "16.4");
  cap.setCapability("deviceName", "iPhone 14");
  cap.setCapability(CapabilityType.BROWSER_NAME, "chrome");
  
  //cap.setCapability("app", “location of .app or .ipa file“);

  URL url = new URL("http://127.0.0.1:4723/wd/hub");
  
  IOSDriver driver = new IOSDriver(url, cap);

}

}

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img