Android的ADB命令来获取设备属性

Android的ADB命令来获取设备属性

本文介绍了Android的ADB命令来获取设备属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得亚行命令的设备属性。我可以通过运行示例Android应用程序是如何不断获取这些值。我如何过希望得到利用亚行的shell命令本身,使我的生活更轻松。这里是这样,我将通过示例应用程序中获取,但我想对应的亚行命令

  1. 设备制造商
  2. 在设备硬件
  3. 在设备型号
  4. 操作系统版本(整数)
  5. 内核版本

*请注意我的设备没有根,我不知道生根设备来获得这些值的:-) *

  ## code段
进口android.os.Build;
制造商= Build.MANUFACTURER;
硬件= Build.HARDWARE;
模型= Build.MODEL;
OSVERSION = Build.VERSION.SDK_INT;
KERNELVERSION = System.getProperty(os.version);
 

不过,我可以能够得到操作系统版本。但后来我想SDK版本的整数。我想18代替4.2.2

  C:\>亚行的shell getprop ro.build.version.release
4.2.2
 

解决方案

 亚行外壳getprop ro.build.version.sdk
 

如果你想看到的参数的整个列表只需键入:

 亚行外壳getprop
 

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
解决方案
adb shell getprop ro.build.version.sdk

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

adb shell getprop

这篇关于Android的ADB命令来获取设备属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 02:00