I was trying to set up Appium to automate iOS app actions on an Xcode iPhone 8 simulator. I was unsure of how to allow the Appium desktop server to interact with the simulator. I saw that I had to set certain capabilities and based on some tutorials, I set platformName, platformVersion, deviceName, but when I tried to set "app" capability, it said that it could only be set to .app files. My app is an xcodeproj, and I was wondering if it was possible to use it as is? Also, I was wondering how to allow appium to interact with built-in iOS apps, such as calendar, clock etc because I don't have the app files for those apps. Does the desiredCapabilities for appium have to be set to a .app file, or can I also use appium to interact with the iphone simulator itself?
Through the appium inspector, I have set platformName to "iOS", platformVersion to "15.5", deviceName to "iPhone 8", but I can't set the path to an .app file because my app is an xcodeproj.
CodePudding user response:
enter code here
1.No need to Set app path.
2.Build your app xcodeproject and also install your simulator.
DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("platformName",("platformName"));
capabilities.setCapability("deviceName", ("deviceName"));
capabilities.setCapability("platformVersion"("platformVersion"));
capabilities.setCapability("bundleId",("bundleId"));
capabilities.setCapability("udId",("udId"));
capabilities.setCapability("deviceOrientation", "portrait");
capabilities.setCapability("automationName", "XCUITest");
driver = new IOSDriver<WebElement>(url, capabilities);
CodePudding user response:
enter code here
I Give Java code
deviceName=iphone 7 black
udid =6d01f0eb40c1956f6fe0ebeeabd83a8e0*****
platformName =iOS
platformVersion=15.3.1
appPackage=Give Your appPacakge Name
launcherActivity=Give Your Appactivity name or LauncherACtivityName
url=http://127.0.0.1:4723/wd/hub
bundleId=Give Your APP BundleID