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

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

Related

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 do I find the android SDK tools version from shell

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.

Android : Adb permission denied

I am using ubuntu 13.04 I have just set up eclipse and android sdk. But whenever i try to run program or even if I am switching DDMS perspective it shows me permission denied error.
How to tackle this issue.
#Manoj,
Try running following
cd /home/manoj/....../platform-tools
adb version
If you get a Permission denied error then
chmod 770 adb
adb version
you should get a response like "Android Debug Bridge Version x.x.xx"
If so the source of your problem was file permission and set the file permission appropriately
Also check if the $PATH includes the path to /home/manoj/....../platform-tools.
Disclaimer: I use Ubuntu 12.04 and adb at command prompt for my work. I hardly use eclipse for my current work.
Let us know your results
Good luck
Another issue might be adb's file permissions themselves, make sure the user you are using to run eclipse is the same as who owns the adb files. Also make sure that adb is actually executable. (These are both unlikely issues, but worth checking if the other solutions given don't fix it)
From the home directory, try 'adb' in terminal:
If 'adb' doesn't find the adb tool, then your path needs adjusted. (edit .bashrc with bash commands to append to the path the /tools directory of the android sdk, is probably the easiest way, then log out and back in to apply the settings)
If 'adb' says it needs root permission, then try 'sudo adb' and see if that works. (this shouldn't happen, but worth testing)
I'm not actually sure what it says for 'non executable' in 13.04, but it should be self explanatory.
I have solved this problem through following steps:
1. copy & unzip eclipse to /opt/android/android-sdk-linux/
2. x86= sudo apt-get install libgl1-mesa-dev
x64(Ubuntu 13.04 and earlier)= sudo apt-get install ia32-libs
x64(Ubuntu 13.10 and above)= sudo apt-get install libgl1-mesa-dev:i386
I use ubuntu 14 and on this version listed packages have multiple dependencies, so if you could not install this package use apt-get -f install (without package) . this statement install dependencies.
3. sudo gedit /etc/environment
:/opt/android/android-sdk-linux/tools
:/opt/android/android-sdk-linux/platform-tools
the same happened for me when i used adb version it showed adb server not installed ,and it showed how to fix it ,and now works fine ,install the adb server using the following code .
The program 'adb' is currently not installed. You can install it by typing:
sudo apt-get install android-tools-adb

Linux: start Android SDK or Android Emulator

I'm using Linux (fedora 16). I try to install Android SDK and ADT. Each time I want to run Android SDK or Android Emulator, I must run from Eclipse, but I don't know how run directly. (don't need to open Eclipse)
In Windows, in AndroidSDK folder has file exe so you can run directly such as AVD Manager.exe or SDK Manager.exe but not in Linux.
Please help me about this issue.
Thanks :)
You can launch android SDK manager by simply moving to android-sdk/tools folder and using the following command:
./android &
To launch the emulator, from the same folder you need to execute the following command:
./emulator -avd youravdname
It's better to store Android SDK in /opt/ and just run:
$ sudo /opt/android-sdk-linux/tools/android
You can add & at end to run it as background process.
try using the following commands , this should work if you have installed the sdk correctly
Open a terminal
su
input your password
cd Android/SDK/tools (enter)
./emulator -noaudio #android_dev

When launching ddms from the cli OS X (10.7.3) I get an error: "Failed to get the adb version...."

When launching DDMS from the command line in Lion (10.7.3) I get the following error:
E/adb: Failed to get the adb version: Cannot run program "/Users/stevieo/android-sdk-macosx/tools/adb": error=2, No such file or directory
This makes sense to me because adb is actually in: /Users/stevieo/android-sdks/platform-tools
How can I modify this path so that ddms will launch on my system?
I have looked into the ddms file itself, but cannot decipher its intent.
One note, I do NOT have this issue on Snow Leopard (10.6.8)....
TIA for any thoughts or assistance.
Regards,
Steve O'Sullivan
If you look into your tools directory where you launched ddms, you will see the adb_has_moved.txt which says:
The adb tool has moved to platform-tools/
If you don't see this directory in your SDK,
launch the SDK and AVD Manager (execute the android tool)
and install "Android SDK Platform-tools"
Please also update your PATH environment variable to
include the platform-tools/ directory, so you can
execute adb from any location.
To solve this, I would change your ~/.bash_profile to have a line like:
# --- add Android platform-tools directory
PATH=~/android-sdks/platform-tools:$PATH
export PATH
Make sure to open up a new Terminal window so it will reload ~/.bash_profile
Note that a possible reason why it is working on your 10.6.8 installation is that you may have an older version of the Android SDK, where adb was in still in the tools directory.
If you are trying from eclipse,
Please make sure to create a adb link in /usr/bin/ directory which should solve the problem:
Ex: ln -s /Users//android-sdks/platform-tools/adb /usr/bin/adb
Note: logging as sudo/root may be required

Categories

Resources