Native iOS app capabilities

I am trying to automate my iOS native app. I am using appium with JAVA and TestNG framework.

I have written capabilities as follows:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“appium-version”, “1.4.0”);
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“platformVersion”, “8.4”);
capabilities.setCapability(“deviceName”, “iPhone 4s”);
capabilities.setCapability(“app”, “/Users/ankit/Desktop/Appium/PeddleSeller.app”);
capabilities.setCapability(“bundleId”,“com.Peddle-Seller”);
driver = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
capabilities.setCapability(MobileCapabilityType.APP_PACKAGE, “com.Peddle-Seller”);
capabilities.setCapability(MobileCapabilityType.APP_ACTIVITY, “com.Peddle-Seller.SplashActivity”);

Do I miss anything for iOS app?

Can anyone give me sample project for automation of native iOS app.
It will be great help.

Hi Nilo

The capabilities you are mentioned here is good. But try to use mobile capability type as mentioned below.

Example:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “iOS”);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, “8.2”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “iPad Air”);
capabilities.setCapability(MobileCapabilityType.APP,“local app path”);

1 Like

Thanks Ashok!!..

Isn’t it fine if I don’t use MobileCapability and write capabilities as I have mentioned above?

I am working on iOS that is similar to Android - splash Activity.

Using above code it just loads the screen with image but not moving forward. what can I use here to find the element name for iOS app.

Can you give me some inspector I can use. I have tried to use Appium inspector but I am not able to use. If you can give some way to inspect element on iOS app.

Hi Nilo,

Without using Mobile Capability also it works well.

The Appium inspector works very well in MAC system but in Windows system it doesn’t. Once you clicked the Inspector icon it automatically opens a new window, in that you can find the element ID, name etc.,

In case if it fails,Open the Appium and run Appium doctor it will automatically check all your configuration

Example:

Appium Inspector setup - iOS

Thanks for reply.
I am using appium on mac as I am working with iOS app.

I have got similar issue like https://github.com/appium/appium/issues/5216

Unable to get pid for ‘UIKitApplication:com.Peddle-Seller[0xbee6]’: No such process (err 3)

App is crashing over and over after loading image on starting screen.

Here is more log -

info: [IOS_SYSLOG_ROW ] Jul 6 18:03:21 Mitul-Makadias-iMac com.apple.CoreSimulator.SimDevice.84286705-66FD-4357-8E92-A5BAB552B8BC.launchd_sim[5314] (UIKitApplication:com.Peddle-Seller[0xbee6][5373]): Program specified by service does not contain one of the requested architectures: �l�
info: [IOS_SYSLOG_ROW ] Jul 6 18:03:21 Mitul-Makadias-iMac.local SpringBoard[5325]: Unable to get pid for ‘UIKitApplication:com.Peddle-Seller[0xbee6]’: No such process (err 3)
info: [IOS_SYSLOG_ROW ] Jul 6 18:03:21 Mitul-Makadias-iMac.local SpringBoard[5325]: Unable to delete job with label UIKitApplication:com.Peddle-Seller[0xbee6]. Error: Operation now in progress
info: [IOS_SYSLOG_ROW ] Jul 6 18:03:21 Mitul-Makadias-iMac.local SpringBoard[5325]: Application ‘UIKitApplication:com.Peddle-Seller[0xbee6]’ exited for an unknown reason.
info: [IOS_SYSLOG_ROW ] Jul 6 18:03:21 Mitul-Makadias-iMac com.apple.CoreSimulator.SimDevice.84286705-66FD-4357-8E92-A5BAB552B8BC.launchd_sim[5314] (UIKitApplication:com.Peddle-Seller[0xbee6][5373]): Trampoline was terminated before jumping to service: Killed: 9
info: [IOS_SYSLOG_ROW ] Jul 6 18:03:22 Mitul-Makadias-iMac.local SpringBoard[5325]: table drop: 101

info: [IOS_SYSLOG_ROW ] Jul 6 18:03:22 Mitul-Makadias-iMac com.apple.CoreSimulator.SimDevice.84286705-66FD-4357-8E92-A5BAB552B8BC.launchd_sim[5314] (UIKitApplication:com.Peddle-Seller[0xd461][5374]): Program specified by service does not contain one of the requested architectures: ���
info: [IOS_SYSLOG_ROW ] Jul 6 18:03:22 Mitul-Makadias-iMac.local SpringBoard[5325]: Unable to get pid for ‘UIKitApplication:com.Peddle-Seller[0xd461]’: No such process (err 3)
info: [IOS_SYSLOG_ROW ] Jul 6 18:03:22 Mitul-Makadias-iMac.local SpringBoard[5325]: Application ‘UIKitApplication:com.Peddle-Seller[0xd461]’ exited for an unknown reason.

May i know, why are we using these two capabilities

capabilities.setCapability(MobileCapabilityType.APP_PACKAGE, “com.Peddle-Seller”);
capabilities.setCapability(MobileCapabilityType.APP_ACTIVITY, “com.Peddle-Seller.SplashActivity”);

Thanks in advance