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%
Post Reply Email Thread
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
31st May 2013, 12:39 PM |#2  
Powerhouse's Avatar
OP Senior Member
Thanks Meter: 2,042
 
More
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 .....
The Following 64 Users Say Thank You to Powerhouse For This Useful Post: [ View ] Gift Powerhouse Ad-Free
31st May 2013, 01:19 PM |#3  
-NickHalden-'s Avatar
Senior Member
Flag Gotham
Thanks Meter: 2,078
 
Donate to Me
More
nice one added to Guide Ride
The Following 4 Users Say Thank You to -NickHalden- For This Useful Post: [ View ] Gift -NickHalden- Ad-Free
1st June 2013, 10:52 PM |#4  
FAdrums's Avatar
Senior Member
Thanks Meter: 908
 
More
Excellent guide!
The Following User Says Thank You to FAdrums For This Useful Post: [ View ] Gift FAdrums Ad-Free
2nd June 2013, 01:59 AM |#5  
hepi_hape's Avatar
Senior Member
Thanks Meter: 92
 
More
COOL finnaly i found some tutorial
thx
The Following User Says Thank You to hepi_hape For This Useful Post: [ View ] Gift hepi_hape Ad-Free
2nd June 2013, 04:41 AM |#6  
sgt. meow's Avatar
Senior Member
Flag Dhaka
Thanks Meter: 3,014
 
More
Nice guide. But you may wanna fix the problem.txt bit in the logcat part. It should be logcat.txt.
The Following User Says Thank You to sgt. meow For This Useful Post: [ View ] Gift sgt. meow Ad-Free
2nd June 2013, 07:32 AM |#7  
Orical's Avatar
Senior Member
Flag Boston
Thanks Meter: 748
 
Donate to Me
More
That's weird I posted a reply but it didn't actually post it on the forums, this should help a lot of new comers that have never really had a tut that explain ADB , even the more advanced users miss simple things.

Sent from my SGH-M919 using Tapatalk 4 Beta
The Following User Says Thank You to Orical For This Useful Post: [ View ] Gift Orical Ad-Free
2nd June 2013, 05:38 PM |#9  
ravvio's Avatar
Senior Member
Thanks Meter: 45
 
More
My device doesnt show up in the list....i do flashing on this system and everything else
Attached Thumbnails
Click image for larger version

Name:	ADB Device No Go.jpg
Views:	1541
Size:	47.4 KB
ID:	2011906  
The Following User Says Thank You to ravvio For This Useful Post: [ View ] Gift ravvio Ad-Free
2nd June 2013, 07:09 PM |#10  
Senior Member
Thanks Meter: 3,495
 
More
Excellent guide. thank you. I was always under the impression that eclispe needs to be install to get ddms coz I saw ddms when I installed eclipse 2 yrs back. Good to know we can do it without eclispe.
Thanks alot.
The Following User Says Thank You to macs18max For This Useful Post: [ View ] Gift macs18max Ad-Free
Post Reply 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