[WIN][TUTORIAL]HOW TO USE ADB,DDMS AND TAKE A LOGCAT {pictorial explanation}

HOWS THE GUIDE

  • 100% BETTER THAN OTHER GUIDE'S

    Votes: 16 94.1%
  • DIDN'T UNDERSTAND A THING

    Votes: 1 5.9%

  • Total voters
    17
  • Poll closed .
Search This thread

mattoaida

Senior Member
Dec 17, 2012
240
28
I really want to help out devs by getting log cats but Microsoft Xp is a pain. Should I just change the os of my computer

Sent from my SGH-T959V using xda app-developers app
 
  • Like
Reactions: Anil kaushik

mattoaida

Senior Member
Dec 17, 2012
240
28
fix windows xp

ok i have found a fix for shift + right click on windows xp follow this tutorial on youtube. if you have question reply to me not on youtube its not my video.

http://www.youtube.com/watch?v=OUHZgVBmTk4

but now i am stuck when i type adb logcat > logcat.txt it just says - waiting for device -

help????
 
Last edited:

leo9891

Senior Member
Jan 12, 2012
142
29
Deltona
Thanks for this guide! Been flashing files on android for some time now but never really got into ADB. The only reason I decided to check out ADB was because of a soft brick. ADB was the ONLY way I was able to fix it! Tried everything else and nothing! Due to this I might start playing around with ADB and see what I can do.
 

Powerhouse

Senior Member
Mar 31, 2013
797
2,019
Thanks for this guide! Been flashing files on android for some time now but never really got into ADB. The only reason I decided to check out ADB was because of a soft brick. ADB was the ONLY way I was able to fix it! Tried everything else and nothing! Due to this I might start playing around with ADB and see what I can do.

Good Luck ;)

Thank you,
P.007
 

mrjraider

Senior Member
Jul 1, 2012
4,402
2,247
OP:
This guide has helped me a lot. I do know some basic commands for ADB but this guide is amazing and very detaild. Thanks a lot :)
 
  • Like
Reactions: Powerhouse

Chiefho70

Senior Member
Sep 19, 2009
87
15
downloaduf.png




HOW TO USE ADB , DDMS & TAKING AN LOGCAT ..etc




WHAT IS ADB???​


SETTING UP ADB :-




My device shows but it says it is unauthorized

---------- Post added at 09:49 AM ---------- Previous post was at 09:18 AM ----------

My device shows but it says it is unauthorized

never mind i got it i missed the authorization on the phone
 
  • Like
Reactions: Powerhouse

annur

Member
Mar 26, 2010
23
1
suroboyo
a picture = 1000 character

:D
and they say a picture worth a thousand worth
well i guess they're right with this one.
sometime I get easyly lost in the text, when all i'm trying to do is setting up adb in a fresh install PC
thank's
 
  • Like
Reactions: Powerhouse

Blackphantom

Senior Member
Feb 21, 2011
57
17
Hello Guys :)

Im really having trouble with taking a LogCat. I created my own Rom and i get BootLoops. I tried to take a LogCat at the boot but it didnt work. I always get Empty Logcat.txt files. I even tried to take a LogCat of a WORKING ROM, but the same, i always get empty files. I tried to disintall and reinstall everything like OP showed in this guide, but it didnt change anything. Every Help is appreciated. I tried both, taking a logcat with CMD and taking a logcat with DDMS

Greetz Blackphantom
 
Last edited:

Powerhouse

Senior Member
Mar 31, 2013
797
2,019
Hello Guys :)

Im really having trouble with taking a LogCat. I created my own Rom and i get BootLoops. I tried to take a LogCat at the boot but it didnt work. I always get Empty Logcat.txt files. I even tried to take a LogCat of a WORKING ROM, but the same, i always get empty files. I tried to disintall and reinstall everything like OP showed in this guide, but it didnt change anything. Every Help is appreciated. I tried both, taking a logcat with CMD and taking a logcat with DDMS

Greetz Blackphantom

1)Which versiin of windows is your Workstation running on .. ??
2) whice Device ??
3) which version of Android is it runnin' ... ??
4) Are drivers installed on your PC ??
 

El_Dark

Senior Member
Dec 13, 2012
416
216
39
Santiago
can make a guide for Wireless ADB?

that's easy peasy!

Steps:
1. Have a rooted device with USB debugging enabled
2. Install Wireless ADB from the play store
3. Activate it with Teh Buttonz!!!
4. In your computer, open a command line (cmd.exe for windows), go to ADB's directory and type:
Code:
adb connect 192.168.0.3:5555
Keep in mind that the port (the :5555 part) is optional, the 5555 is the default one, usually you don't need to change it, unless you're using it ;)
5. ?????????
6. Remote ADB!!!

Yes I am 100% sure, even read that article and can someone else running windows xp try shift right click

Sent from my SGH-T959V using xda app-developers app

you can also try opening the Run windows that used to be in the main menu by using the combination [Windows Key]+[R] on your keyboard...
People launching the Run window in 3... 2... 1... lol xD :cyclops:


ok i have found a fix for shift + right click on windows xp follow this tutorial on youtube. if you have question reply to me not on youtube its not my video.

http://www.youtube.com/watch?v=OUHZgVBmTk4

but now i am stuck when i type adb logcat > logcat.txt it just says - waiting for device -

help????

Try reinstalling drivers, that usually helps ;)

Hello :)

Windows 7 64x Ultimate
Samsung Galaxy S4 I9505
4.2.2
Yes all Drivers installed and Up to Date

Greetz Blackphantom

Since you're building a ROM.... Are you really sure you aren't disabling /dev/log/main or any /dev/log devices? :eek::eek::eek::silly::silly:
 
  • Like
Reactions: MrxSiN

Powerhouse

Senior Member
Mar 31, 2013
797
2,019
WIRELESS ADB

1. ROOT IS NECESSARY !!
2. Enable USB debugging.
3. Install Wireless ADB from the play store
4. Activate it .
5. In your computer, open a command line (cmd.exe for windows), go to ADB's directory and type:
Code:
adb connect 192.168.0.3:5555
Keep in mind that the port (the :5555 part) is optional, the 5555 is the default one, usually you don't need to change it, unless you're using it ;)
6. That's it ..!!

credits: @El_Dark


FAQ TO BE ADDED SOON .....
 

Top Liked Posts

  • There are no posts matching your filters.
  • 149
    downloaduf.png




    HOW TO USE ADB , DDMS & TAKING AN LOGCAT ..etc




    WHAT IS ADB???​

    EXPLANATION
    Whenever you create an android app or when you develop an Rom , it is important that you must deliver GOOD QUALITY APP or ROM , that are rid of Bugs ..Eventually you might come across a situation when your APP or ROM isn't working or it is bricking the device or some things are not working .These situation can be tackled only with a proper debugging tools ..So ADB ( android debug bridge) is a powerful Debugging tool and a tool which allows us to step through each line of code and examine the value of each variable.It offers us some of the powerful tools ..Debugging is not a big deal for the people who come from a JAVA programming background .Dalvik VM in android supports java debug wire protocol to attach to the device over ADB
    ADB​
    ADB or ANDROID DEBUG BRIDGE is a command-line utility that is often used to communicate over the debug channel with a connected phone or virtual device (emulator). ADB can control your device over USB from a computer, copy files back and forth, install and uninstall apps, run shell commands, and more...

    SETTING UP ADB :-

    1) Install Java JDK :-
    Before installing the Android SDK, you’ll have to install Oracle’s Java development kit. You can download it from here...(click me !!)

    Even if you already have the Java runtime (JRE) installed, you’ll need to install the JDK as well.

    16946971.png

    After installing Java JDK , you can now download the Android SDK from Google .
    NOTE:- If you see a any type of Java-related error during installation, then download and install the x86 version of the JDK, not the x64 one ..

    2) Installing android SDK:-
    Download Android SDK from here...(click me !!!)
    capturejkkf.png

    After clicking on "DOWNLOAD FOR OTHER PLATFORMS" , you will get an extended menu ..

    24497431.png



    After downloading the .exe file , then Double click on the .exe file and install it in C:\ Drive or on whichever drive you wanna install .


    3) Android SDK Setup
    Once the Android SDK is downloaded and installed, launch the SDK Manager application from your Start menu.

    91574699.png


    Enable the Android SDK tools and SDK Platform-tools checkbox and click the Install button. This downloads and installs the platform-tools package, which contains ADB and other utilities.

    12533570.png


    After installing these packages , Go to the place where you installed ANDROID SDK . IN MY CASE , IT IS :-
    Code:
    C:\Program files(x86)l\Android\android-sdk\platform-tools
    If you used a different install location, you’ll find ADB in the platform-tools directory,inside your ANDROID-SDK directory .

    70236923.png


    Browse to platform tools and hold Shift and right-click inside it, and select Open command window here...

    53646320.png

    NOW YOU WILL SEE THIS :-

    mokb.png


    Note :- To use ADB with your Android device
    1) you must enable USB debugging on it. You’ll find this option under Developer Options on your device’s Settings screen

    uplploglo.png


    2)You must install your device drivers :- Individual OEM USB drivers for windows are available for each manufacturer and are listed in the official document ..
    After you have downloaded you device drivers, then we have to install on our pc. for that :-

    a) connect the device to the computer
    b) right click on MY COMPUTER and click manage
    c) go to devices > other devices and right click on device and select update driver software.
    d) you should see an option to " BROWSE MY COMPUTER FOR DRIVER SOFTWARE" , which you nedd to click on and point to the location of your device driver installation file..​


    To test whether ADB is working properly, connect your Android device to your computer using a USB cable and run the following command:
    Code:
    adb devices
    Now it will show the devices connected

    15428363.png


    Now you have sucessfully installed ADB and now we are good to go further..

    WHAT IS A LOGCAT :-

    Logcat is the command to view the internal logs of the Android system. Viewing logs is often the best way to diagnose a problem, and is required for many issues. This way you'll find out what apps are doing in the background without you noticing.


    TAKING AN LOGCAT :-

    Now type this in the terminal
    Code:
    adb logcat -v long > logcat.txt

    or

    Code:
    Code:
    adb logcat > logcat.txt

    you shall have a log file called name of logcat.txt inside your ADB folder.

    SOME OF THE USEFULL ADB COMMANDS :-

    Code:
    adb install C:\package.apk
    – Installs the package located at C:\package.apk on your computer on your device.
    EG -adb install G:\xda.apk

    Code:
    adb uninstall package.name
    – Uninstalls the package with package.name from your device.
    EG :- you’d use the name com.quoordy.xdadevelopers to uninstall the Xda developers app.

    Code:
    adb push C:\file /sdcard/file
    – Pushes a file from your computer to your device. the command here pushes the file located at C:\file on your computer to /sdcard/file on your device .
    EG :-adb push G:\system\framework\framework-res.apk /system/framework

    Code:
    adb pull /sdcard/file C:\file
    – Pulls a file from your device to your computer – works like adb push, but in reverse. EG :-adb pull /system/app G:\rom\system\app\

    Code:
    adb logcat
    – View your Android device’s log. Can be useful for debugging apps.

    Code:
    adb shell
    – Gives you an interactive Linux command-line shell on your device.

    Code:
    adb shell command
    – Runs the specified shell command on your device.

    When you guys are experimenting on a custom rom (i.e. nightlies, betas, RC's, "just cooked", etc.), it's very likely that your phone might not boot correctly, fear not and instead, try using ADB :) there are loads of guides regarding how to properly set-up your PC for using ADB, starting by the Android SDK's page itself :p lol

    Now, to do the said logcat, open a command window and do:

    C:\Users\Dark> cd \\sdk\platform-tools [Hit ENTER!]

    C:\\sdk\plarform-tools> adb.exe devices (just to make sure your computer detected your phone lol)

    C:\\sdk\plarform-tools> adb.exe logcat -v long > somefile.txt (the "-v long" part creates a nicely formatted file ;))

    That's it!! Remember to zip the file if it's too big :D

    Another tip: Some phones are very catchy when under heavy issues (like mine :eek: ) in those cases, timing is essential between rebooting and getting your log, however!!! The adb logcat command makes sure to wait for the device to get detected ;)
    63
    WIRELESS ADB

    1. ROOT IS NECESSARY !!
    2. Enable USB debugging.
    3. Install Wireless ADB from the play store
    4. Activate it .
    5. In your computer, open a command line (cmd.exe for windows), go to ADB's directory and type:
    Code:
    adb connect 192.168.0.3:5555
    Keep in mind that the port (the :5555 part) is optional, the 5555 is the default one, usually you don't need to change it, unless you're using it ;)
    6. That's it ..!!

    credits: @El_Dark


    FAQ TO BE ADDED SOON .....
    23
    DDMS

    aaaajkyg.png

    The Dalvik Debug Monitor Service (DDMS) as it is known is one of the application debugging tools that must be a part of every ANDROID app developers's toolkit..This is very very useful to the app developers.Its is a very powerful debugging tool environment and offers various unparalleled debugging features like heap information , logcat monitoring , file manager.It is available by default in ECLIPSE IDE environment or even in the ANDROID SDK.It works on top of ADB for device communication..
    DDMS can be stated as a standalone application as part of ANDROID DEVICE MONITOR.The Android Device Monitor is a standalone which can be used in case you do not use the eclipse development environment , though the integration with Eclipse is something that other IDE'S could be envious of.​

    HOW TO USE DDMS ??

    1)AS EXPLAINED IN THE ABOVE POST , INSTALL ANDROID SDK....AFTER YOU HAVE INSTALLED PLATFORM-TOOLS & SDK TOOLS..NOW GO TO ANDROID FOLDER AND OPEN TOOLS

    13973472.png


    2)NOW RUN MONITOR.bat AS ADMINISTRATOR

    11788299.png


    17764256.png


    3)NOW ANDROID DEBUG MONITOR WILL APPEAR ..

    25398314.png

    Now let's learn about its components and it's use's

    DDMS VIEW COMPONENT'S :-

    DDMS offers a set of view components , each of which show relevant information related to the connected Emulator.

    DEVICES :-

    The device panel shows the details of each process that are running in the connected device.There are various operations that can be performed from this panel.

    96258697.png


    Each of the icons present in this panel performs the functions as follow's :

    • Debug Process Icon :- It show's the state of connection of the debugger.
    • Update Heap :-Clicking on this enables Heap information for the process so that we do not have to do memory deallocation manually.
    • Dump HPROF :- Generates a Heap Dump , useful for tracing memory leaks in your app.
    • Cause GC :-Invokes the Garbage collector to collect heap data.
    • Update thread :-Show's the information about the running thread in the thread tad for selected process
    • Start Method Profiling :- Tracks the metric's related a method. It collects information like the amount of time taken to execute a method,number of calls.
    • Stop Process :-Stops the currently selected process.
    • Screen Capture :- Takes a screenshot of whatever is displayed on the screen.
    • Reset ADB :- Ast he name suggets,it resets ADB.

    82891391.png


    THREAD'S :-
    The thread tab on the right of devices view shows informatiom related to the thread for each process selected in the devices view.The information shown can described as follows.
    • ID :- A unique ID assigned to each thread dby Dalvik V,, which are only odd numbers that start from 3 .
    • Tid :-The linux thread associated with each thread , ehich matches the process ID for each main thread in a process.
    • Status :- Status of the thread in VM , out of daemons are marked with an asterix.other values can be among running?sleeping/init/starting.

    HEAP​
    :-
    the heap view show a information and statistics about memory heap .To view heap usage,follow these below steps

    1. From the devices view,select the process for heap usage which has to be examined.
    2. click on update heap
    3. From heap Tab , select Cause GC to enable collecting heap data
    Everytime you need to update your heap statistics.This will show you the amount of memory allocated to each

    67647095.png

    ALLOCATION TRACKER​
    The allocation Tracker show a real time information about allocation happening in the application over a certain period of time.To enable allocation Tracking.

    1. [*]select the process to be tracked from device panel

      [*]click on start tracking from allocation tracker tab.

      [*]perform any actions on the devices or emulator that you want to be tracked.

      [*]click on Get Allocations objects, since tracking was enabled .

      17822845.png

    NETWORK STATISTICS
    ;-
    The network tab allows you to track and optimize the amount of network data your app is using.It even allows you to tag network sockets so that you can differentiate between types of data .It will indicate the speed and amount of data received /transmitted ..

    EMULATOR CONTROL :-
    One problem with testing Android devices using an emulator or developer device is the fact that it is unable to examine the performance of the app in the reak world conditions . like call or SMS is received/sent or when a particular location is reached.To be specific the emulator Tab allows you to to emulate the following real world conditions :

    Telephony Status :- the following options are available to set the status of phones network.

    • Voice :- unregistered,home,roaming,searching,denied.
    • Data :- unregistered,home,roaming,searching,denied.
    • Speed :- Full,GSM,HSCSD,GPRS,EDGE,UMTS,HSDPA.
    • Latency :- GPRS,UMTS
    • Telephony Actions :- Telephony actions allow you to spoof the network.
    • Location Settings ;- Emulator control allows you to sppof the location

    66445302.png

    FILE EXPLORER :-​
    As the name says it lets you view the directory and file structure if the device and lso easily copy files to and from the emulator so as to enable easy data transfer in a manner similiar to ADB or ADB pull command.

    26411064.png

    SYSTEM INFORMATION :-​
    As the name says , it give's us the particular information about the GPU load , CPU load....

    52861689.png

    DDMS HAS ALSO AN INBUILT LOGCAT VIEWER :-

    012sw.png

    Happy Developing and learning :)



    CREDITS ;-
    Google inc.
    @iamareebjamal
    @Nabs Zains
    @amogh420
    @srt99
    @Maxx247
    @iamareebjamal
    @El_Dark
    @doctor_droid
    @CharsiBabu
    @lokeshsaini94
    @hellraiser
    @Zeuscluts
    @Partimus.prime
    @Lifehacker7


    if i forgot you , just PM me .. i will be very glad to add it ..
    5
    WIRELESS ADB

    1. ROOT IS NECESSARY !!
    2. Enable USB debugging.
    3. Install Wireless ADB from the play store
    4. Activate it .
    5. In your computer, open a command line (cmd.exe for windows), go to ADB's directory and type:
    Code:
    adb connect 192.168.0.3:5555
    Keep in mind that the port (the :5555 part) is optional, the 5555 is the default one, usually you don't need to change it, unless you're using it ;)
    6. That's it ..!!

    credits: @El_Dark


    FAQ TO BE ADDED SOON .....