First a little disclaimer, I'm not an automator, but I'm trying to learn. I'm trying to maintain code that someone else wrote. We are using Appium capabilities to launch the APK under test on an emulator and then launching the tests. The problem is that in our latest build our APK now checks for another APK and if it's not installed it will prompt the user to install it. So now the scripts do not work because I'm not clicking the 'Install' or 'Cancel' button on the install process. My question is what is the best way to fix this so that my tests aren't failing. I'm thinking either- 1.) Install the second SDK before my app has a chance to check for it (I do not need to test that now), I'm using the scripts for regression of existing functionality 2. Have the scripts click the "Install" button.

The problem with #1 is that I don't see how to install more than 1 APK using the Android Set Capabilities. The problem with #2 is that I'm not sure how to inspect the elements on the install package and click Install?

So my question- Can you use setCapabilites to install more than 1 APK or is it possible to use Appium to prompt an install?

  • As far as I know if you check code , you will find PATH from where appium is getting APK , you just replace your latest APK to that path and then run script. Commented Apr 15, 2015 at 2:41
  • Thanks Helping Hands, but I need to install an additional APK (of a different app). I'm have changed the path the latest APK, but I need to install a second, completely different, new app. Any ideas how I can do that? Thanks!
    – snowmom475
    Commented Apr 16, 2015 at 0:03
  • I understood your concept but it will work with only one APK at a time and that is only way to replace old with new in defined path. Commented Apr 16, 2015 at 2:43

1 Answer 1


Of course it's better to take care about your test environment before test execution.

It means if you have to have another app installed in test environment prior to test execution, you had better to do it in some TestSuiteSetUp class which will do common work preparing your application and environment for test execution.

In your case the easiest way would be to use appium-adb library which gives you opportunity to use standard adb commands in appium. With help of this you'll have to implement following simple logic (simplified pseudocode):

if is_application_installed(application) then
return true
else install_application()

fill out this method with code from http://stackoverflow.com/questions/11392183/how-to-check-programmatically-if-an-application-is-installed-or-not-in-android*

adb install -r application_to_install

Here is_application_installed method checks whether the app is already installed, and install_application takes care of installing the application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.