FORUMS
Remove All Ads from XDA

 View Poll Results: HOWS THE GUIDE

100% BETTER THAN OTHER GUIDE'S
 
16 Vote(s)
94.12%
DIDN'T UNDERSTAND A THING
 
1 Vote(s)
5.88%
Thread Deleted Email Thread
Prev Previous Post   Next Post Next
Quote:

EXPLANATION
Quote:

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

Quote:

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 :-


Quote:

Quote:

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.


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 ..

Quote:

2) Installing android SDK:-

Download Android SDK from here...(click me !!!)

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




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 .



Quote:

Quote:

3) Android SDK Setup

Quote:

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



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.



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 .



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


Quote:

Quote:

NOW YOU WILL SEE THIS :-



Note :- To use ADB with your Android device
Quote:

Quote:

1) you must enable USB debugging on it. You’ll find this option under Developer Options on your device’s Settings screen



Quote:

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



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.

Quote:

SOME OF THE USEFULL ADB COMMANDS :-

Quote:

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

Quote:

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.

Quote:

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

Quote:

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\

Quote:

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

Quote:

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

Quote:

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

Quote:
Originally Posted by doctor_droid


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

Another tip: Some phones are very catchy when under heavy issues (like mine ) 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

The Following 150 Users Say Thank You to Powerhouse For This Useful Post: [ View ] Gift Powerhouse Ad-Free
Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes