adb命令获取adb版本的手机 -- adb 领域 android 相关 的问题

ADB commands to get the adb version of mobile phone


简体版||繁體版
7
vote

问题

中文

这可能听起来很愚蠢,但在阅读这个帖子(似乎完整)我仍然没有看到如何获得我的Android的"ABD版本" ,我期望的输出是这样的 Android Debug Bridge version 1.0.31 。我尝试过(基于这个答案) adb shell ,然后 adb version 我得到 /system/bin/sh: version: not found

我想知道的原因是看它是否与我在桌面中的adb版本兼容。谢谢!

更新: 虽然我看不到 adbd 版本的我的android。最后我无所谓,我可以使用最后一个版本的 adb here 。所以谢谢所有人的贡献,因为我没有得到我想要的完整性,它帮助我到达我的问题。

english

This might sound stupid, but after reading this post (which seem complete) I still dont see how to get the "abd version" of my android, the output I expect is something like this Android Debug Bridge version 1.0.31. I tried (based on this answer)adb shell and then adb version and I get /system/bin/sh: version: not found.

The reason I want to know it is to see if it is compatible with the adb version I have in my desk. Thanks!

UPDATE: Although I could not see the adbd version of my android. At the end I did not matter as I could command my phone from my desk using the last release of adb here. So thanks all anyway for their contributions, cuz although I did not get exactly what I wanted it help me to reach the a solution to my problem.

  

回答列表

10
 
vote
vote
最佳答案
 

首先,android以来,Marshmallow自达到adb二进制(客户端),而且只使用adbd(服务器),用于与桌面上的adb客户端进行通信。

简而言之,这就是通信发生的方式:

  • 您的Android设备有 adbd ,一个守护程序,该守护程序在引导过程中启动,并侦听从桌面客户端进行通信的USB默认情况下;
  • 桌面中的 adb 工具作为客户端充当客户端,并在android上向adbd发送请求,您可以运行成功遵守某些条件的adb命令。

如果存在兼容性问题,则会出现adbd折旧或桌面上的adb客户端。要查看版本,请运行:

 adb版本//检查桌面中的adb客户端版本 adb shell adbd --version //检查Android中的Adbd版本。请注意,如果在没有root访问权限的情况下执行,有些用户会报告此错误。 

你不应该担心adbd的版本,但是只有官方adb客户端是向后兼容的。

现在到您最终结束的本地问题。

您错误地执行了命令。无处是链接答案指示执行 adb shell version 。正确的程序是:

 桌面上的adb version // adb版本(客户端) adb shell //通过桌面上的adb客户端在Android设备上启动shell adb version // adb(客户端)二进制文件的版本,用于在棉花糖之前使用Android。 

由于他们打算确定Android中的adb客户端的版本,最后两个命令对您的问题没有相关性。正如我在开始时解释的那样,它是adbd(服务器)单独从Android设备的结束通信,而不是Android中的adb二进制文件。如果可用的,如果可用,则可以使用DINARID在Android中(USB-OTG,WiFi等)或同一设备,如果adbd(服务器)也在网络上侦听。

此外,当您ran adb shell version 时,它意味着:在android上启动shell并执行命令 version 。没有任何名为 version ,所以要执行,因此,您收到了错误。

 

First of all, Android since Marshmallow doesn't come with adb binary (client) anymore, but only with adbd (server), for communication with an adb client on Desktop.

In a nutshell, this is how the communication takes place:

  • your Android device has adbd, a daemon, which is started during boot process, and listens on USB by-default for communication from desktop clients;
  • your adb tool in your desktop acts as a client and sends request to adbd on your Android, and you get to run adb commands successfully subjected to fulfilment of certain conditions.

If there are compatibility concerns, they would arise if adbd is depreciated or adb client on your desktop is. To see the versions, run:

 adb version                 // to check adb client version in your desktop adb shell adbd --version    // to check adbd's version in your Android. Please note that some users reported error with this if executed without root access.  

You shouldn't be worried about adbd's version but only with adb client version in your Desktop since official adb client is backward compatible.

Now to the localized issues you ended up with.

You incorrectly executed the commands. Nowhere the linked answer instructed to execute adb shell version. The correct procedure is:

 adb version // adb version (client) on your Desktop adb shell   // launches shell on your Android device through adb client on Desktop adb version // the version of adb (client) binary that used to come with Android prior to Marshmallow.  

The last two commands have no relevancy to your question since they intend to ascertain the version of the adb client in your Android. As I explained in the beginning, it is adbd (server) alone which communicates from Android device's end, not the adb binary in the Android. That binary in Android can be used, if available, to talk to other Android devices (USB-OTG, WiFi, etc.) or to the same device if adbd (server) is listening on network too.

Also, when you ran adb shell version, it meant: launch a shell on Android and execute the command version. There is nothing named version which is to be executed, hence, you got the error.

 
 
         
         
2
 
vote

检查ADB版本的Android SDK的正确语法是

 adb版本

在shell时,发出命令

 adb 

 adb帮助

将提供版本的输出和可用的选项和amp;&参数。

您无法获取设备的adb版本,但仅在线程您已找到是合适的。

 

Correct syntax for checking ADB version of Android SDK is

adb version

When in shell, issuing command

adb

or

adb help

will give output of both version and available combinations of options && parameters.

You can not get ADB version of your device, but only properties for which answers in thread you already found is appropriate.

 
 
 
 
0
 
vote

通常无需检查手机上的 adbd 客户端版本,因为它与Android版本相关联。 IE。您可以安全地假设您在Android 5.1设备上获取 abcdefghijklmnadbd 5.1版。很久以前,没有出现巨大的新功能介绍,因此不同版本的adb客户端应该没有差异。

 

There's often no need to check the adbd client version on your phone as it's tied to the Android version. I.e. you can safely assume you get adbd version 5.1 on an Android 5.1 device. There hasn't been great new feature introduction since very long ago so different versions of ADB client should make little difference.

 
 
 
 
-1
 
vote

此处在这两种情况下为我工作的脚本,无论手机上的adbd是否默认(非根)或不安全(root):

  #!/bin/bash clear echo echo "if adb runs in user (non-root) mode:" adb shell "su -c adbd --version" echo echo "if adb runs in root mode:" adb shell "adbd --version" echo   

这不适用于ChainFire的旧&停止 adb iNecure 应用程序在手机上安装和活动:

  adbd: unrecognized option `--version' cannot bind 'tcp:5037'   

最有可能因为它适用一个非常过时的insecure adbd(最新在他的包中是来自API / SDK 21 = Android 5),它没有完全与当前桌面adb二进制文件通信。

 

here the script that works for me in both cases regardless if adbd on the phone is default (non-root) or insecure (root):

#!/bin/bash clear echo echo "if adb runs in user (non-root) mode:" adb shell "su -c adbd --version" echo echo "if adb runs in root mode:" adb shell "adbd --version" echo 

This does NOT work with Chainfire's old & discontinued adb insecure app installed and active on the phone:

adbd: unrecognized option `--version' cannot bind 'tcp:5037' 

most likely because it applies a very outdated insecure adbd (latest in his package is from api/sdk 21 = Android 5) which does not fully communicate with current Desktop adb binaries.

 
 

相关问题

7  如何使用adb更改“首选网络模式”而无需重新启动?  ( How to change preferred network mode using adb without reboot ) 
我正在尝试将手机的(cm 12,股票4.2,rooted)首选的网络模式从"gsm / wcdma" (0)更改为"WCDMA仅" (2),反之亦然(可以有其他模式也是)仅使用命令行。基于这个答案我可以使用命令将相关变化与 Settings.db 进行相关变化: adb shell su settings...

1  xiaomi m8se fastboot循环尝试安装twrp时  ( Xiaomi m8se fastboot loop when trying to install twrp ) 
在尝试安装TWRP时(Xiaomi Mi 8se的最新版本),我设法使用adb安装最新的twrp(Fastboot闪存恢复"C: Program Files(x86) minimal adb和fastboot twrp.img)。 但是,一旦我引导到TWRP,它不会将其设置为默认加载程序。 在擦除数据后,尝试在此处...

13  如何使用“adb pull”拉出较新的文件? (Android SDK实用程序)  ( How to pull only newer files with adb pull android sdk utility ) 
使用命令"adb pull / sdcard /" 我可以将我的Android手机内部内存的所有内容复制到我当前的本地目录(和"adb pull / mnt / extsdcard / extsdcard /" 与外部SD相同卡片)。但该命令总是复制一切,即使是我已经本地存储的文件也是如此。 是否有任何方法可以复制新...

49  有没有办法让我以root身份运行adb shell而无需打字“su”?  ( Is there a way for me to run adb shell as root without typing in su ) 
有没有办法让我以root身份运行adb shell而无需键入 su ?我希望能够在没有进入shell的情况下获得root访问权限。 ...

0  在Amazon 4K Fire TV Stick上启动循环  ( Boot looping on amazon 4k fire tv stick ) 
我正在使用我的亚马逊4k火电视。 昨天,我不得不将遥控器搭配在我们家中的另一个棍子(因为有人忘记自己的偏远),从那时起,棍子已经用橙色亚马逊字体启动了白色背景,称'火灾电视'。同样,我不确定如何在设备上安装Google Play可能也导致了技术难度,其中一些在网络上声称。 我已经联系过亚马逊,让我走到几个顾问,所...

1  我用odin闪现回收力,为什么我的手机启动弓?  ( I flashed recoveries with odin why doesnt my phone boot bow ) 
三星S3 Android手机,没有植根,库存固件。 按时间顺序排列: 我打开了USB调试,虽然无法使用FastBoot。 我用odin来闪现多次恢复,但我不认为我成功了,我相信手机必须先扎根。我下载了一些reposties作为.tar.md5,但我也下载了.img,我试图将它变成了.gz - 在那个阶段我的手机仍然...

3  我的nexus 4上的adb问题(未经授权的电话)  ( Problem with adb on my nexus 4 unauthorized phone ) 
在CMD中运行adb设备时,它表示我的手机未经授权。似乎它与RSA指纹提示有关。我不记得曾经得到这样的提示。是的,我在PTP模式下运行,并启用调试。我尝试过多个小时的互联网尝试: 启用/禁用调试模式反复 卸载并重新安装我的手机或adb 的驱动程序 adb-killserver 和 adb-startserver...

3  adb shell命令可以测试mls / spc代码? [关闭]  ( Adb shell command that can test mls spc codes ) 
这个问题不太可能帮助任何未来的访客;它仅与小地理区域,特定时刻及时的特定时刻或非常狭窄的情况,这些情况通常不适用于互联网的全球观众。有关帮助提出这个问题更广泛适用,请访问帮助中心。 ...

3  可以在笔册(ofrooted)上使用“adb remount”?  ( Can adb remount be used on a stock phone unrooted ) 
是否可以使用 adb remount 使用标准固件,而无需根根设备?如果没有,是否有另一种方法可以强制系统制作/系统在没有根根的情况下写入? ...

0  强制使用Android平板电脑从PC连接到WiFi  ( Forcing an android tablet to connect to a wifi from pc ) 
遍之前,我有一个平板电脑(Coby Kyros Mid9742),当屏幕戒烟时(触摸屏的一半不识别触摸,在2个部分中分开)。 我试图通过HDMI电缆将平板电脑作为视频播放器用于投影仪,我的旧电话(Galaxy S,No Stuity)作为遥控器。我已经使用第三方应用程序效果了。 但主要问题是将平板电脑连接到WiFi使...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有