How to launch already installed app from iPhone using appium

我是研究僧i 提交于 2020-12-04 14:27:41

问题


I am writing an automation script using Java + TestNG + Appium.

In a test scenario, I am trying to launch already installed application on iphone. (Box in this case). Box contains some MS office file which I need to access. I am not very sure how can I achieve this.

I tried multiple options such as extracting .app file from iTunes and deploying using Appium, but no success.

Can someone please guide me, if this is possible. If yes, how?


回答1:


Automate a preinstalled app with following scenario.

1.This will only work for applications that are signed with a DEVELOPMENT cert.

2.This will NOT work for applications that are signed with a DISTRIBUTION cert

3.If you have created the app with a developer provisioning profile, and built yourself. Or downloaded it using testFlight, and is signed with a development provisioning profile

4.This is because Apple's Instruments will not allow you to interact with those applications which is live. (Even if you knew the bundleId)

if your app is in development mode please follow these things 1.The bundleId of the app that was installed on the device. Use that as the app capability.

  1. Follow the Appium Real Devices guide (substitute any .ipa/.app reference with the bundleId)

In addition to your regular desiredCapabilities (ex. platformName, platformVersion, deviceName).. these should be your desiredCapabilities:

For preinstalled apps

desiredCaps['app'] = 'yourbindleID'

Device's unique identifier

desiredCaps['udid'] = '1824y983h2849gh2498'



回答2:


this works for me

HashmMap<String, Object> args = new HashMap<String,Object>();
args.put("bundleId","*YOUR_APP_BUNDLEID*");
driver.executeScript("mobile: launchApp", args);


来源:https://stackoverflow.com/questions/39608711/how-to-launch-already-installed-app-from-iphone-using-appium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!