Android/adb

ADB stands for Article description::Android Debug Bridge, and it is a part of the Android Software Development Kit (SDK). It can be installed with.

Install ADB and Fastboot
Fastboot is included with ADB inside the package::

Enable USB debugging
Enable the USB Debugging option on the Android device under Settings > Developer options.

For Android 4.2 and later, Developer options is hidden by default; use the following stepsː


 * 1) On the device, go to Settings > About.
 * 2) Tap the Build number seven times to make Settings > Developer options available enable.
 * 3) Go back to system settings and scroll down to bottom > Developer Options.
 * 4) Now hit Enable USB-Debugging.

Tips: You might also want to enable the Stay awake option, to prevent Device from sleeping while plugged into the USB port.

Detect devices
If the device is listed then connect to the android devices shell (the first time an authorized request on the device must be accepted when typing adb shell):

To run adb without root privileges then the unprivileged user account must be added to the plugdev group:

Multiple devices connected
When multiple devices are connected to the PC then the  option will be needed to specify which device. If the device has not been specified, an error message message similar to the following will appearː

error: more than one device/emulator

Set TCP port
To use adb over a WiFi connection instead of using the cable, type the below command with the USB plugged in first timeː

Print IP address
To get the IP of the connected Android device (cabled connection):

Connect
Once the IP address is known, use it to connect to the device:

Now control the device as usual via.

Kill ADB daemon
Sometimes it may be necessary to kill adb if the device is not showing up connect. This can occur when adb is running before connecting the device. In this case kill and restart the adb server:

System reboot
The device can be rebooted from adb:

Push all files in a folder
Files from the directory will be transferred into storage/on/device. Notice the trailing slash on the directory name is specifiied in the command:

Pull all files in a folder
Notice the trailing slash after the directory name:

Exampleː Print IMEI via a call service
Convert the output to a readable formatː

Print IMEI 1 & 2 via a call service if you have two sim cards
Imei 1:

Imei 2:

Uninstall a package
Exampleː

Tip: Uninstalling several packages at once can be achieved by a loop:

Dumpsys
A tool that runs on Android devices and provides information about system services. To get a diagnostic output for all system services for the connected device, simply run. However, this outputs far more information than typically needed. For more manageable output, specify the service to examine by including it in the command.

List options
If above command does not work then useː

Print current application in use via dumpsys
This is a good command to figure out how to start the application via am:

Open any URL with the system's default browser
The following command opens this article with the default browser on the phone:

Print all applications to easily know how to start the application via 'am'
See example below:

Example Output: com.skype.raider/.Main com.google.android.youtube/.app.honeycomb.Shell$HomeActivity com.huawei.camera/com.huawei.camera com.microsoft.appmanager/.StartUpCoreActivity com.android.mediacenter/.PageActivity

HTC backup
With a non rooted device, the only things you can backup locally is what the couple device/android will let you do. That is pretty much the same files you can copy with the already mentioned software. With the Android 4.x devices, a nice solution to make such a partial backup is the so-called "adb backup".

where:


 * -f : the path of the *.ab file that will be saved on your computer. This file is a compressed file that contains an archive of the data/apks from your device.
 * -apk|-noapk : indicates if the *.apk files should be backed up (default is -noapk)
 * -shared|-noshared: enable/disable backup of the device's shared storage / SD card contents (default is -noshared)
 * -all : indicates that you want the entire system backed up. you can use the packages filter to just backup specific packages, or use -all for a full system backup.
 * -system|-nosystem: indicates if all the system applications and data are included when backing up. (default is -system)
 * : this is where you can list specific packages to backup. Use these if you want to back up only specific applications. If using -all, you do not need to specify packages.

To backup the phone into

will start the daemon and show you the devices on the USB.

will backup every thing the device will let you to backup.

will restore the backup into the device.

To stop the daemon: