获取设备的Andr​​oid SDK版本的命令行 [英] Getting Android SDK version of a device from command line

查看:113
本文介绍了获取设备的Andr​​oid SDK版本的命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划建立一个自动化系统部署一个Android版本到各种设备,以使开发多平台​​多一点舒适。有没有办法通过Android的壳或亚洲开发银行获得连接设备的SDK版本?

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 way to get the sdk version of a connected device through android shell or adb?

有将是哪几个测试设备连接一台电脑,我正打算写一个脚本,将获取正确的版本为每个从构建服务器的,对他们各自的设备上安装不同的APK,发射他们收集日志信息,通过一些其他的方案,其规格是跑题提供。

There will be a computer to which several test devices is connected, and I was planning to write a script which will fetch the correct build for each of those from a build-server, install the different apks on their respective devices, launch them and collect log info, to be made available through some other program whose specifications are beside the point.

的一点是,我需要知道每个设备运行安装APK正确的SDK版本,并且我希望我可以通过亚行得到这个,但我似乎无法找到一种方法来访问它短建设一个小的应用程序,与所有版本,它的唯一目的是将输出android.os.Build.VERSION.SDK或类似的地方我的剧本能读它兼容。

The point is that I need to know the sdk version each device is running to install the correct apk, and I was hoping I could get this through adb, but I can't seem to find a way to access it short of building a tiny app, compatible with all versions, whose sole purpose would be to output android.os.Build.VERSION.SDK or similar somewhere my script could read it.

推荐答案

您可以使用此命令:

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

这将输出是这样的:

It will output something like this:

ro.build.version.sdk=10

最良好的祝愿, 蒂姆·

Best wishes, Tim

这篇关于获取设备的Andr​​oid SDK版本的命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆