Android/adb

This WIKI has been created for non-rooted devices, for rooted devices please create another wiki OR add a rooted section at bottom

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

Install ADB & Fastboot
Fastboot will get installed under same package as adb

Install :

Enable USB Debugging
Enable the USB Debugging option under Settings > Developer options.

For Android 4.2 and newer, 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
List of devices attached 8NH7N17B0XX9898       device

If your device is listed then you can connect to your android devices shell (first time you must accept authorized request on your device when you typing below command)

Multiple Devices Connected
If you have multiple devices connected to your PC then you must use -s for specify wich device otherwise you will see a message similiar toː

error: more than one device/emulator

List of devices attached 9QZ7N11B0ZX8999       device 8NH7N17B0XX9898       device

Set Port
If you prefer to use adb over a wifi connection instead of using the cable you can type below command with the usb plugged in first timeː

restarting in TCP mode port: 5555

Print IP
To get your IP of your connected android device you can typeː

192.168.1.51

Connect
Now you should be able to connect to your deviceː

connected to 192.168.1.80:5555

Now control your device as usual via adb.

 It is NOT recommended to flash your device over adb via wifi or similiar things that can harm your device if connection will be lost

Kill adb deamon
Sometimes it might be necessary to kill adb if you your device will not be shown after you have connected the device if it's already running before you connecting the device, then just start the daemon again after you killed adb daemon.

Push all files in a folder
Files from myfolder will be transfered into storage/on/device Notice the trial slash

Pull all files in a folder
Notice the trial slash

List all services
iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo] phone: [com.android.internal.telephony]

Exampleː Print IMEI via a call service
Result: Parcel(  0x00000000: 00000000 0000000f 00360038 00340034 '........8.6.2.0.'   0x00000010: 00330036 00330030 00300035 00350032 '6.3.0.3.5.1.2.5.'   0x00000020: 00370038 00000038                   '8.7.8...        ')

Convert the output to a readable formatː

862063035125878

List installed packages
package:com.android.email package:com.android.phone package:com.android.shell package:com.android.wallpaperbackup .......

List users
Users: UserInfo{0:Owner:13} running

List permission groups
permission group:com.google.android.gms.permission.CAR_INFORMATION permission group:android.permission-group.LOCATION permission group:android.permission-group.STORAGE permission group:android.permission-group.MICROPHONE .......

List features
feature:android.hardware.camera feature:android.hardware.camera.autofocus feature:android.hardware.faketouch feature:android.hardware.fingerprint feature:android.hardware.nfc feature:android.software.vr.mode .......

Uninstall a package
Exampleː

Success Tips For uninstall several packages at once you must do it in 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 your connected device, simply run adb shell dumpsys. However, this outputs far more information than you would typically want. For more manageable output, specify the service you want to examine by including it in the command.

Exampleː Print Battery Stats
AC powered: false USB powered: true Wireless powered: false Max charging current: 500000 Max charging voltage: 5000000 Charge counter: 0 status: 2 health: 2 present: true level: 45 scale: 100 voltage: 3826 temperature: 240 technology: Li-poly

List Options
If above command does not work then you can useː

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 ~/HTC_backup

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: