How to get version details of native application under test both for Android and iOS

I have tried using Appium API method getAppStringMap() to get app version details per the Appium documentation but it is throwing below Exception when executed on real device in Perfecto cloud. Can you please help me how to get version details of application under test. Appreciate your inputs.

Platform: iOS and Android
java Client langauage: 6.1.0
pm-webdriver: 10.4
selenium: 2.48

Exception Trace:
Aug 01, 2019 3:21:53 PM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
INFO: Detected dialect: OSS
Exception in thread “main” org.openqa.selenium.WebDriverException: getAppStrings command is not supported
Command duration or timeout: 0 milliseconds
Build info: version: ‘3.13.0’, revision: ‘2f0d292’, time: ‘2018-06-25T15:24:21.231Z’
System info: host: ‘’, ip: ‘’, ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_212’
Driver info:
Capabilities {appPackage: com.MyApp, assert_javascript_enabled: true, deviceName: R3JYHY, deviceSessionId: sample123@abc…, entityType: appium_driver, executionId: sample123@abc…, host:, javascriptEnabled: true, password: , platform: ANDROID, platformName: Android, reportPdfUrl:…, scriptName: RemoteWebDriver, securityToken: , serverConnector: , testGridReportUrl:…, user: , webdriver.remote.sessionid: 989c0f81-b03f-4289-841c-5d7…}
Session ID: 989c0f81-b03f-4289-841c-5d7c00fc6a7c
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.openqa.selenium.remote.ErrorHandler.createThrowable(
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(
at org.openqa.selenium.remote.HttpCommandExecutor.execute(
at io.appium.java_client.remote.AppiumCommandExecutor.execute(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at io.appium.java_client.DefaultGenericMobileDriver.execute(
at io.appium.java_client.AppiumDriver.execute(
at io.appium.java_client.CommandExecutionHelper.execute(
at io.appium.java_client.HasAppStrings.getAppStringMap(
at AppiumTest.main(
Caused by: java.lang.UnsupportedOperationException: getAppStrings command is not supported
at com.perfectomobile.selenium.server.appium.GetAppStrings.mobileCall(
at com.perfectomobile.selenium.server.appium.GetAppStrings.mobileCall(
at org.openqa.selenium.remote.server.handler.WebDriverHandler.handle(
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(
at org.openqa.selenium.remote.server.PerfectoMobileSession.execute(
at org.openqa.selenium.remote.server.MobileWebDriverServlet.lambda$handle$2(
at java.util.concurrent.Executors$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

I would doubt anyone on this forum can help with this. According to the Perfecto website:

Perfecto has re-implemented the Appium server so it can deliver stronger automated testing controls, mimic real user environments, and support the unique needs of today’s Global 1000 companies.

Given that we don’t know the changes they’ve made to Appium, my best suggestion would be to contact them about this problem. If you are paying for the service they should offer support.

@wreed never say anyone :slight_smile:
@sunilkumar3996 we made in a way that we get version ourself. With android via abd command with iOS we unzip ipa and grab version from plist.

If it can work for you i can give details.

@Aleksei I stand corrected :wink:

Thanks for the suggestion @wreed. Have raised this query with Perfecto support and got reply "I have been investigating and have not found any articles from Appium that mention support for this on android past version 4.2. I am not sure that as Appium does not appear to have a function to collect this if Perfecto will be able to support it as we are using Appium API’s. The only way that I can suggest you locate this is if your application has an about section that lists the Application Version.

If you would like I can raise a feature request to see if we can support a method to collect the application version. However once again as there is no API for this that I can find with Appium the chances are unlikely that we will be able to create this.

I cannot help you with implementation of a method (i.e. getAppStringMap) that does not support an Android version over 4.2"

Reason to post this query here is, if Appium is not supporting getAppStringMap after Android version 4.2, then expected Appium API documentation would have been updated accordingly as the exception thrown is not informative. But as there is no information regarding support till android version 4.2 aynwhere in Appium site, thought of double checking the same with the group here.

Can you please help me how and where to use the method ‘getAppStringMap’ if it’s really working.

Thanks @Aleksei. Can you please review the adb command below and confirm are you referring to the same? If so, help me how to put that in Appium java-client method to get version app details as I’m not clear how to combine multiple commands and run through code after going through

“shell dumpsys package | grep versionName”.

Also, please share the code snippet for iOS to perform the same.

@sunilkumar3996 for Android same.
for iOS:

unzip -d ipa -o nameOfBuild
"/usr/libexec/PlistBuddy -c print ipa/Payload/" + nameOfBuild.replaceAll(".ipa", ".app") +
                        "/Info.plist | grep CFBundleShortVersionString"

i just execute this code in any available way of terminal (tons ways in Java: and read output.

Thanks @Aleksei for the command to unzip but for Android I need to execute adb command on device connected in Perfecto cloud and that may not be achieved running the direct java code following the suggested site. Please correct me if I’m wrong.

@sunilkumar3996 Appium allows to execute remote adb command. For iOS of course unzip and following commands will not possible remotedly

Thanks a lot @Aleksei for the quick response and answers. Have tried with Appium and failed to run arbitrary commands on cloud due to the restrictions and may be for security reasons per the support teams update.

But I would like to know the usage of getAppStringMap method on latest OS. If it’s not working I don’t see the reason to maintain it unless Appium has plans to fix in next versions or to support OS versions less than 4.2 for Android.

I guess they closed in cloud all adb commands…

Regarding iOS you may enter ticket to see