Displaying an error: “Original error: ‘app’ option is required for reinstall” while start session in Appium

Maja Ucek picture Maja Ucek · Apr 24, 2020 · Viewed 8.2k times · Source

I’m new at Appium. I defined into ‘Desired Capabilities’ tab needed capabilities such as:

  • deviceName
  • udid
  • platformName
  • platformVersion
  • appPackage
  • appActivity

After I clicked on the Start Session button, I got the error message “An unknown server-side error occurred while processing the command. Original error: ‘app’ option is required for reinstall”.

Before that, I started a virtual android device but I don't have the right app on my device. Should I connect source code with Appium capabilities and how do I do that? Which tools should be used (Android Studio or IntelliJ IDEA)?

Answer

NITIN SURANGE picture NITIN SURANGE · Apr 26, 2020

This error occurs when you don't have an app installed on your device.

Two ways to resolved this issue-:

  1. Install the application on the device using a script by using app capabilities.

    In the app's desired capability, you have to give an absolute path for the .apk file.

    "platform"       : "Android",               
    "platformVersion": "9.0",
    "deviceName"     : "Redmi Nitin",
    "appPackage".    : "my.nitin.stackoverflow",
    "appActivity"    : "view.activity.splash.SplashScreenActivity",
    "automationName" : "uiautomator2",
    "app".           : "giveherepath.apk"
    "fullReset".     : "true"
    
  2. If you don't want to install the .apk file using script then you install it manually and launch the app using package name and activity capabilities as you mention in question.

    "platform"       : "Android",               
    "platformVersion": "9.0",
    "deviceName"     : "Redmi Nitin",
    "appPackage".    : "my.nitin.stackoverflow",
    "appActivity"    : "view.activity.splash.SplashScreenActivity",
    "automationName" : "uiautomator2",
    "fullReset".     : "true"