Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ADB commands to get the device properties

Tags:

android

shell

adb

I am trying to get the device properties from ADB commands. I can how ever get those values by running sample android application. How ever I wish to get using adb shell command itself to make my life easier. Here is the way I will get through sample application but I want corresponding adb commands for

  1. device manufacturer
  2. device hardware
  3. device model
  4. Os version(integer value)
  5. Kernel version

* Please note my device is not rooted and I have no idea of rooting the device to get these values :-) *

## Code snippet import android.os.Build; manufacturer = Build.MANUFACTURER; hardware = Build.HARDWARE; model = Build.MODEL; oSVersion = Build.VERSION.SDK_INT; kernelVersion = System.getProperty("os.version"); 

However I can able to get the os version. But then I want SDK version in integer. I want 18 in place of 4.2.2

C:\>adb shell getprop ro.build.version.release 4.2.2 
like image 901
Venkatesh Avatar asked Jan 13 '14 19:01

Venkatesh


People also ask

What is the adb command to list all currently connected Android devices?

By executing the 'adb logcat' command, you can see the log data of your Android device on your computer.

What is the command to select device in adb?

Use the -s option followed by a device name to select on which device the adb command should run. The -s options should be first in line, before the command.


2 Answers

adb shell getprop ro.build.version.sdk 

If you want to see the whole list of parameters just type:

adb shell getprop 
like image 85
dmarin Avatar answered Oct 22 '22 17:10

dmarin


From Linux Terminal:

adb shell getprop | grep "model\|version.sdk\|manufacturer\|hardware\|platform\|revision\|serialno\|product.name\|brand" 

From Windows PowerShell:

adb shell  getprop | grep -e 'model' -e 'version.sdk' -e 'manufacturer' -e 'hardware' -e 'platform' -e 'revision' -e 'serialno' -e 'product.name' -e 'brand' 

Sample output for Samsung:

[gsm.version.baseband]: [G900VVRU2BOE1] [gsm.version.ril-impl]: [Samsung RIL v3.0] [net.knoxscep.version]: [2.0.1] [net.knoxsso.version]: [2.1.1] [net.knoxvpn.version]: [2.2.0] [persist.service.bdroid.version]: [4.1] [ro.board.platform]: [msm8974] [ro.boot.hardware]: [qcom] [ro.boot.serialno]: [xxxxxx] [ro.build.version.all_codenames]: [REL] [ro.build.version.codename]: [REL] [ro.build.version.incremental]: [G900VVRU2BOE1] [ro.build.version.release]: [5.0] [ro.build.version.sdk]: [21] [ro.build.version.sdl]: [2101] [ro.com.google.gmsversion]: [5.0_r2] [ro.config.timaversion]: [3.0] [ro.hardware]: [qcom] [ro.opengles.version]: [196108] [ro.product.brand]: [Verizon] [ro.product.manufacturer]: [samsung] [ro.product.model]: [SM-G900V] [ro.product.name]: [kltevzw] [ro.revision]: [14] [ro.serialno]: [e5ce97c7] 
like image 36
0x8BADF00D Avatar answered Oct 22 '22 18:10

0x8BADF00D