我想获得亚行命令的设备属性。我可以通过运行示例Android应用程序是如何不断获取这些值。我如何过希望得到利用亚行的shell命令本身,使我的生活更轻松。这里是这样,我将通过示例应用程序中获取,但我想对应的亚行命令
设备制造商 在设备硬件 在设备型号 操作系统版本(整数) 内核版本*请注意我的设备没有根,我不知道生根设备来获得这些值的:-) *
## 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
device manufacturer device hardware device model Os version(integer value) 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