Update or install Android from PC with ADB

ADB AndroidADB, which stands for Android Debug Bridge, is a program included in the developer platform Android and it is undoubtedly very important to install a system update, to restore Android to factory settings or manage files from your computer to your Android device without using other programs or other tools, since you operate from a command prompt. ADB allows you to control the device from your computer via USB cable, copy files to the memory of your mobile or tablet, install and uninstall applications, execute commands, or even, for Google devices, install and update Android.In this article we see how to use ADB in general, mostly to update or reinstall Android from scratch, which is particularly useful in the case of updates to the latest Android version or to reinstall Android from scratch.
NOTE: The guide refers to the stock Android version of the Google Pixel, while for other phones such as Samsung or Xiaomi, the procedure may not work and a search will be required to find out if there are different commands to use. The fact remains that it is always possible to install custom ROMs or Android updates with ADB Sideload as explained in another article, on every type of phone. For example, the Lineage OS ROM exists for almost all the latest models and is an Android version based on the Google Stock, which frees the smartphone from the customizations and limits of the manufacturer.

How to use ADB for Android on PC

Although this tool is reserved for Android geek users, it can be a good idea to learn how to use it, so that you can restore Android in case of screen lock, in case of infection, or in case of boot loop, so that you can get the control the device without ever touching the touch screen.

Install ADB on PC

To use ADB from your Windows computer, you must first download the Google Android Platform-tools package and extract the files to a folder.
SDK Platform

To make ADB work properly we must also install the drivers for Android, so as not to have problems when we connect the phone to the PC. Genre drivers for Android can be downloaded from the official website; alternatively, we can find the right driver by reading our guide How to install Android drivers on a PC.

How to set up the Android device for ADB commands

On the Android smartphone we need to activate the developer options and USB debugging to be able to accept ADB commands when the device is started correctly; to proceed we can also read our guide to the Android Developer Options, so as to activate the option of debugging USB.
USB Debug

To verify that ADB is working properly, connect the Android device to the computer via the USB cable used to recharge the mobile, open a command prompt (from the Start menu we type cmd and press Enter), and launch the adb.exe command; if the command does not work we open the specific folder of ADB in the prompt, as seen in the guide Command Prompt Tricks (CMD).

How to use ADB

To find out how ADB works on the PC, connect the phone via USB cable and, after a few seconds of waiting, write the command ADB devices and let’s see if there is a response and the line indicating the presence of the device is displayed. ADB can be used for:

  • Install an application: to proceed we write adb install C:package.apk (if the app is in that position).
  • Uninstall an application: to remove apps, the command is adb uninstall package.name (use the com.rovio.angrybirds type name)
  • Transfer a file from the PC to the device: we use the command adb push C:file /sdcard/file
  • Transfer a file from the device to the PC: in this case we use the command adb pull /sdcard/file C:file
  • Activate a Unix Shell-style command line: to proceed we write adb shell.
  • Complete backup of your mobile or tablet to your computer: we use the command adb backup -apk -shared -all -f C:UsersNAMEbackup.ab.
  • Restore backup: we use the command adb restore C:UsersNAMEbackup.ab.

These commands can be very useful when we want to upload a file to the phone without using dedicated management systems or Wi-Fi connections.

How to update Google Pixel via ADB

If we want to install an Android update on Google Pixel devices, we can proceed via ADB (in case the OTA update does not work or to anticipate it). Before using ADB, to update Android on Pixels via OTA (Over The Air) let’s go inside settings -> About phone and we look for new updates; you can google them OTA updates which are not the full versions and require that there be a specific version already installed. To proceed via ADB we can download the Full OTA packages of the Google Pixel from the official page.

Now let’s go to the folder where it is adb.exe (ie ….Androidandroid-sdkplatform-tools), hold down the Shift key, and right-click inside the window, so you can select Open PowerShell window here. To perform this manual update procedure, always extract the zip file in the folder ….Androidandroid-sdkplatform-tools and typing in the open PowerShell:

adb reboot recovery

The Google Pixel will restart in recovery mode; we keep the keys pressed Power e Volume¬†on the Google Pixel and select the item Apply update from ADB using the volume keys to move between items and the key Power to confirm. Once this is done, let’s go back to the command shell and launch the command this time:

adb sideload nome-aggiornamento.zip

The rumors will appear on the Google Pixel recovery Finding, Opening e Verifying that indicates the installation of the update for our phone. At the end of the installation, we will see the message appear to Install from ADB completed with status 0, a sign that the update was successful and we can restart the phone by pointing to the item Reboot system now (using the volume keys) and pressing the key Power.

To learn more we can read our guide Reset and restore of Android even if the mobile or tablet does not start.

Conclusions

Using ADB we will have access to numerous features reserved for developers to upload APK files, to transfer files from the phone to the PC (and vice versa), and to update the Google Pixel with official updates. If, on the other hand, we wanted to change ROM on Android phones, the ADB command can do for us, as also seen in the guide How to install an Android Custom ROM.

Always on the same topic, we can read our guides Download and use Fastboot and ADB on Android e Remove pre-installed apps on Xiaomi, Huawei, and Samsung.

LEAVE A REPLY

Please enter your comment!
Please enter your name here