when I type whereis adb, it says this
/usr/bin/adb /usr/share/man/man1/adb.1.gz
but when i type echo $ANDROID_HOME, it says this
usr/lib/android-sdk/
... how to resolve this conflict? I believe it started after I installed MonoDevelop
because I have to type sudo adb kill-server and sudo adb start-server to get it to recognize certain devices, and it sometimes says adb server is out of date starting a new one and none of these are good signs. Thanks.
Related
It used to work fine, but today after I connected my Android phone to my machine, and run adb devices, I got the following error:
* daemon not running. starting it now on port 5037 *
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon: Operation timed out
How to solve this problem? (I am using a MacBook)
Try with following commands
Find port details by List Open Files lsof command.
sudo lsof -i :5037 and find PID and kill it.
kill -9 <pid here>
Example: kill -9 4363
Then start adb server. adb devices command.
Kill the Adb server and restart.
adb kill-server
adb start-server
I managed to solve this problem on MacBook by first running the following command to list the process which is using port 5037
lsof -n -i4TCP:5037 | grep LISTEN
Then, I kill it:
kill -9 <PID>
Then, adb devices works!
Android Studio Terminal
$ adb devices
List of devices attached
adb server is out of date. killing...
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error:
error:
OS Terminal
$ adb devices
List of devices attached
adb server is out of date. killing...
* daemon started successfully *
Finally test again at the IDE terminal
$ adb devices
List of devices attached
GL
it is clear that Address already in use. busybox netstat -antp to check who is using the port.
I've fixed the problem by updating the Android SDK.
android update sdk --no-ui
Additionally, I've updated the Platform Tools to the newest version.
If this doesn't work, redownload android sdk.
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz cd android-sdk-linux/tools
install all sdk packages
./android update sdk --no-ui
I tried it at the OS Terminal, worked.
Try on the OS terminal first
Running the following command at the OS bash helped solve the issue:
sudo adb start-server
I ran adb kill command and then it started working fine
adb kill-server
adb start-server
I keep having an issue with the Android Studio ADB not recognizing my devices. So far, the only solution I've found is to do a complete reboot of my entire computer, which isn't practical. I'd like to be able to restart the ADB from terminal, because I have seen other posts on here that claim it will fix the issue. However, I can't figure out where to use the commands "adb kill-server", because doing it at the base directory returns a "command not recognized". Can somebody help me figure out how to navigate into Android from terminal and use the command? Or, does anybody have another solution to the original problem of Android Studio not recognizing my devices?
Thanks in advance! Sorry for the wordiness.
blackbelt:~ blackbelt$ adb kill-server
blackbelt:~ blackbelt$ adb start-server
works on Linux as well as on Mac. In my machine, adb is in PATH
"command not recognized". Can somebody help me figure out how to
navigate into Android from terminal and use the command? Or, does
anybody have another solution to the original problem of Android
Studio not recognizing my devices?
In your case adb is not declared in PATH. You can either export the PATH, or specify the full qualified path to adb in the command line. E.g.
blackbelt:~ blackbelt$ /path/to/platform-tools/adb kill-server
blackbelt:~ blackbelt$ /path/to/platform-tools/adb start-server
or
blackbelt:~ blackbelt$ ./adb kill-server
blackbelt:~ blackbelt$ ./adb start-server
if you are inside platform-tools
Well instead of doing it through command line, if you find that hard you can also do the same from android studio.
Go to tools -> Android -> Android device monitor . Then it will open the separate window where you can see all the devices or emulator attached to the process. On the left hand side below the Devices tab there will be and menu bar, you need to click on the drop down arrow which will give you the option to reset the adb. Here is the image for reference
If you are using windows try to update the device driver for your device make sure the adb is correctly installed. When you connect your device to system see if it is allowed to be used at the system.
if adb kill-server not responding. Find the process id (PID) by typing top in terminal and finding PID next to adb. Then type kill <PID>
For example, for me PID for adb was 70163. Then i typed kill 70163
Simply stop adb:
adb kill-server
Then you can start it again any time:
adb start-server
I'm developing android apps in eclipse and I upgraded recently from Ubuntu 12.10 (Quantal Quetzal) to Ubuntu 13.04 (Raring Ringtail).
In the previous Ubuntu version I had zero problems in recognizing my android device.In this new Ubuntu version I must do:
sudo adb kill-server
and
sudo adb start-server
in order to Ubuntu recognize my android device.
Everytime I restart my computer it appears question marks in eclipse when I try to debug an app, and I have to run these command lines everytime to make it work.
Anyone knows if there is a way to recognize my phone permantelly?
adb "flakiness" is a common problem, you have the right idea to start adb with root permissions.
If you have eclipse running and run it as two separate commands, there is a chance that eclipse will have tried to startup adb as a non-root user before you have run your start-server, so I recommend running in a single command line:
sudo adb kill-server && sudo adb start-server
Also you want to make sure you have only one copy of the sdk installed and that eclipse is using the same copy as is on your path at the command line.
Possibly could throw the run-as-root logic into an init script so that when you restart the computer it comes up as root - I haven't tried this though, always just "control-r, start-ser" from the command line =)
I had the same problem and solved it by
just change the owner of adb to root and restart then in future the problem won't happen again.
use this:
sudo chown root:root -R /opt/..../sdk/platform-tools/*
sudo /opt/..../sdk/platform-tools/adb kill-server
sudo /opt/..../sdk/platform-tools/adb start-server
At the moment I'm busy with the Android SDK. I got it working, but when I entered $sudo adb shell. It gave sudo: adb: command not found. For this problem I checked this link: adb devices command not working But if I enter $sudo adb devices now. Noting happens.
Not even *daemon not running. starting it now op port 5037 * and the rest. But it looks like this:
michiel#ubuntu: ~$ sudo adb devices
michiel#ubuntu: ~$
So I can enter the next command. Someone knows how to fix that? It's the same with $sudo adb shell. Nothings comes up.
When I enter adb devices without the sudo. I get the error:
-bash: /usr/local/sbin/adb: No such file or directory.
But it's there!
echo $PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/michiel/jdk1.6.0_29/bin:home/michiel/android-sdk-linux/tools:/home/michiel/android-sdk-linux/platform-tools
Edit
When I start Eclipse now, I get the next error: Failed to get the adb version: Cannot run program"/home/michiel/android-sdk-linux/platform-tools/adb":java.io.IOException:error=2, No such file or directory.
SOLVED
Last weekend I installed a clean install of Ubuntu. I downloaded the ia32.lib and openjdk instead of java jdk and install is manually. After some struggling I managed to connect the device and now I can see it. Thx for the help :)
I also had this problem two days ago and I searched and searched so I found that my ubuntu is 64-bit and adb is not match to ubuntu 64-bit so I used the below command in terminal:
sudo apt-get update
sudo apt-get install ia32-libs
and my problem was solved
don't forget, you should export your java-version-sdk.
Try adding the following at the end of your .bashrc file (can found in your home directory):
export PATH=:/home/michiel/android-sdk-linux/platform-tools:$PATH
Now use the adb command without sudo. This solved the problem for me.
HTH!
try to kill & start the adb server
cmd
adb kill-server
adb start-server
I think you are running on the linux platform so for that running binary will be followed by .
try with sudo .adb devices
or try with sudo .adb shell
Check adb is available in your android sdk --> platform-tools. If it
available Follow these steps:
Set android vars
Initially go to your home and press Ctrl + H it will show you hidden
files now look for .bashrc file, open it with any text editor then
place the lines below at the end of file:
export ANDROID_HOME=/myPathSdk/android-sdk-linux export
PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Now Reboot the system
It Works!
I'm running Ubuntu 10.10 64 bit. I have ia32-libs installed along with Android Debug Bridge version 1.0.26.
My problem(s):
adb devices >>> ???????????? no permissions
sudo adb devices >>>> sudo: adb: command not found
adb shell >>> error: insufficient permissions for device
I guess these are all related. Here's the relevant info.
$ echo $PATH
/home/me/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/android-sdk-linux_x86/tools:/opt/android-sdk-linux_x86/platform-tools
$ which adb
/opt/android-sdk-linux_x86/platform-tools/adb
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
???????????? no permissions
$ sudo adb devices
sudo: adb: command not found
$ adb shell
error: insufficient permissions for device
I get the same results with a rooted Moto Droid running CM6.1 and a rooted G-Tab running a CM7-based ROM.
I have reviewed the following related posts:
http://forum.xda-developers.com/archive/index.php/t-522827.html
http://ubuntuforums.org/archive/index.php/t-1164359.html
adb command not found in linux environment
I tried most (not all) of the suggestions and I have not been able to resolve my issue. The things I didn't try seemed inappropriate. I would appreciate a few more tips and I'll keep troubleshooting.
One thing I didn't try was editing /etc/udev/rules.d/70-android.rules. Is that likely to be the issue? I can't see how that would cause "sudo: adb: command not found". Maybe my problems are not all related. Anyway, at this point I think I need some input from other people because I don't believe I have a path problem or the other common problems discussed in those other posts.
EDIT: SOLVED thanks to EboMike and RivieraKid. This was actually two different problems:
Item #2 above (sudo: adb: command not found) was solved by making a symlink as follows:
$ sudo ln -s /opt/android-sdk-linux_x86/platform-tools/adb /usr/local/sbin/adb
That allowed me to then do as EboMike suggested and use this solution. Doing that was required for my Moto Droid. (Running adb as sudo was not required for my Viewsonic G-Tablet, however.)
My other two items were resolved by implementing the udev rule as RivieraKid suggested (from this link).
One thing I didn't try was editing
/etc/udev/rules.d/70-android.rules. Is
that likely to be the issue?
Any particular reason why you didn't do that? To answer the question - YES! The udev rules are what informs Ubuntu what your device is and allows user-space tools to therefore access it.
You will not be able to use adb without correctly following the instructions.
With that in mind however, you don't say what version of Ubuntu you're using but I had issues with 10.10 - let me know if you need me to post the contents of my rules file.
Don't worry about running adb via sudo, you don't need it. The MODE="0666" from the udev rule allows you to access the device as any user.
EDIT:
Don't forget to reload the rules:
sudo udevadm control --reload-rules
EDIT #2:
As #Jesse Glick correctly points out, if adb is already running in daemon mode, you'll also need to restart it for this to work:
sudo adb kill-server
I've used sudo here, since that will guarantee that adb will be killed , and it's the officially supported method to stop the server. It will be automatically restarted the next time adb is used, but this time with the correct environment.
You need to restart the adb server as root. See here.
On my Gentoo/Funtoo linux system I am having similar problems:
I gotting always not the correct device description and insufficient permissions:
# sudo ./adb devices
List of devices attached
???????????? no permissions
# ./adb usb
error: insufficient permissions for device
For me helps the howto from Google.
In my case I needed to add the udev rule:
# cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
and setting up the filesystem rights
# chmod a+r /etc/udev/rules.d/51-android.rules
After replugging my smartphone the access to the phone was successful, it also appears now in Eclipse' Android Device Chooser:
# sudo ./adb devices
List of devices attached
3XXXXXXXXXXXXXC device
# sudo ./adb usb
restarting in USB mode
You also have to check the membership of your user to the plugdev-group.
Every answer I've read indicates the SUBSYSTEM=="usb". However, my (perhaps ancient) udev needed this to be changed to DRIVER=="usb". At last I can run the adb server as a non-root user... yay.
It can be instructive to look at the output of udevmonitor --env, followed by the output of
udevinfo -a -p <DEVICE_PATH_AS_REPORTED_BY-udevmonitor>
Please note that IDEs like IntelliJ IDEA tend to start their own adb-server.
Even manually killing the server and running an new instance with sudo won't help here until you make your IDE kill the server itself.
restarting the adb server as root worked for me. see:
derek#zoe:~/Downloads$ adb sideload angler-ota-mtc20f-5a1e93e9.zip
loading: 'angler-ota-mtc20f-5a1e93e9.zip'
error: insufficient permissions for device
derek#zoe:~/Downloads$ adb devices
List of devices attached
XXXXXXXXXXXXXXXX no permissions
derek#zoe:~/Downloads$ adb kill-server
derek#zoe:~/Downloads$ sudo adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
derek#zoe:~/Downloads$ adb devices
List of devices attached
XXXXXXXXXXXXXXXX sideload
I fixed this issue on my debian GNU/Linux system by overiding system rules that way :
mv /etc/udev/rules.d/51-android.rules /etc/udev/rules.d/99-android.rules
I used contents from files linked at :
http://rootzwiki.com/topic/258-udev-rules-for-any-device-no-more-starting-adb-with-sudo/
HTC One m7 running fresh Cyanogenmod 11.
Phone is connected USB and tethering my data connection.
Then I get this surprise:
cinder#ultrabook:~/temp/htc_m7/2015-11-11$ adb shell
error: insufficient permissions for device
cinder#ultrabook:~/temp/htc_m7/2015-11-11$ adb devices
List of devices attached
???????????? no permissions
SOLUTION: Turn tethering OFF on phone.
cinder#ultrabook:~/temp/htc_m7/2015-11-11$ adb devices
List of devices attached
HT36AW908858 device
I just got the same situation, Factory data reset worked well for me.