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.
Asked
Active
Viewed 617 times
2
-
how would you have done it manually? start with the steps and just automate it! – Moshe Slavin Jun 11 '19 at 14:16
-
That we can do but is there a way to find version of installed app directly without navigating to app? – Murali.Molluru Jun 11 '19 at 15:26
-
Is the version stored in a plist or manifest doc that can be extracted programmatically? – Mike Collins Jun 11 '19 at 19:07
1 Answers
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