ROM Android: Penggunaan adb

From OnnoWiki
Revision as of 09:38, 23 December 2014 by Onnowpurbo (talk | contribs)
Jump to navigation Jump to search

Instalasi

sudo apt-get install android-tools-adb


devices

adb devices -l
List of devices attached 
5H9TFYCYSGQ8Y9MZ       device usb:2-5 product:a80a model:A80A device:a80a


shell

adb shell

Ini akan masuk ke shell

shell@a80a:/ $

Untuk menjadi superuser ketik

su

Perlu di allow oleh kingroot yang sudah di instalasi sebelumnya

shell@a80a:/ #


mount -o remount, rw /system


install dan uninstall

The most commonly used "adb" command is the "adb install" command that allows you to install an application stored in the specified APK file to the connect Android emulator or device:

adb install <path_to_apk>

You can also uninstall a package from the connected emulator or device by using the "adb uninstall" command:

adb uninstall <apk_name>


Push dan Pull

he "adb" tool also offers you commands to copy files into and from the connected Android emulator or devices.

The "adb push <local> <remote>" copies a file or folder from the local system to the remote emulator or device.

The "adb pull <remote> <local>" copies a file or folder from the remote emulator or device to the local system.



Instalasi fastboot

apt-get install android-tools-fastboot



Cara masuk ke fastboot

adb devices -l
adb reboot-bootloader
fastboot devices

akan keluar

5H9TFYCYSGQ8Y9MZ	fastboot


fastboot flash recovery recovery.img

Here's a quick explanation of the above command:

fastboot: that's the executable tool
flash: that's the function we want the fastboot tool to perform
recovery: this is the name of the partition we want to flash into. since we are flashing  a recovery image, it needs to go to the recovery partition.
recovery.img: this is the name of the actual file to flash. Your filename may be different. Just make sure it matches the actual filename.


The fastboot command line usage is:

$ fastboot -h usage: fastboot [ <option> ] <command>

commands:

 update <filename>                        reflash device from update.zip
 flashall                                 flash boot + recovery + system
 flash <partition> [ <filename> ]         write a file to a flash partition
 erase <partition>                        erase a flash partition
 getvar <variable>                        display a bootloader variable
 boot <kernel> [ <ramdisk> ]              download and boot kernel
 flash:raw boot <kernel> [ <ramdisk> ]    create bootimage and flash it
 devices                                  list all connected devices
 reboot                                   reboot device normally
 reboot-bootloader                        reboot device into bootloader

options:

 -w                                       erase userdata and cache
 -s <serial number>                       specify device serial number
 -p <product>                             specify product name
 -c <cmdline>                             override kernel commandline
 -i <vendor id>                           specify a custom USB vendor id

Erase an individual partition

To erase an individual partition, use:

   fastboot erase <partition>

Ex: fastboot erase cache

Write to an individual partition

To write an image file to an individual partition, use:

   fastboot flash <partition> [ <filename> ] 

If writing to the 'splash1' partition, the file needs to be an image file in a special format. See G1 Splash Image for details.

If writing to the 'recovery' or 'boot' partitions, the file consists of a Linux kernel and initrd file system image. This can be created with the 'mkbootimg' program.

If writing to the 'system', 'cache', or 'userdata' partitions, the file is a file system image formatted in yaffs2 format.

FIXTHIS - document how to create one of these. To boot with a host-side kernel image (and rootfs image)

This command allows you to download a kernel image (and optional root filesystem image) and boot the phone with those, instead of using the kernel and rootfs in the boot flash partition. It is very useful while developing a kernel or modifying the rootfs.

   fastboot boot <kernel> [ <ramdisk> ]

Ex: fastboot boot linux-2.6/arch/arm/boot/zImage root-image/recovery.img-ramdisk.cpio.gz


fastboot boot boot.img


Reboot the phone

To reboot the phone, using the kernel and rootfs in the 'boot' partition:

   fastboot reboot

Referensi