"adb pull" stuck in half way - android

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.

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.

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

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.

running adb from command line makes the device go offline

I have a strange problem where everytime I run adb from command line (devices command or pull, or uninstall etc), the device goes offline but if I now go into DDMS in eclipse and reset ADB, it comes back online. If I am running the game from within eclipse, it runs (by which I mean my Eclipse DDMS is able to use adb just fine) but from command line, doing anything adb-related brings the device offline and the only way to bring it back online is adb reset from DDMS inside eclipse. Effectively, I cannot do anything adb-related through command line.
I have tried solutions like switch the debug option of device on and off, adb-kill-server and then start-server, android 51 rules file, and more weirder solutions like change cable, change port etc. Many of those bring the device online, but whenever I run a adb command from the terminal, poof! device is back offline.
I have been facing this for over a month now and I have done all research I could, on google and on stackoverflow but nothing have I found which could address this specific issue.
Any help is appreciated. Thanks.
The problem is that you are having two version of adb in your computer.
Remove adb.exe,AdbWinApi.dll and AdbWinUsbApi from C:/Windows and everything will be fine.

Android adb stop working

Until yesterday everything was working perfect until today that I connected my phone (just updated to Jelly Bean) and adb.exe stop working. If I execute adb.exe I can see the help but when I want to use any command it just run forever and no message is shown.
I tried with "kill-server" and "devices" and it runs forever, no message at all is displayed and I must terminate the process to close it.
I just connect the same phone to other PC that was fully functional and also adb.exe stop working. The strange thing is that adb.exe will not work any more even If I disconnect the phone and/or I connect my tablet. Adb.exe just got useless.
I was using the same phone yesterday (android 4.0), with my tablet (android 4.2) and adb.exe was working.
Adb.exe is not corrupted as I checked it MD5 and it is the same as in working pc (5787e5df1a68e7afea82d58e5f0d6549 *adb.exe).
I have Android Debug Bridge version 1.0.31 and Android SDK tools 22. I uninstalled android sdk tools and Installed again but when is near to finish it hangs because it launches adb.exe and again it will run forever.
Please any suggestion or help?
Try rebooting. Sometimes the USB drivers lock up. I work HEAVILY with ADB in my project at http://android-casual.googlecode.com and I find it to be one of three things when ADB locks up.. 1. USB drivers, or 2. adb_usb.ini needs an update, or 3. on new devices you have to "pair" them so that ADB can perform any action.
To pair, you can disconnect, reconnect and run "adb devies" to display the pairing on the device.
Not sure if you're still facing this issue, but for what it's worth I had the same kind of issue with adb.exe, and came across this post while trying to troubleshoot it. In my case, I wasn't using any physical Android devices, only the Emulator. Everything had been working fine and then suddenly adb.exe would no longer respond (couldn't get any output from any adb command - it just appeared to hang).
In the end, my issue turned out to be another application I had installed on my development machine. It was starting as a service, and was listening on the exact same port that the adb server runs on (5037), which appeared to be confusing it. Once I changed the application to use a different port, adb started working again and everything was fine.
Run command
where adb
I had such kind of situation.
In my case
where adb
gave output
C:\Windows\adb.exe
D:\AndroidSDK\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe
I tried to run adb from disk C, when Eclipse used second adb from AndroidSDK (from disk D).
I removed adb from strange path C:\Windows\adb.exe, and this solved this problem.
I got the same problem,my solution is going to cmd and paste adb.exe path,and then click enter button.For example
D:\Android\Android\platform-tools\adb.exe

Where does Android store shutdown logs?

I know that the boot up log can be obtained by pulling out contents of kmsg or dmesg through ADB.
But I'm not aware of how to retrieve the shutdown logs in Android as there's no /var folder in Android (place where most desktop linux distros generally store their shutdown logs).
So how can I obtain the shutdown logs in Android?
Look in some locations such as these:
/proc/last_kmsg
/data/tombstones/
/data/dontpanic/
/data/system/dropbox/
(This list isn't strictly kernel logs, including framework and application logs too, which are also sometimes of interest)
One work around I found for collecting shutdown logs in Android is to run adb pull /proc/kmsg C:\Logs.txt on the host PC and then switch off the device. You will get the logs till the USB communication between the host and the device snaps! I know this is only one case out of the numerous shutdown scenarios but I haven't found satisfactory answers for other cases!
TL;DR:
Run command through adb that copies logcat and proc/kmsg to a file and keep it running even when adb disconnects with nohup, disown or setsid. Probably needs busybox, needs root and adb root, too.
setsid cat proc/kmsg > /sdcard/kmsg.txt &
and
logcat -v long -f /sdcard/logcat.txt (somehow only works without setsid)
Or add normal copy commands to some startup script.
/TL;DR
You can constantly copy proc/kmsg and logcat to a file on your android device or a microSD card to get the logs even after adb disconnects.
You need root access and adb root access for this to work. For the latter, use the setting in the developer options if you have a custom rom or the adbd insecure app.
After using adb shell to get your android shell, type su to get superuser access.
Then you not only need to put an ampersand (&) after the command but also make sure that the command keeps running after adb disconnects. That is done by nohup, disown or setsid (see here for usage).
If it doesn't work because you don't have these commands, you need to install busybox.
See my question here.
See here for how to get logcat and kernel logs and print it to some file or merge it.
See developer.android.com/tools/help/logcat.html for parameters for the logcat command.
In the end you could have a command like setsid cat proc/kmsg > /sdcard/kmsg.txt & for the kernel messages.
For logcat you could have one of the following commands: logcat -v long -f /sdcard/logcat.txt or logcat -v long > /sdcard/logcat.txt
I don't know why, but sometimes it didn't work with setsid and just didn't copy continuously but stopped shortly after executing the command. In these situations, it also showed up when entering jobs, which it didn't otherwise. Then it just worked without setsid, it stayed alive after disconnecting and reconnecting. I guess you must just try when the file does keep getting larger. If someone figured out why it is behaving like it is... let me know and I'll edit the answer.
Probably adding the commands to a startup script could be a solution for some, too.
Hope this helps.
fightcookie
Newer phones do NOT use any of these locations so if you're reading this article then as of now
The kernel crash logs are now in /sys/fs/pstore instead of /proc/last_kmsg
I was looking for the same thing, and finally, I found the answer!
In android 8 all logs are located in \data\log\android_logs\... including apps and kernel logs. Kernel logs are called kmsgcat-log_timestamp_.gz
edit: Although this is a very old thread, I think the answer might be helpful.

Categories

Resources