Install and Uninstall Android App

Hi,

How do we Install and Uninstall Android App using Appium?

App is not previously installed and I’m trying for fresh installation.
I have been using “–full-reset” to start the appium server. Also providing setting setting capability.

capabilities.setCapability(“app”, app.getAbsolutePath());

Its not installing the app. Could you please help?

Thanks,
Ajay

Hello,

You have 2 options:

  1. Install App on real device.
    You have to declare your apk file location.
    File file = new File(“pathToYourApkFile.apk”);
    Also add:
    capabilities.setCapability(“app”, app.getAbsolutePath());
    These lines will install app in your real device.

  2. Install App on virtual device:
    Just copy apk file to SDK folder and run adb install yourapk.apk

Hope it will help.

1 Like

Can you please share your Android driver creation code.

Ideally it should uninstall existing app and re-install.

How can i uninstall app from android device

Can you be more elaborate with your requirement ?
Below command will uninstall the APK from your device. Ensure to call it before driver is killed or quit.

driver.removeApp(<<packageName as String>>);

can we reset app and keep defalut setting as it is save.

Hello,

I have tried the method 1 provided by you. But still it is not installing the apk

driver.installApp("/Users/johndoe/path/to/app.apk");

  • Worked for me