Skip to content Skip to sidebar Skip to footer

Getting Android Sdk Version Of A Device From Command Line

I'm planning to build an automated system for deploying an Android build to various devices, in order to make development for multiple platforms a bit more comfortable. Is there a

Solution 1:

you can use this command:

adb shell grep ro.build.version.sdk= system/build.prop

It will output something like this:

ro.build.version.sdk=10

Solution 2:

adb shell getprop ro.build.version.sdk

Note @Tim: this works even on phones without grep support on all host OS :-). (i.e. on old phones where toolbox does not support grep you you need to have busybox on your phone).

Solution 3:

I also discovered a way to get the exact version of Android e.g. 4.2.2 based on the following web article http://xayon.net/looking-for-android-version-with-adb/ You need to be using a unix-like operating system - Linux and Mac OSX are fine, and windows users can use cygwin or equivalent.

At a command line:

echo version=$(adb shell getprop |awk -F":" '/build.version.release/ { print $2 }')|tr -d '[]'

Here is the result for my Nexus 4:

version= 4.2.2

Solution 4:

I think you can by accessing the device with adb shell - change directories to position you at system and do a cat of build.prop. Here you will find for instance, ro.build.description=google_sdk-eng 2.2, ro.build.version.release=2.2 etc

Post a Comment for "Getting Android Sdk Version Of A Device From Command Line"