I'm trying to debug why my android mobile will not boot. When I run:
adb pull / e:\temp
It freezes at
pull: /proc/kmsg -> e:\temp/proc/kmsg
Is there some way to stop it freezing here or to get 'pull' to by-pass this file.
(I'm running this command while the phone is sitting in the recovery menu as I cant get adb to run in any other state).
Samsung Galaxy GT-i5500, android 2.2, windows 7.
You can instead dump the log using
adb logcat -d > log.txt
This will provide you with the log which you can use to debug the issue.
Run-time messages can be obtained through
adb shell dmesg
For kmsg, the following command can be tried.
adb shell cat /proc/kmesg
Related
I am trying to debug a Yocto project. I have flashed cpp binaries on some device.
Now I my trying to display logs using below adb command
adb shell tail -f /var/log/acs_main.log
The problem i'm facing is that logs are not displayed continuously.I have to cancel and again start to print further log statements.
Anyone can help me in this ?
I have a strange problem after Oreo update - 'adb logcat' stopped working.
Note that device is properly connected - I can debug, I can view logs in Android Studio, even I can start adb shell and do logcat but no direct logcat out from the adb command.
So in short,
# adb logcat
Absolutely no output. However, following works (logcat from the adb shell)
# adb shell
logcat
Any idea?
try these steps (even though your logcat is open)
in android studio go to
View->Tool Windows->Logcat
see if it works
I tried to capture logcat & store into the device's internal memory. But notice that, this doesn't work intermittently. Doesn't work in the scene that, 0 bytes logcat was generated.
Command that I used, and failed intermittently.
adb shell "logcat -b main -v threadtime > /data/logcat.log &"
BUT if I stored it directly to my PC, it works perfectly.
adb shell logcat -b main -v threadtime > logcat.log &
ADB version : Android Debug Bridge version 1.0.32
Thanks.
If you are running on a commercial, non-rooted device, /data/ is not writeable. The shell runs as the shell user. That part of the flash is only writeable by root or system users. If you really want to write to the device for some reason, write to /data/local/tmp instead.
I am debugging the suspend/resume process of an android phone. I am using adb shell into the phone and doing cat /proc/kmsg to view the debug message. The problem is whenever the phone suspends, it will put the usb to sleep, which will disconnects adb and therefore kmsg will terminate. I can unplug and replug in usb and do another cat /proc/kmsg. But the important debug message will be lost.
So my question is how do I capture the kmsg while the phone is going through suspend and resume cycle?
Thank you.
I'm currently trying to debug device suspend in Android, and work around this by:
1) create a shell script that cats /proc/kmsg in background:
/sdcard/log.sh
#!/bin/sh
cat /proc/kmsg > /sdcard/kmsg.log &
2) run the script over adb:
$ adb shell
$ su
# sh /sdcard/log.sh
You can then exit out of adb, unplug the device, and it'll keep logging to /sdcard/kmsg.log. When you're ready to view the log, you can connect it to usb and pull the log. Note that I put my log in /sdcard so that it persists between reboots.
I have a simple problem.
I want to start/run a program file on an android phone using adb shell.
My Program is in /system/bin folder and has root privileges.
I want to run this program from my command prompt as adb shell runme 3000000 > logs.txt but it should not block the terminal, It should run in background.
I cannot use screen/disown/nohup for my problem as android doesn't have all this.
I tried
adb shell "runme >logs.txt &" but of no use.
When i issue command as
adb shell
# runme 3000000 > logs.txt &
It runs fine, when i exit the terminal/disconnect the device and then connect again to system.
Do adb shell ps | grep runme shows the process is still runnning in background.
Thanks
Busybox has nohup applet which works just fine in Android