ADB commands to get the adb version of mobile phone


Question

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.


Answer

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.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes