Can one use adb
or adb shell
commands to get attached emulator/device OS info, i.e. API version?
Asked
Active
Viewed 1.6e+01k times
3 Answers
279
To get Android version you can use:
adb shell getprop ro.build.version.release
to get API level:
adb shell getprop ro.build.version.sdk
You can see all available properties with this command:
adb shell getprop

Mattia Maestrini
- 32,270
- 15
- 87
- 94
-
2If you have more devices attached to your machine, you will not be able to use this command by default. You need to provide ANDROID_SERIAL environment variable which identifies your device ID. This is an example: adb devices (you will get attached device IDs) ANDROID_SERIAL=DEVICE_ID adb shell getprop ro.build.version.release – Bakir Jusufbegovic Apr 21 '16 at 12:55
-
4If you have several devices connected, specify `-s ID` where ID is the device's ID from `adb devices`. For example `adb -s 1234 shell getprop ro.build.version.release ` – Ohad Schneider Jan 11 '17 at 16:14
19
I know , you already got the correct solution , & here is my solution only for additional information.
You will get every details by cat
ing the /system/build.prop
file like
adb shell cat /system/build.prop

SebMa
- 4,037
- 29
- 39

Don Chakkappan
- 7,397
- 5
- 44
- 59
-
4I had to use this `adb shell cat system/build.prop`. `cd`ing didn't work for me. – Tomáš Hübelbauer Nov 01 '16 at 09:06
-
2Now it is adb shell cat /system/build.prop. But this will not work for user device. It will work only for rooted device. – AndroDev Aug 03 '17 at 07:16