<span id="Label3"></p><p><p>ADB usage:</p></p><p><p>Get ready:</p></p><p><p>1, install the corresponding USB driver on the computer, the top posts in each section have download links</p></p><p><p>2, Mobile Access settings, developer options, Tick USB debugging</p></p><p><p><strong>adb devices<strong> </strong> </strong> to see if a device is available</p></p><p><p><strong style="line-height: 1.5;"><strong>adb shell </strong></strong>--log on to your phone to execute various Linux COMMANDS.<br>After running, the above-mentioned prompt appears, and then the cursor blinks waiting for the input command, such as:<br>Ls--list directories and files in the current directory<br>CD xxx--enters the xxx directory, which can be a relative or absolute path<br>Other common commands are many, specifically can baidu.<br><strong style="line-height: 1.5;"><br>ADB shell</strong> to <span style="line-height: 1.5;">see if root, full root</span></p></p><p><p>1, Click on the Computer: Start menu run, and then input cmd, enter the DOS window will pop up<br>2. Enter the <strong>adb shell</strong>and return<br>3, at this time pay attention to the cell phone response, if the phone pops up the ADB shell request Super User rights, whether the allowed dialog box, Click Allow. This will only occur the first time it is Run.<br>4, at this time if the appearance is: [email protected]# on behalf of the mobile phone has been completely rooted, a lot of functions need in this mode to work properly.<br>If it appears: [email protected]$ need further judgment</p></p><p><p>4. Re-enter <strong>su</strong>and return<br>At this time note the response of the phone, if the phone pops up the ADB shell to request Super User permissions, whether the allowed dialog box, Click Allow. This will only occur the first time it is Run.<br>5, If this appears [email protected]# on behalf of the phone has root, but kernel not cracked, called incomplete root,<br>At this time, the ADB and fastboot daily need root permission operation should be able to run normally.</p></p><p><p>If an error occurs, or if it is still [email protected]$, There are many features that are not root,adb and fastboot on the PHONE.</p></p><p><p><strong>adb shell</strong> Backup export partition, can use ADB to view the system partition by command, the command is as Follows:</p></p><p><p>Su</p></p><p><p>Cat/proc/mtd</p></p><p><p>Assuming the MTD1 corresponds to the boot partition, MTD2 corresponds to the system partition, and the backup export boot.img and SYSTEM.IMG commands are as Follows:</p></p><p><p>CAT/DEV/MTD/MTD1 >/sdcard/boot.img</p></p><p><p>CAT/DEV/MTD/MTD2 >/sdcard/system.img</p></p><p><p></p></p><p><p><strong>adb Shell </strong>DD command to Brush recovery.img</p></p><p><p><strong>ADB shell</strong></p></p><p><p><strong>Su</strong></p></p><p><p>1) Qualcomm Platform: DD if=/data/local/tmp/recovery.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery</p></p><p><p>2) MTK platform: DD if=/data/local/tmp/recovery.img of=/dev/recovery</p></p><p><p>3) nvidia platform: DD if=/data/local/tmp/recovery.img Of=/dev/block/platform/sdhci-tegra.3/by-name/sos</p></p><p><p><strong style="line-height: 1.5;">ADB remount (requires Full Root)</strong></p></p><p><p>--re-mount the system directory in Read-write mode, and after running it can modify the contents of the system Directory.<br><br><strong>ADB Push Object Dest</strong><br>Mainly used to upload files to the phone, where object is the file to be uploaded, if in the current directory you can omit the path name, otherwise you must add the path,<br>Dest is the path that the file will be placed on your phone, or you can keep up with the Filename.</p></p><p>The <p> example is as Follows: <br> adb push 1.zip /sdcard -- Upload the 1.zip file in the current directory to The/sdcard directory on your phone, the file name does not change <br> adb push 2.rar /external_sd/22. Rar --upload the 2.rar file in the current directory to THE/EXTERNAL_SD directory on the phone, the file name becomes 22.rar <br> Note: here dest in the above mentioned non-root, There are different limitations under incomplete root and root environments. <br> Non-root environment, Incomplete root environment: commonly used only/sdcard,/external_sd, and toss may be used to/data/local/tmp <br> Full root environment: run adb Remount after the dest can be the system directory or its subdirectories (except for some special directories). <br> <br> <strong> adb pull object dest </strong> <br> -- Downloading a file from your phone to a local <br> object is the path to a file on your phone that requires the full path to/start, dest can be omitted, and omitted to be downloaded to the current directory. </p></p><p><p>Examples are as Follows:<br>ADB pull/system/app/maps.apk--download the/system/app/maps.apk file from the phone to the current directory<br>ADB pull/system/app/maps.apk 2dir/--download the/system/app/maps.apk file on the phone to the 2dir directory under the current directory, provided the 2dir directory exists in the current directory<br>ADB pull/system/app/maps.apk 2dir/map.apk--download the/system/app/maps.apk file on your phone to the current directory<br>2dir directory, renamed as map.apk, provided the 2dir directory exists under the current directory</p></p><p><p><strong>adb reboot </strong>--restart your phone</p></p><p><p><strong>adb reboot bootloader </strong>--restart <span style="color: #0000ff;">your phone to fastboot mode to restart your phone directly to FastBoot mode without shutting down and then pressing the key combination</span></p></p><p><p><strong>adb reboot recovery </strong>--restart your phone to recovery mode to restart your phone directly to FastBoot mode without shutting down and then pressing the key combination</p></p><p><p><strong>adb install xxx.apk</strong> --installs the APK package from the current directory to the phone</p></p><p><p><br><strong>FastBoot command</strong></p></p><p><p>FastBoot is a tool used in conjunction with the <span style="color: #0000ff;">fastboot mode</span> of the PHONE.<br>The phone system can be damaged (non-brick) without relying on the mobile phone software, but the use of local mirror operation of the PHONE.</p></p><p><p>Here's a list of common uses:</p></p><p><p><strong>fastboot devices<strong> </strong> </strong> See if there are any devices<br><br><strong>fastboot boot boot.img|recovery.img</strong> --start your phone with boot.img or recovery.img in the current directory, as follows<br>FastBoot boot boot.img--launches The phone with the boot.img in the current directory, which can be used to enter the system in case of damage to the boot partition of the PHONE.<br>FastBoot boot Recovery.img--starts The phone to recovery mode with the recovery.img in the current directory,<br>This has nothing to do with the existing system on the phone, as long as the local recovery.img is normal to rec before, then absolutely no problem.<br>Those official liters or brush ROM can not enter the rec after all, in fact, this way into the recovery environment to brush the machine, brush rec, brush various zip ...<br><br><span style="color: #ff0000;">The above two operations are temporary, that is, after restarting the phone is still the original state, there is no change.</span><br>The typical application scenario is to modify the boot.img, you can test the new boot.img with the FastBoot boot bootnew.img, and the phone only needs to be restarted.<br><br><span style="color: #ff0000;">The following is a real change to the boot partition of the phone, changed to the current directory under the Boot.img Content.</span><br><strong>fastboot Flash boot boot.img</strong> --swipe the boot.img in the current directory into the boot partition of your PHONE.</p></p><p><p><strong>fastboot Flash Recovery recovery.img</strong> --swipe The recovery.img in the current directory into the recovery partition of your PHONE.<br><strong> <strong>fastboot Flash system system.img</strong> </strong>--swipe The system.img in the current directory into the system partition of your PHONE.<strong><br>FastBoot Flash UserData userdata.img </strong>--swipe The userdata.img in the current directory into the data partition of your PHONE.</p></p><p><p><strong>FastBoot Erase System</strong><br><strong>FastBoot Erase Cache</strong><br><strong>FastBoot Erase Config</strong><br><strong>FastBoot Erase Data</strong><br><strong>FastBoot Erase Logs</strong><br><strong>FastBoot Erase Factory</strong></p></p><p><p><strong>fastboot reboot </strong>--restart your phone</p></p><p><p><span style="color: #ff00ff;"><strong><span style="line-height: 1.5;">The partitions of the Android system are:</span></strong></span></p></p><p><p>Boot partition corresponds To/boot<br>Recovery Partition Corresponding/recovery<br><span style="line-height: 1.5;">Directory for the system Partition/system<br></span><span style="line-height: 1.5;">UserData Partition Corresponding/data<br></span><span style="line-height: 1.5;">Cache partition Corresponds To/cache</span></p></p><p><p>Let's move forward to the useful commands:</p></p> <table border="2" cellspacing="5" cellpadding="5"> <tbody> <tr> <td><strong>Commands</strong></td> <td><strong>Use</strong></td> </tr> <tr> <td colspan="2"><span style="color: #0000ff;"><strong>Basic ADB Commands</strong></span></td> </tr> <tr> <td><strong>ADB devices</strong></td> <td>Shows a list of devices attached to the Computer.</td> </tr> <tr> <td><strong>ADB reboot</strong></td> <td>Reboots a device connected to the PC.</td> </tr> <tr> <td><strong>ADB reboot Recovery</strong></td> <td>Reboots a device into recovery mode.</td> </tr> <tr> <td><strong>ADB reboot Download</strong></td> <td>Reboots the connected device into download Mode. e.g Download mode on Samsung Galaxy devices.</td> </tr> <tr> <td><strong>ADB reboot bootloader</strong></td> <td>Reboots a device into Bootloader. Once in Bootloader, your can make further selections Here.</td> </tr> <tr> <td><strong>ADB reboot FastBoot</strong></td> <td>Reboots a connected device into FastBoot Mode.</td> </tr> <tr> <td colspan="2"><span style="color: #0000ff;"><strong>Installing/uninstalling/updating Apps with ADB.</strong></span></td> </tr> <tr> <td><strong>ADB install <applicationpathpackagename>.apk</strong></td> <td>ADB Install let's you install APK files directly to your PHONE. Use of this command type adb install application path, as shown in the commands part and hit enter key and it'll START I Nstalling the app on your PHONE. e.g <strong>adb install c:/users/usamam/desktop/candycrushsaga.apk</strong>. If process succeeds it would show you ' Success ' in the command window.</td> </tr> <tr> <td><pre><strong>ADB install-r <aplicationpathpackagename>.apk</strong></pre></td> <td>If you have the already installed an app, and you just want to update the IT then the This command is let's do. e.g<strong> ADB install-r c:/users/usamam/desktop/candycrushsaga.apk</strong></td> </tr> <tr> <td><strong>adb unistall package_name</strong> <strong>e.g</strong><p></p><p><strong>ADB uninstall Com.android.chrome</strong></p></td> <td>Uninstalls and application from your Device. The Easiest-to-find a package name was, install package name Viewer from the Play store and find the name of the Packag E under the App Name. If process succeeds it would show you ' Success ' in the command window.</td> </tr> <tr> <td><strong>adb uninstall-k package_name</strong> <strong>e.g</strong><p></p><p><strong>a</strong> <strong>db uninstall-k Com.android.chrome</strong></p></td> <td>Uninstall an app but keeps it ' s data and cache Directories. If process succeeds it would show you ' Success ' in the command window.</td> </tr> <tr> <td colspan="2"><span style="color: #0000ff;"><strong>Push</strong> and Pull files</span></td> </tr> <tr> <td><strong>adb root</strong> <strong>adb push ></strong> <strong>e.g</strong> <strong>adb push C:\users\UsamaM\desktop\Song.mp3 \system\media</strong><p></p><p><strong>ADB push filepathonpc/filename.extension Path.on.phone.toplace.the.file</strong></p></td> <td>The ADB push commands let's you transfer all files to your phones from your PC. You simply need to provide the path of a file on your PC and path where to place the this file on your Phone.</td> </tr> <tr> <td><strong>adb root</strong> <strong>adb pull></strong> <strong>e.g</strong> <strong>adb pull \system\media\song.mp C:\users\UsamaM\desktop</strong><p></p><p><strong>ADB pull [path of file on phone] [path in PC where to place the file]</strong></p></td> <td>Similar to the ADB push command. Using adb pull, You can simply pulling any files from your Phone.</td> </tr> <tr> <td colspan="2"><p><span style="color: #0000ff;"><strong>Backing up system and installed Apps.</strong></span></p><p>Before doing this, in your ADB folder create a folder Backup and under the Backup folder create the folders named Systemap PS and Installedapps.<br>These folders is necessary as you'll be pushing the backed on apps to these Folders.</p></td> </tr> <tr> <td><strong>ADB Pull/system/app Backup/systemapps</strong></td> <td>Backs up all the system apps for your phone to the Systemapps folder, That's created in the ADB folder.</td> </tr> <tr> <td><strong>ADB Pull/system/app Backup/installedapps</strong></td> <td>Backs up all the installed apps for your phone to the Installedapps folder so you created in the ADB folder.</td> </tr> <tr> <td colspan="2"><strong>Background Terminal</strong></td> </tr> <tr> <td><strong>ADB shell</strong></td> <td>Starts the background terminal.</td> </tr> <tr> <td><strong>Exit</strong></td> <td>Exits the background terminal.</td> </tr> <tr> <td><strong>adb shell <command you want></strong> <strong>e.g adb Shell su</strong></td> <td>Switches to the root of your PHONE. Please make sure this you ' re rooted in case you wish to the use ADB shell su.</td> </tr> <tr> <td colspan="2"><p><span style="color: #0000ff;"><strong>FastBoot commands</strong></span></p><p>To flash files using fastboot, place the Desired. files in FastBoot folder or Platform-tools folder, which you obtained after Installation of Android SDK Tools.</p></td> </tr> <tr> <td><strong>FastBoot Flash File.zip</strong></td> <td>Flashes A. Zip file to your phone while your phone is connected in FastBoot Mode.</td> </tr> <tr> <td><strong>FastBoot Flash Recovery recoveryname.img</strong></td> <td>Flashes a recovery to your phone when it's connected in FastBoot Mode.</td> </tr> <tr> <td><strong>FastBoot Flash Boot bootname.img</strong></td> <td>Flashes a boot or kernel image when your phone is connected in FastBoot Mode.</td> </tr> <tr> <td><strong>FastBoot GetVar CID</strong></td> <td>Shows you the CID of your PHONE.</td> </tr> <tr> <td><strong>FastBoot OEM writecid xxxxx</strong></td> <td>Writes the Super CID.</td> </tr> <tr> <td> <strong> fastboot Erase system <br> </strong> <strong style="font-size:10px; line-height:1.5;">fastboot Erase data <br> </strong> <strong style="font-size:10px; line-height:1.5;">fastboot Erase cache </strong> </td> <td> In case you want-to-restore a nandroid backup, you'll have to delete the current system/data/cache of your phone First. Before doing this, it's always recommended to has backed up your system using a custom recovery>backup option and COP Y the backed up. img files to fastboot or Platform-tools folder in Android SDK folder. Then performing these commands would erase Everything. </td> </tr> <tr> <td> <strong> fastboot Flash system system.img <br> </strong> <strong style="font-size:10px; line-height:1.5;"> FastBoot Flash data data.img <br> </strong> <strong style="font-size:10px; line-height:1.5;">fastboot Flash Cache Cache.img </strong> </td> <td> These commands'll restore the backup That's made using a custom recovery on your phone an D placed in the FastBoot folder under Android SDK tools. </td> </tr> <tr> <td><strong><span style="color: #3366ff;">FastBoot OEM Get_unlock_data<br>FastBoot OEM Unlock Unique_key<br></span><br>FastBoot OEM Get_identifier_token<br></strong><strong style="font-size: 10px; line-height: 1.5;">FastBoot OEM Flash Unlock_code.bin<br></strong><strong style="font-size: 10px; line-height: 1.5;"><br>FastBoot OEM Lock</strong></td> <td>These commands help-get The identifier token of your phone that can is used for unlocking the Bootloader. The second command helps your to flash the bootloader unlock code, and the 3rd commands helps your to lock your phone s boo Tloader once again if locking it is actually allowed.</td> </tr> <tr> <td colspan="2"><p><strong>Logcat</strong></p></td> </tr> <tr> <td><strong>ADB logcat</strong></td> <td>Shows you the real time logs of your phones, these logs represent the ongoing process on your device. It is recommended that the run this command while your device boots up to check the what's going On.</td> </tr> <tr> <td><strong>ADB logcat > Logcat.txt</strong></td> <td>Creates a. TXT file containing the logs in the Platform-tools folder or FastBoot folder in Android SDK tools Directory.</td> </tr> </tbody> </table><p><p>Android phone ADB fastboot command basic usage</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service