How to logcat for crash that causes reboot - Moto G 2015 Q&A, Help & Troubleshooting

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)

Related

"adb logcat" on Linux vs. "adb logcat" on XP

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!

[HOWTO] CM7 Captivate and ADB + Batch stuffs

Since I just got myself aquainted with ADB (doing stuff bass-ackwards, I know), I decided I'd post up a tutorial on using it with a CM7'd Captivate. The only thing I can't get ADB to do on CM7 is download mode. I'm pretty sure, since CM7 is Nexus S based, that there isn't a way to adb into download, but all other functions work.
*I'm not responsible for any damage or loss you may encounter through the use of this guide. ADB can be a dangerous thing if you poke and prod too much and have no idea what you're doing. That being said, it's quite useful.
This was done on Windows 7. If you're on a different OS, setup process will most likely differ at least a little.
First off, you can't run a program you don't have, so let's go get that
Android SDK Tools
Once that's downloaded, extract it to the root of your hard drive.
Run SDKManager
Install "Android SDK Platform-tools, Revision 5," and "Google USB Driver package, revision 4."
Now make sure that your Captivate has USB Debugging enabled (settings > applications > development) and plug it into your computer.
Hold the Windows key on your keyboard and press "R."
This should bring up the Run dialog box. Type "cmd" (no quotes, of course) into the text box, and press enter.
Now, in Command Prompt, type "path C:\android-sdk-windows\platform-tools" (remember that "C" is variable. Your system drive could be your D drive for all I know)
After that, type "adb devices." If your phone is recognized as a debugging device, it will show up there and you can skip past the driver installation (steps quoted and in RED).
If your phone wasn't listed under ADB Devices, press the Start button, and search for "Device Manager."
Run that and find your phone in the list. Right click on it and update driver software.
From here, click on "Browse My Computer for Driver Software," and click next.
You want windows to search for drivers in "C:\android-sdk-windows\extras\google\usb_driver" so set that as the path and make sure to check "include subfolders."
Once it's installed, open command prompt and navigate to C:\android-sdk-windows\platform-tools as before.
Click to expand...
Click to collapse
Type "ADB Devices." Your Captivate should now be on the list. If not, restart ADB by ending the process in Task Manager, and inputting another ADB command into Command Prompt (i.e. ADB Devices or ADB Shell)
From here on out, you should be GTG.
To my understanding, this process is pretty much the same across all ROMs, just with different drivers. CM7 is based off of Nexus S 2.3.4, and uses it's debug drivers.
PM me or post here if you feel any changes are necessary.
I decided to add a few scripts to reboot phone into download mode, reboot into recovery, and to restart ADB and check devices.
Keep in mind that DL mode seems to be out of reach via ADB on MIUI and CM7.
All you have to do, once you get ADB working properly, is plug your phone in and click on your batch file of choice.
All these do is perform the command prompt tasks listed above automatically.
Again.... I'm not responsible for any damage to your phone, you, your cat, your car, or the apple pie on the Stifflers' table.
to make things faster instead of typing the path, go to adb with your file explorer (C:\AndroidSDK\platform-tools), hold shift and right click in an open area of your explorer then press "open command window here"
I haven't gotten adb working since I moved to a MIUI ROM. I always had it working with most other custom ROMs. Appreciate any inputs on why it is so? Thanks.

[Q] LG Thrill 4G new ROM Help

I have a LG Thrill 4G. I rooted the phone using superonelick, root checker says it is rooted. Downloaded ROM Manger and flashed clockworkmod. I cannot click boot into recovery, it just restarts the phone. I have tried to reboot into recovery by pressing 3d button, down volume, and power and it boots me into the android recovery but not clockworkmod, so I can not find anyway in to download the new rom from the zip file. Has had any other people had trouble with this? I have spent over 2 days searching the internet but I cannot find any similar problems, is there anyway to get into the recovery mode to install the new ROM without it just restarting the phone?
LG Thrill 4G ClockworkMod Installation (correct method)
1) You need to have ROOT access at the least (see link below)
It will also be good to have ADB (and hence LG Thrill drivers) installed properly
http://forum.pandaapp.com/thread/2/11/20110919/4e77f603d22632913-1.html
2) Get the recovery image from here and keep it on your PC in a folder accessible by ADB.
OR (if no ADB then) directly put it on your LG Thrill SDCard root
http://forum.xda-developers.com/showthread.php?t=1257588
4) If you have ADB then follow the instructions in the first link above to push the recovery image to your phone.
OR
if no ADB then open Terminal Emulator (install it from Market) and type su and click allow if the prompt comes up
5) Now you can follow instructions in the first link (far above) again, starting from the 'dd if=...' step. But instead of rebooting you could just power off
6) Clockwork recovery should now be flashed. To enter recovery, keep the 3D button, Vol-down and Power button pressed until you see the LG logo
Thank you for getting back with me. I tried to follow these steps and when I am in the Terminal Emulator and type adb push recovery.img /data it comes back with adb: not found. I have redownloaded the recovery file that you have attached to the SD card, same error, and then I tried to copy to the phone itself and same error. I can do any of the other prompts for the emulator but nothing that has to do with the recovery file it will not work. I am guessing maybe this is the problem because if it cannot find the recovery file, I cant do much of anything else. Do you have any suggestions of why the file still cannot be found on my phone?
connect adb through tcp
Try this:
1. If you are using terminal emulator to access adb then try downloading the app called remote adb. This tool will allow you to connect your device via tcp. Take note of the ip adress and port number. Usually the default port is fine.
2. Now open sshdroid, connectbot, terminal emulator and start an ssh session with the adb shell. You must have the correct public ip and port entered in to access the adb via tcp.
3. Once you have made the ssh connection between what ever emulator you are using and remote adb, start a shell as su.
4. Type the commands mentioned earlier.
This should let you run the whole thing from within your phone.
Alternatively...
1. start remote adb on your device.
2. start a terminal or cmd prompt on your cpu.
3. cd to androidSDK\platform-tools
4. type ---> adb start-server
The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port.
Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example:
Emulator 1, console: 5554
Emulator 1, adb: 5555
Emulator 2, console: 5556
Emulator 2, adb: 5557 ...
As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.
Once the server has set up connections to all emulator instances, you can use adb commands to control and access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).
5. type --> adb forward tcp:5554 tcp:5555
5. type ---> adb devices. In response, adb prints this status information for your device. If there is no emulator/device running, adb returns no device, and you have not made a tcp connection.
6. Take note of the serial number listed. You will use it later to direct commands to device.
7. Type --> adb shell
8. Type --> su
9. Use commands from other post to achieve whatever you need.
10. once finished with shell, type --> exit twice to leave the shell
11. Finally, type --> adb server-kill
Hope that helps. Seems like you were having issues making the connection from device to adb, so that is what I focused on. If I can help anymore, just ask. We are all continually learning and the only stupid question is the one never asked.
B^)

[GUIDE] ADB Installation and how to get a logcat dump

If like me you're a complete newb, this may come in help to you - I spent a while looking around to find out exactly how I could get a logcat output, so maybe this will help speed up your progress.
1. http://developer.android.com/sdk/index.html
download and install the sdk
it may ask you to install the java sdk as well, do so
2. the SDK manager should start up automagically, if not, go through the start menu and fire it up, then select android 2.3.3 (API10) and google usb driver packages
install those packages
3. go to control panel>system>advanced system settings>environment variables and find the term 'path' under system variables and edit it
add the full path to your sdb directory (IE:
;C:\Program Files\Android\android-sdk\platform-tools;C:\Program Files\Android\android-sdk\tools)
to the end of the string in the box - it MUST be seperated from the rest of the text with a semi-colon
4. restart the computer after ok'ing your changes
5. connect the phone to the pc with the usb cable, with usb debugging enabled, but phone switched OFF
6. go to start menu on pc and type cmd in the search box, hit enter
7. type adb logcat > logfile.txt
This will output the results directly into a text file in your working directory (usually your user folder) but does not show anything in the cmd window, be sure you leave the phone attached lond enought to gather the required data before unplugging and rebooting.
Cheers to the two following posters after mine for their tips!
try
adb logcat > logfile.txt
this should create a textfile of the log in the present working directory.
Change system variable
I've seen a text file in:
C:\Program Files\Android\android-sdk\tools
that adb has moved to a different location. Here's the new location:
C:\Program Files\Android\android-sdk\platform-tools
It works for me
I wanted to debug the boot proces but it says: Waiting for device
quite right, I had a copy paste malfunction
Added output .txt command also

execute "adb tcpip <port_no>" command without using usb

NON ROOTED PHONE
I am trying to create to backup of all application in android but I don't want the users to connect to USB even for the first time.
okay let me first explain what happens when we connect our phone with USB to ADB client
0. USB Debugging mode is enabled in the phone.
1. The phone is connected to PC using a USB cord.
2. We run
Code:
adb tcpip 9999
command from cmd with ADB already installed.
The above command helps now switched the abd demon (adbd) inside the android phone to listen through TCP-IP protocol
3. now we can disconnect the phone from the PC
4. using a terminal emulator application we can now fire the commands
a)
Code:
adb connect localhost:999
b)
Code:
backup -all -f /sdcard/dev/bck.ab
now a backup pop-up will open up, you can simply click backup button.
Now we can anytime execute the command in 4.a and 4.b util the user restarts the phone or
but the problem is I wish to execute
Code:
adb tcpip 9999
without PC. Can someone suggest me how to approach this problem. From where should I start reading or there is some existing application that can do this on a non-root phone.

Categories

Resources