How do I find the android SDK tools version from shell - android

I would like to get the version of the installed SDK on the computer from a shell command.
Some tools like adb and fastboot have an option to print their version, like adb version, fastboot --version, so I was expecting android version or similar, but there is none.
I don't want to launch any user interface, shell only.
Thanks

Open a command-prompt/terminal/console
Change directory to where you installed the the android sdk + tools + bin folder
then execute, sdkmanager with the --list command
Then you will get a a few lists (Installed packages, Available Packages, and Available Updates).
An osx command example :
[~/Library/Android/sdk/tools/bin] $ ./sdkmanager --list
As for fastboot --version and adb --version, both of these commands tell you what version of the executable you are running on your machine and have nothing to do with what sdks are on the machine. This is helpful in case you find a bug and wish to report an issue you find with those tools.

Related

android-sdk has been officially discontinued upstream

When installing android sdk using home-brew I get this message
android-sdk has been officially discontinued upstream.
But I can't find an alternative package to use. Is there a different one I should be using?
If you don't want the full android-studio development app (Intellij IDE, etc) and just want the new command line tools...
Per the discontinuation notice...
This SDK Tools package is deprecated and no longer receiving updates. Instead, please use the new command-line tools package.
A quick search reveals that in homebrew land, this new "command-line tools" package is called android-commandlinetools.
$ brew remove android-sdk
$ brew install --cask android-commandlinetools
If you are looking for adb and such, these are "SDK Platform Tools" and can be installed using sdkmanager (which was installed by the new android-commandlinetools package)...
$ sdkmanager --install platform-tools
Depending on where sdkmanager installs platform-tools you might need to update your $PATH or add symlinks in order to run adb and other platform-tools without an absolute path.
...or if you just want adb/etc you can skip the full commandlinetools and install platform-tools directly with homebrew. This has the side benefit of ensuring the newly installed adb is within your $PATH and is probably the best option for people that aren't doing android development and just want the latest adb, fastboot, etc.
$ brew install --cask android-platform-tools
Per https://developer.android.com/studio/releases/sdk-tools
Note: This SDK Tools package is deprecated and no longer receiving updates. Instead, please use the new command-line tools package.
check out https://developer.android.com/studio
brew install android-studio

adb server version (41) doesn't match this client (39)

im using OS ubuntu and im not using GenyMobile.
terminal
I did my digging for a while as the accepted answer did not work and landed on this solution
[I am on Ubuntu 20.04.2 LTS]
What is causing it to happen?
A clash between two different adb in the system. One in android/sdk/platform-tools and another in usr/bin
What will we do?
delete the adb located in usr/bin, then copy from platform-tools and paste in the usr/bin
Steps:
open the usr/bin in terminal as:
sudo nautilus
locate and delete adb in usr/bin
open sdk/platform-tools, copy paste adb to above usr/bin
lastly perform this in terminal:
sudo apt update && sudo apt install android-sdk
I ran into the same problem on ubuntu 20. This seems to be caused by apt installing a different version of adb than the one that Android Studio or other SDK tools download. I don't remember ever installing adb with apt. It was probably pulled in as a dependency.
My solution was similar to Kushagra's, but I used bash and had to kill the adb server to finally get rid of the error
# Print some info to verify what is going on
> lsb_release -sr
20.04
> which adb
/usr/bin/adb
> /usr/bin/adb --version
Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5ubuntu2
> ~/Android/Sdk/platform-tools/adb --version
Android Debug Bridge version 1.0.41
Version 33.0.2-8557947
> apt list --installed | grep adb
adb/focal,now 1:8.1.0+r23-5ubuntu2 amd64 [installed,automatic]
##############################################
# OK, quit horsing around and fix the problem
> adb kill-server
> sudo mv /usr/bin/adb /usr/bin/adb-1.0.39
> sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin
> adb --version
Android Debug Bridge version 1.0.41
> adb start-server
Beware of the capital 'S' in Sdk. That is where my Android Studio chipmunk installed it, but I think older versions were lower cased as sdk.
Also keep in mind that this solution overwrites the system version installed by apt. That might be unwise, and is likely temporary. If that is a problem, consider copying in the other direction instead : from /usr/lib to ~/Android/Sdk/platform-tools. Links might be wiser than making file copies.
You can be used to uninstall an app via your PC. It will solve your issue.
1. First step: select File-> Invalidate caches / Restart
2. Second step: open a command terminal and run the below command changing the package name.
3. Final step: Now run your app
replace: < com.xyz.name > with your < package name >
adb uninstall "com.xyz.name"

How to install android SDK tools without installing Android studio on ubuntu?

I was trying to install Android SDK with the help of the SDK command line tools downloaded from the link https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip on my Linux Ubuntu 16.04 PC.
i run the command following command for installation
./android update sdk
sudo ./android update sdk
but getting the this
error
how to solve this error ?or suggest me a proper way to install build tools.
FYI
and also i read that ~/.android should contain androidtool.cfg file which has below data in it.
http.proxyPort=proper_port
http.proxyHost=Proper_proxy_ip
sdkman.show.update.only=true
sdkman.ask.adb.restart=false
sdkman.force.http=true
It says that android script is deprecated, so you must use $ANDROID_HOME/tools/bin/sdkmanager --update for update all the installed packages, and $ANDROID_HOME/tools/bin/sdkmanager --list for see a list of installed, updates and available packages.
See more options at: https://developer.android.com/studio/command-line/sdkmanager.html or with $ANDROID_HOME/tools/bin/sdkmanager --help
$ANDROID_HOME refer to the location of your Android SDK. by example:
export ANDROID_HOME=$HOME/android/sdk

How to install SDK manager on linux ubuntu 16.04?

I was trying to install Android SDK with the help of the SDK command line tools downloaded from the link https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
on my Linux Ubuntu 16.04 PC.
i run the command following command for installation
./android update sdk
but the installation has stopped and gave the following message on terminal
------------------------------------------------------------------------------------------------------------------------------------
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
"android" SDK commands can be translated to sdkmanager commands on a best-effort basis.
Continue? (This prompt can be suppressed with the--use-sdk-wrapper command-line argument or by setting the USE_SDK_WRAPPER environment variable) [y/N]: y
Running /home/user/Android/Sdk/bin/sdkmanager --update
Warning: java.net.SocketException: Connection reset
Warning: Failed to download any source lists!
Done
-----------------------------------------------------------------------------------------------------------------------------------
how to solve this error.or suggest me a way to install android sdk on my linux pc without installing android studio.
A bit late, but in the same situation. It looks like this isn't an error, but the way the tools evolved: they are pushing users to use Android Studio if they want the GUI for the sdk manager, it's usable only from the IDE.
You still have the command line available at bin/sdkmanager in this folder from the download, and instructions can be found here, but they are not great, either, so I'll share what I did:
downloaded the latest compressed file from this page (link way down there)
unzipped somewhere (I chose /opt/Android/android-sdk)
created a symlink to add sdkmanager to my path (ln -s /opt/Android/android-tools/bin/sdkmanager ~/.local/bin/sdkmanager)
installed platform tools and build tools for kitkat and up using sdkmanager "platform-tools" "platforms;android-19" "build-tools;19.1.0" (sudo may be needed)
You can check the versions available using sdkmanager --list, and figure what you need to support and download tools for other versions. The download will not show any kind of progress, it'll only tell you it's done after a while.
I suppose it's not a big deal to keep Android Studio installed solely to have access to the sdk manager GUI, but I'll make do with the command line tools. That's very shady of Google, specially to people not really into their hacked up Intellij version.

Android: ADB is somehow not working (on Fedora 16)

I'm running Fedora 16 x64 with xfce desktop. Installation of Android Developer Tools (adt plugin) was successfull from Eclipse. I can even run an Emulator. It's just that adb command is not working from the Linux command line. Even if I cd to the platform-tools folder and run adb devices I get this output:
bash: adb: command not found
Eclipse also reports an error about this. By the way adb file is marked as executable. Any help would be great...
I think the problem was already addressed here:
Problem with Android SDK on Fedora 14 with Eclipse
and here
Android SDK on a 64-bit linux machine
Please let me know.
adb is located under folder platform-tools and in order to run it you have 2 options.
Option 1: Add the SDK/platform-tools folder into your shell PATH (BASH I guess)
Option 2: go under the platform-tools folder and run it using: ./adb
for instance ./adb logcat
Cheers
sudo yum install android-tools -y

Categories

Resources