How can I resolve "adb server is out of date" error - android

I understand that this question has been asked 1000 times but every answer I can find on Stackoverflow and other websites are all the same: Either (1) The user is using Genymotion, (2) the user is using HTC Sync in Windows.
I am doing neither. I am currently running in OS/X (10.11.6) and am using a Moto X (2nd gen) phone running Android 6.0.
Many times (not every time) when I run "adb logcat", I get
adb server is out of date. killing...
* daemon started successfully *
This is a problem because I am trying to run some automated tests using gradlew (since using "adb shell am instrument" doesn't produce the JUnit style report I need) and collect logs... but every time I start "adb logcat", something in gradlew (apparently) tries to startup adb, which then kills all running instances of adb.
Has anyone seen this problem without using Genymotion/HTCSync/Windows and knows a solution?
Thanks!

The root cause of the server is out of date issue is still the same regardless the OS and/or other software used - you have multiple copies of adb binary in your system. And the solution is also the same:
kill all running adb processes
make sure you have the only copy of adb (remove the duplicates)
update it to the latest version
reconfigure all your software packages to use that copy

Just check that every tool you use is using the same adb version. For example, delete all versions except the latest.

Please check all your environmental paths which ADB has.
Your system may have several ADB.exe files so that mismatches makes the issue.

Related

adb not working, not displaying any response

when trying to run adb devices no output is shown at all not even a empty list. The terminal waits as if it is going to load, but then it just creates a new line prompt as if I hadn't given the adb command.
No no devices found is displayed or any indication that the bridge is running, literally nothing is displayed.
When trying to open the uiautomatorview I receive this error E/adb: Unable to detect adb version, adb output:
Solutions I have already tried:
checking system variables
changing the directory to run out of platform-tools directly
checked port 5037 for other processes
replacing the adb.exe
uninstalled and re installed android studios
replacing just the SDK tools and platform tools
uninstalled and reinstalled java
Please can someone help?
I've run into this problem at least a few times already, every time I just turned off and on my mac again and it started to work again. I don't know why it happens though.
And I know it's not the perfect solution, but it worked, so I just thought I'm gonna share it with the others.
By the way restarting the mac didn't solve the problem, only turning it off and on again.

"adb pull" stuck in half way

Suddenly my "adb pull" command will stuck in the middle of the process.
I'm not sure what cause it, after install some application or driver.
Happens for Pull one files or multiple files.
Does anyone encounter the same issue before? thanks.
Example:
U:\batch>adb pull /sdcard/xxxlog/mobilelog .\xxxlog\
[ 94%] /sdcard/xxxlog/mobilelog/APLog_xxx/main_log_1__xxx: 87%
Here a screenshot from my console
for my specific answer, and provide a possible answer to who encounter similar problem.
after I reinstall the whole os, testing different adb version,
the issue still remains.
during testing adb version,
I found the issue will not happens if i use Local Disk...
where issue happens when using Network Drive..
So a possible solution, is don't use Network drive
I encountered similar problem on adb server (v 1.0.40) started on Windows 7 machine. When tried to pull files from device on other machine running Linux in same local network (I used: "adb -H pull ...") the adb was freezing occasionally.
The solution was to not use Windows for ADB server.
This problem was NOT visible, when adb server was running on Linux VM (Ubuntu 16.4/ VirtualBox). Hope that this helps.
BR,
Ziggy
Every time I encounter this, it ends up being a max path length issue. Open a shell on the device using adb and review the file names within the directories that you are pulling. If any have exceedingly long names, they will silently fail and adb will hang
The thing that really throws you for a loop is that it usually fails after giving a percentage complete which makes you think it's a faulty connection or some other issue.
I haven't found a good way to recursively list out file names in shell and test their name length prior to doing the pull in order to know that the issue is going to happen, but when I have the same issue and rename long files, it ends up working on the next attempt.
I encountered the same problem when trying to transfer a large amount of data from an Android phone to a Raspberry Pi 3B+, and the logcat output seemed to reveal that adb was silently failing due to an issue with USB buffer reads (unfortunately, I don't have the exact message with me).
After the initial failure, it was possible to get another few files individually by unplugging the phone, running adb kill-server and adb start-server, and plugging it back in between each one, but the only longer-term fix I could find was restarting the Raspberry Pi. This solution, however, is not permanent, and must be repeated occasionally.
I was not able to replicate this issue on Windows or on a traditional Ubuntu system.
I encountered this problem while copying files from My Ubuntu machine to my Pixel 7.
A workaround based on this bug report, is to run
adb shell exit
in another terminal whenever it gets stuck until all files are copied. You can also run
watch -n 30 adb shell exit
to run the command every 30 seconds so you don't have to keep watching the process. I hope this helps someone.

adb shell "Bus Error" while running sqlite3 file.db

I am unable to use "sqlite3" in my Asus Zenfone 5. Its rooted device and has sqlite3 in /system/xbin.
Whenever I run as root, for "sqlite3 file.db", It shows me following error.
Bus error
Its too time consuming to move the .db file to laptop and perform operation and move back there.
Suggest something to work with it.
The issue is fixed now. It was due to two separate versions of adb installed. One through Ubuntu apt-get and one through Android SDK. I purged the apt one. All good now.
Technically: Packages were conflicting.

"Adb devices" command pops up a command prompt window and doesn't show the devices connected to the PC

Any help on this would be appreciated.
I've been researching about this adb error and the different solutions posted aren't working for me.
As the titles says, when I execute on cmd: adb devices it shows up for 1 sec a new command prompt without any information and at the end it returns to the original cmd window without any results of the device connected to my computer.
Some days ago it was working fine until some awful windows updates were installed and I began to experience this sdk problems.
Also, with this problems I've been facing it's very difficult to run Appium which is my goal right now to make some automated tests on Android devices.
PD: I've installed-reinstalled the SDK, Java, Eclipse, etc.. The
system variables are added on the PATH. I run the programs as an
admin too. SDK manager is up to date with the updates.
Thank you everyone for your help and support.
Regards.

Why does adb have a high CPU usage?

I'm using my T61 laptop to develop Android applications. Starting the debug bridge's server with adb start-server does create a process which runs at 100% CPU, see the output of ps:
stephan 19837 99.3 0.0 19952 908 pts/0 Sl 13:50 3:42 adb fork-server server
This is annoying especially since eclipse with the ADT plugin automatically starts this server (and the same problem occurs). I'm running Ubuntu Natty, but the same occurred also under Maverick and Debian sid. I'm sure that this problem did not occur after Ubuntu was freshly installed on the laptop, but started after a few days. What I noticed is also that adb fails to recognize devices that are connected to the computer while adb is running. If I restart the server with the not recognized device it is recognized after the restart. Maybe this is related?
As I said, it is installed on a T61 Laptop, using Ubuntu 11.04 Natty 64bit and 32bit with kernel 2.6.38-8-generic, but it also occurred on Ubuntu 10.10 32bit with the most recent PAE kernel, and on Linux Mint 10 64bit with the same(?) kernel version, and on aptosid 64bit with also some 2.6.38 kernel. Devices I use for testing are the G1, the Nexus (1) and a Samsung Spica. It is independent on which device is connected. My udev rules have been modified such that these devices are chmoded correctly. I have also a desktop machine with Ubuntu 10.10 64bit running, where this does not occur.
In this bug report it was claimed (a) that a kernel version change did solve this issue, that didn't work for me, and (b) a procedure requiring root access to the device. I'd like to solve this without rooting my phone, especially since this appears with multiple different phone models connected to the computer.
Edit: Please note that I don't have that laptop anymore and I couldn't solve the problem until I got rid of it. On my new computer the problem does not occur. Therefore I cannot check any solutions upon their validity and, thus, cannot mark a solution as accepted. (Should I close this question? Or what is the preferred way on StackOverflow to handle such a situation?)
Same problem on iMac 9,1 Ubuntu 10.10.
adb fork-server server keep one core of the cpu to 90-100%
No power/suspend/resume possible issue in my case.
I just started eclipse after a boot.
"Solved" with these steps:
Power off, start eclipse, plug-in device (or start emulator)
I was still facing this issue and I figured it out the it was the firefox extension that caused the issue. Get the pid of adb process by
$ps aux | grep adb
Then get the actual executable details by
$ls -l /proc/$PID/exe
You will get the adb process details. In my case the output was.
prabhat#paradise ~ $ ls -l /proc/16695/exe
lrwxrwxrwx 1 prabhat prabhat 0 Jan 24 21:02 /proc/16695/exe -> /home/prabhat/.mozilla/firefox/c05prhhc.dev-edition-default/extensions/adbhelper#mozilla.org/linux64/adb
I simply deleted the extensions folder as I am not using it currently...
I have the same problem and work around it by rebooting until ADB works correctly.
I've noticed the following may make a difference:
Plug-in your phone before starting eclipse (which in turn starts ADB).
Power down your computer and leave it off for a minute rather than just rebooting.
For me, the problem often occurs if my computer fails to return from suspend. However, this is probably just because I never reboot my laptop (apple MBP) unless that happens. I just suspend and resume. I've found that suspend/resume is fine. This does not affect ADB.
I was also the one that posted the comment in that bug report about rolling back the kernel version. However, I posted another comment further down indicating that that made no difference. I must've just been lucky that time.
One other interesting point. I also have a desktop machine that never has this ADB problem. However, I am conservative with my updates on that machine, as I don't want this problem to occur there.
I would speculate that this could be a ACPI or power saving related bug in ubuntu/debian. I never suspend my desktop machine.

Categories

Resources