"adb logcat" on Linux vs. "adb logcat" on XP - G1 Android Development

I'm awaiting the upgrade like everyone else so I flashed RC29 and have my phone plugged in at home and at work with "adb logcat" running so I can get the file name if I'm one of the lucky first few to get the update.
I noticed an interesting difference that I hope someone has an answer.
At home I have Ubuntu and at work I have XP. On ubuntu logcat keeps streaming new log events from the phone to the terminal but on XP's dos cmd window logcat does not update new log events to the screen.
I'm thinking this might be due to buffering? or USB driver differences?
Is there any way to get windows to behave like Linux (at least from a adb logcat perspective)?

On Windows XP, it does keep streaming log events to the console for me

Do you have the full android SDK installed on XP or just the files for adb?

Dave RL said:
Do you have the full android SDK installed on XP or just the files for adb?
Click to expand...
Click to collapse
I am running the full SDK on VISTA and it is streaming new events.

I have also noticed that, i dont ever get the full log report, The report cuts off in the middle of a lines when command prompt window wont catch no more (i guess), and stops there. i only have the adb file in place (in win dir).
I have tried the other command, "adb status-window" and i get no stream of data at all. I do not know if that is a correct command to use for this but just want to put that out there.

Dave RL said:
Do you have the full android SDK installed on XP or just the files for adb?
Click to expand...
Click to collapse
Full SDK

Ok, I'll try installing the full SDK when I get a chance at work today and see if that makes a difference.

It sounds like it's being caused by this bug:
http://www.telesphoreo.org/pipermail/g1-hackers/2008-December/000191.html
although generally that bug only shows up in Vista. Basically whenever the adb server reads data from the phone faster than the program running on your computer can read it out (e.g. tons of logcat data), the adb server locks up. You can try doing an end-task on adb.exe to kill the server and then running a fixed version like http://lfx.org/~jperry/adb_fixed.rar , or if you don't trust Random Files By Strange People On The Internets, you can try running logcat immediately after the phone reboots (so the log will be very short, not triggering the bug) and then just leaving logcat running while you do testing.

> This is probably being caused by the bug mentioned at
> http://code.google.com/p/android/issues/detail?id=1309
> Since it doesn't look like Google is ever going to fix it, I've compiled
> a binary with that patch applied. Try using the adb binary below (or
> apply the patch from the bug report and recompile) and see if that fixes
> it. Be sure to kill the adb daemon first before trying the fix (the bug
> is in the daemon process, not the client).
>
>
Click to expand...
Click to collapse
I can confirm that this fixed the problem for me. I had to restart the G1 (brute force way to restart the daemon) and use the adb_fixed.exe binary.
Thanks aziwoqpd!

Related

ADB is not detecting my phone

Hi guys, I have been having major reboots problem with my Sensation after upgrading to the new ICS firmware. I have described my problem in this thread. The last attempt to fix my problem was flashing the firmware from this thread. I'm trying to flash other firmwares from the development section, but i keep getting the wrong model ID error. After some research, I believe I need to change my phone's CID to superCID using ADB.
And I have followed the instructions from this thread to do the superCID on my phone. Unfortunately, ADB is not detecting my phone. I installed ADB on two other Windows machines with the same result. Any help is greatly appreciated.
If you're running ADB from Linux (Ubuntu or something like it) by chance, you can run the commands as root. Put 'sudo' in front of the commands. That might fix it.
Also, try killing the server and restarting it. I don't know if this works in Windows.
Linux commands....
sudo ./adb kill-server
sudo ./adb start-server
./adb devices
Windows commands....if this even works in Windows (I've never tried using ADB in Windows so I have no idea)
Same, just take out sudo and "./"
Not sure if needed, but do you need to have HTC sync for adb to work properly?
Skipjacks said:
If you're running ADB from Linux (Ubuntu or something like it) by chance, you can run the commands as root. Put 'sudo' in front of the commands. That might fix it.
Also, try killing the server and restarting it. I don't know if this works in Windows.
Linux commands....
sudo ./adb kill-server
sudo ./adb start-server
./adb devices
Windows commands....if this even works in Windows (I've never tried using ADB in Windows so I have no idea)
Same, just take out sudo and "./"
Click to expand...
Click to collapse
Thanks for the reply buddy. I don't have any machine running Linux at the moment, but I will try killing the server in Windows.
In the mean time, can anyone help me find an older/stable firmware please? My phone have been rebooting every 2 minutes. Opens camera, reboots. Opens youtube app, reboots. Makes a call, reboots. It's driving me crazy!!
i had the same problem when i tried to flash the radio for my new ics...
so what i did was to to untick and retick the usb debugging mode and suddenly my windows 7 can automatically install some drivers in my computer... i also install htc sync too... then only my phone can be detected by my computer and i was able to flash the radio...
Thank you for the help guys. It turns out i didn't install HTC Sync. I just flashed a new firmware from the dev forum. Hopefully it will solve my nightmare.
I have come to the conclusion that the latest firmware broke all the gingerbread based rom , and so far only the 4.0.3 Sense ROM works, and not even the asop based 4.0.3 rom.
Sent from my HTC Sensation using Tapatalk

[S-Off] and Device Offline for PJ831000

This was answered a little bit in the S-Off thread and I would like to post it for everyone that has the PJ8310000 device and they are running into device "offline" when using adb devices. This is for Windows 8 only. I had the same problem in OSX, but I believe the solution is the same. I cannot post in the thread in the developer section yet, that is why this is here.
First, if you can't see your device in your device manager, make sure you have the latest HTC Device drivers installed or install the latest version of HTC Sync. This is very important for Windows 8.
Second, you will need to download and install the latest Android SDK. Just "Download From Other Platforms" and choose the appropriate SDK installation. You will need to run the SDK Manager.exe to install the latest tools. Note: ADB and Fastboot have been moved from the "tools" folder to "platform-tools".
Make sure your phone is in debugging mode by going into the Developer Options and choosing "Android debugging."
Find your SDK installation and make sure you are under "platform-tools" folder. You can ctrl-shift-right click on that folder to open a command prompt at that folder location. Saves you time.
Type in the command prompt:
Code:
adb devices
Your device should be listed and probably says Offline. This is normal. Take a look at your phone, you should get a prompt on your phone asking you if you trust the device that is trying to connect to it (this should be your computer). Allow it.
Type in the command prompt:
Code:
adb devices
This time, your device should be listed with the word "device" instead of offline.
To restart the daemon, type the following separately:
Code:
adb kill-server
adb start-server
This is the best I can do for everyone and it solved my problems with no further issues. I am not an expert and this is the only solution that has worked for me.
Thanks, this worked for me.
I did this in Windows 7 SP1 no problem. All I had to so was get the latest Android SDK and replace all the adb/fastboot files I already had and it worked no problems.
If you get permission denied when doing the last "adb shell" command, get adbd insecure from the forums here and run debugging mode insecurely from there.
Sent from my One X using xda app-developers app
Desertman123 said:
If you get permission denied when doing the last "adb shell" command, get adbd insecure from the forums here and run debugging mode insecurely from there.
Click to expand...
Click to collapse
I had this problem because SU was only allowing apps in CM10.1 (4.2.1). I found the solution by enabling the Dev Options via multiple clicks on the Build number until dev options was enabled, then changed Root access to Apps adn ADB.
FYI for anyone else that gets lost like I was.
ok so i can s-off now?
yes get some, 9 steps to s0ff
Ponarona said:
ok so i can s-off now?
Click to expand...
Click to collapse
Yes, you can use the HTC One XL link in the S-Off thread with no issues. I made this to help people with Win8 and trying to get their phones to appear properly in their device manager and to list it under adb devices.
If you get device offline, my issue, I was running android 4.2.2 but had an outdated adb. Just update adb if you still have problems
I know this is exceedingly random, but if you run a mac and can't see your device in adb, and in the past you tried sharing your phone internet with your mac via usb try running this:
sudo kextunload /System/Library/Extensions/EasyTetherUSBEthernet.kext
./adb kill-server
I need to do that before every adb session.
I'd be amazed someone actually has those conditions, but hey, it might help someone.
Sent from my HTC One X using xda app-developers app

[Q] P5113 can't write to internal storage

I have a P5113 that's been running the CM 11 nightlies just fine until a few days ago. For some unknown reason, the internal storage is stuck in read only mode which is causing applications to fail and the tablet to reboot every few minutes. I've tried using CWM recovery to do a factory reset as well as wipe cache and reformat all partitions with no effect. Have also tried to install the latest CM 11 but after reboot the older version of the image is still installed. I also cannot write or delete any files from the file system as they reappear after a reboot. I've tried to use Odin to install a factory ROM but it keeps failing and I've tried to write a PIT file to fix the partition which has also had no affect. I've tried using adb to set read/write permissions but after a reboot, the permission revert back to read only.
I would like to know if there is anything else that can be done to repartition the internal storage and reload a factory ROM so that I can start over.
Thanks
....Mike
michaelgwilson007 said:
For some unknown reason, the internal storage is stuck in read only mode
Click to expand...
Click to collapse
As you seem to know your way around: Could you try and fetch a logcat as well as the kernel dmesg output upon boot and post it for review (pastebin or similar)? If it even fails with re-flashing a Stock ROM maybe the logs give a hint about what's going on (maybe the NAND chip became corrupted leaving fsck without a possibility to fix the filesystem?).
BoneWithABeagle said:
As you seem to know your way around: Could you try and fetch a logcat as well as the kernel dmesg output upon boot and post it for review (pastebin or similar)? If it even fails with re-flashing a Stock ROM maybe the logs give a hint about what's going on (maybe the NAND chip became corrupted leaving fsck without a possibility to fix the filesystem?).
Click to expand...
Click to collapse
Thanks for the reply. I've been doing a lot of reading to work my way around. I have never reviewed the logs or know where they are but I'll see if I can figure it out. Any info on how to extract this info would be greatly appreciated.
....M
michaelgwilson007 said:
Thanks for the reply. I've been doing a lot of reading to work my way around. I have never reviewed the logs or know where they are but I'll see if I can figure it out. Any info on how to extract this info would be greatly appreciated.
....M
Click to expand...
Click to collapse
You already used "adb", so access to Settings -> Developer Options must already be enabled and "USB debugging" turned on.
Now, simply connect the tablet to the PC and open a Command Promt (or Terminal if you're on Linux). Issue a restart on the Tablet (if turned on). Once the "Galaxy Tab 2.0" kernel logo shows up issue "adb logcat >> Downloads\logcat.txt" (Windows) or "adb logcat >> Download/logcat.txt" (Linux - you may need to add a "sudo" before adb if your udev rules aren't properly set).
adb will now display "connecting" and once Android has start "adbd", should happen rather early in the boot process, it will start logging into the text file. Once the ROM has fully booted up wait for a minute, so the system settles with starting up everything, before you press CTRL+C to interrupt adb logging.
Next would be "adb shell dmesg >> Downloads\dmesg.txt" (Windows) or "adb shell dmesg >> Downloads/dmesg.txt" (Linux). That dumps the kernel output into a text file. IF you get a error here it may relate to...: 1. Your ROM is not rooted. / 2. "adb+apps" is not set in the Developer options / 3. You are running a Sammy Stock ROM where adbd has no root powers.
If you're on a Stock ROM ... Install Chainfire's adbd Insecure (you need root!), run the app, apply the patch and reboot. Now adbd behaves like in CM or OMNI (root priviledges).
You can review the text files for yourself. If you see any obvious errors that should give you a hint about what's going on. If not, then put them up for review. Though... be warned: The files contains some private data (like the MAC address of the tablet as well as some information from your WiFi). If you don't want it to be displayed to the greater public send me a PM.
BoneWithABeagle said:
You already used "adb", so access to Settings -> Developer Options must already be enabled and "USB debugging" turned on.
Now, simply connect the tablet to the PC and open a Command Promt (or Terminal if you're on Linux). Issue a restart on the Tablet (if turned on). Once the "Galaxy Tab 2.0" kernel logo shows up issue "adb logcat >> Downloads\logcat.txt" (Windows) or "adb logcat >> Download/logcat.txt" (Linux - you may need to add a "sudo" before adb if your udev rules aren't properly set).
adb will now display "connecting" and once Android has start "adbd", should happen rather early in the boot process, it will start logging into the text file. Once the ROM has fully booted up wait for a minute, so the system settles with starting up everything, before you press CTRL+C to interrupt adb logging.
Next would be "adb shell dmesg >> Downloads\dmesg.txt" (Windows) or "adb shell dmesg >> Downloads/dmesg.txt" (Linux). That dumps the kernel output into a text file. IF you get a error here it may relate to...: 1. Your ROM is not rooted. / 2. "adb+apps" is not set in the Developer options / 3. You are running a Sammy Stock ROM where adbd has no root powers.
If you're on a Stock ROM ... Install Chainfire's adbd Insecure (you need root!), run the app, apply the patch and reboot. Now adbd behaves like in CM or OMNI (root priviledges).
You can review the text files for yourself. If you see any obvious errors that should give you a hint about what's going on. If not, then put them up for review. Though... be warned: The files contains some private data (like the MAC address of the tablet as well as some information from your WiFi). If you don't want it to be displayed to the greater public send me a PM.
Click to expand...
Click to collapse
Thanks for the guidance. I'll work on getting the log files when I get home. I'm currently on CM11 with root so hopefully I'll be able to dump the kernel without too much trouble.
Once I get the files, I'll send you a PM.
.......M
Just to wrap the thread up so it won't hang around without some conclusion as we had a private exchange...
The logs showed that there's a major problem, along with some smaller ones, going on. The kernel is spamming a "command error" message, in a infinite loop at some high repetition rate, in relation to mmcblk0 to the kernel console, and logcat shows re-occurring problems with "MtpServer" which eventually crashes the "VM" (Dalvik).
Since michaelgwilson007 already attempted the "last resort" solution to flash back to Stock with a PIT for his type of SGT2 (as he said his "sdcard0" partition wasn't even there) to restore NAND partitioning and Stock firmware... the PIT goes through but he then gets a NAND write error while attempting to flash the stock firmware. Relating what the logs have to tell to what's going on the device we seem to agree that the likelyhood of the NAND chip being defective (dead flash memory cells) is very high.
Case isn't really solved, but at least we worked out a 99% probability of a hardware malfunction.
If some of the kernel dev, knowing a bit more about the low-level layer, happens to have an idea - feel free to maybe add some idea.
I sent @michaelgwilson007 a PM. You could try running an ADB command from recovery to reformat the internal storage partition. Just make sure to wait until it finishes. The instructions are in the PM.
Sent from my Nexus 4 using XDA Premium HD app
shakatu said:
I sent @michaelgwilson007 a PM. You could try running an ADB command from recovery to reformat the internal storage partition. Just make sure to wait until it finishes. The instructions are in the PM.
Sent from my Nexus 4 using XDA Premium HD app
Click to expand...
Click to collapse
Thanks for your assistance. It turns out that I had a corrupt NAND chip based on a few other tests. I replaced the motherboard and I'm good to go again.
I'm having the exact same problem, but it's not stuck, and I can certainly open apps, or run the system, can't seem to delete or rewrite or even write anything. From a brief search I came to this thread, any solution other than giving it to Samsung service for repair?
Following

USB debugging not working properly (on Ubuntu)

Hello,
I just got a new U11, hoping to use it to test/debug my Android apps. But I cannot get it connect to ADB reliably. I have tried everything I could, including
enabling developer options + USB debugging
adb kill-server, adb start-server and adb devices
revoking USB debugging authorizations
authorizing & remembering my PC
I've tried countless combinations of the above, but adb keeps showing unauthorized or offline. Very very occasionally adb shows "connected", but Android Studio freezes when I run my app. When I unplug, Android Studio immediately unfreezes. But again, when I plug my phone it becomes unauthorized/offline.
My other Android phone works without any issues. Is it a bug with the stock firmware?
The phone is running stock European firmware, with everything stock (including locked bootloader).
Could anyone please test/confirm this on their Linux laptop/desktop? Any fixes? Thanks a lot!
Strangely, it works on Windows. Maybe Ubuntu kernel update yesterday broke adb :crying:
I get my phone tomorrow and will update adb and try to connect. Have you tried starting the adb server as root?
sudo adb start-server
Sent from my XT1575 using Tapatalk
drzoo2 said:
I get my phone tomorrow and will update adb and try to connect. Have you tried starting the adb server as root?
sudo adb start-server
Click to expand...
Click to collapse
Yes, I did all adb commands after $ sudo -s
As it works without any problems on Windows, perhaps I should ask on a Linux forum?
For now I would use Windows until I found a solution
spolarbear said:
Yes, I did all adb commands after $ sudo -s
As it works without any problems on Windows, perhaps I should ask on a Linux forum?
For now I would use Windows until I found a solution
Click to expand...
Click to collapse
I have the same problem.
I have Debian in my computer (MSI GS40 6QE) and in my girlfriend's computer (Asus UX32V) . Same update state in both of them.
I'm unable to use adb or fastboot in my computer but it works correctly in my girlfriend's computer.
microcris said:
I have the same problem.
I have Debian in my computer (MSI GS40 6QE) and in my girlfriend's computer (Asus UX32V) . Same update state in both of them.
I'm unable to use adb or fastboot in my computer but it works correctly in my girlfriend's computer.
Click to expand...
Click to collapse
Haha, at least the issue is not unique to my phone (and laptop) :laugh:
I suspect Android SDK is most well tested on Windows, at least everything is already set up for you. But Linux allows you to run most dev tools in your HOME folder, so they don't mess things up.
Hopefully someone comes up with a fix.
My Xiaomi running LineageOS (basically AOSP) doesn't have any issue. Perhaps HTC Sense heavily modified some USB options?
spolarbear said:
Haha, at least the issue is not unique to my phone (and laptop) :laugh:
I suspect Android SDK is most well tested on Windows, at least everything is already set up for you. But Linux allows you to run most dev tools in your HOME folder, so they don't mess things up.
Hopefully someone comes up with a fix.
Click to expand...
Click to collapse
I have no problem with my M8 and my computer.
Android "is" Linux. By that, at least, tools like adb and fastboot must be very well tested under Linux :angel:.
Try to open you computer file browser and to browse or copy some files from/to your computer/phone. I'm unable to do that also.
I tried to root my phone in the same day I received it and I was getting really worried because I was unable to use fastboot (I by that I was thinking that my device was defective), even the simple "fastboot getvar all". Then I remembered to switch to another computer and voilĂ , everything was working perfectly.
Maybe HTC has something broken in the USB3.0 stack.
File transfer and fastboot don't work on my Ubuntu either.
spolarbear said:
File transfer and fastboot don't work on my Ubuntu either.
Click to expand...
Click to collapse
I don't know if it related with kernel (in computer side). I already tried version 4.9, 4.10 and 4.11 (the one I'm running right now).
microcris said:
I don't know if it related with kernel (in computer side). I already tried version 4.9, 4.10 and 4.11 (the one I'm running right now).
Click to expand...
Click to collapse
I tried 4.10 and 4.4, neither worked
I have same problem with Windows 10 64Bit.
All working fine here.
Sounds like udev. Have you followed the setting up usb access part of
https://source.android.com/source/initializing?
I have solved my problem. I have install Windows 10 new and now all working.
Flinny said:
All working fine here.
Sounds like udev. Have you followed the setting up usb access part of
https://source.android.com/source/initializing?
Click to expand...
Click to collapse
What Linux distro/version are you running? I've been trying to get this working with Arch and it's driving me nuts!
I run various flavours of Debian and Ubuntu across my machines and have ADB working on them all..
Flinny said:
All working fine here.
Sounds like udev. Have you followed the setting up usb access part of
https://source.android.com/source/initializing?
Click to expand...
Click to collapse
Flinny said:
I run various flavours of Debian and Ubuntu across my machines and have ADB working on them all..
Click to expand...
Click to collapse
Got it working by downloading adb straight from Google instead of using the Arch package.

How to logcat for crash that causes reboot

Enable ADB (USB debugging) in phone settings.
Connect your phone to your computer via USB.
Make sure you have ADB on your computer (part of the Android SDK, though you can find stripped down versions available for Windows, and it's also often available with Linux distribution package managrs).
When you try to access your phone through ADB, it will prompt you for authorization on the phone.
Once ADB is authorized, you run the command "adb logcat" to capture a log.
1) Run "adb logcat -c" to clear out old logs
2) Run "adb logcat >gpscrash.txt" to capture a log and save the output to a file. It will keep capturing a log till you stop it.
3) Launch maps or whatever it is that triggers your crash. Let it run till you have a crash.
4)Once the crash happens, press Ctrl-C on your computer to stop capturing the log.
(credit squid2)

Categories

Resources