2

I have a requirement to find the version of an app installed in mobile device and if the version is not latest then install latest version. Here how do i automate to find installed app version? I am using appium & selenium to automate my scripts.

1 Answers1

0

if you want to find android app version you can do it using shell command

String cmd = "adb shell dumpsys package your.app.package.name.here |grep versionName";
Process process = null;
try {
     process = Runtime.getRuntime().exec(cmd);
     String appVersion = new BufferedReader(new InputStreamReader(process.getInputStream())).readLine();
        System.out.println("appVersion = "+appVersion);
    } catch (IOException e) {
        e.printStackTrace();
    }

For more info check this stackoverflow question

Suban Dhyako
  • 2,436
  • 4
  • 16
  • 38