Search code examples
iosmobileautomationappiumios-ui-automation

Is there any command to get app package build version number for iOS using terminal?


Is there any command to get app package build version number for iOS using terminal ?

In Android I can get the build version using adb command want to know similar way to get build version number for iOS.

For Android

adb shell dumpsys package package_name | grep versionName


Solution

  • As far as I know there is no straightforward way to achieve this similar to adb shell but there are two ways I can suggest you try out:

    1. If the app is already installed on the device using go-ios:
    • Download the binary for your OS
    • Execute ./ios apps --udid=YOUR-DEVICE-UDID
    • You will get output in JSON which you can parse, find the object for your app by bundleIdentifier and inside that JSON object you can find CFBundleShortVersionString and CFBundleVersion
    1. If you have the IPA file using fastlane get_ipa_info_plist_value
    • Install fastlane
    • Execute fastlane run get_ipa_info_plist_value
    • Provide the path to your IPA file when asked
    • Provide the key value you want to get from Info.plist: either CFBundleShortVersionString or CFBundleVersion