When you consider installing an app on your Android smartphone, what is the first thing that comes to your mind? Google Play Store, right? Downloading and installing an app from the Play Store is the simplest and easiest method to do so. However, it most certainly isn’t the only method. Well, for starters, you always have the option to install apps from their APK files. These files are like setup files for software that can be downloaded using a web browser like chrome and then installed as and when required. The only requirement is that you enable the Unknown Sources permission for your browser.
Now, the described method requires you to have direct access to your device but consider a situation where accidentally some system file gets damaged. This causes your UI to crash and leaving you with no way to access your phone. The only way to resolve the issue is to install a third-party UI app so that the device starts working again. This is where ADB comes in. It allows you to control your device using a computer. It is the only way in which you can install apps on your device in a situation like this.
Well, this is just one of many scenarios where ADB could be a lifesaver. Therefore, it would only do you good if you knew more about ADB and learned how to use it and that’s exactly what we are going to do. We are going to discuss what is ADB and how it works. We will also take you through the various steps involved in the process of setting up and then using ADB to install apps on your device.
How to Install APK Using ADB Commands
What is ADB?
ADB stands for Android Debug Bridge. It is a command-line tool that is a part of the Android SDK (Software Development Kit). It allows you to control your Android smartphone using a PC provided that your device is connected to the computer via a USB cable. You can use it to install or uninstall apps, transfer files, get information about network or Wi-Fi connection, check battery status, take screenshots or screen recording and so much more. It has a set of codes that allow you to perform various operations on your device. As a matter of fact, ADB is a very powerful tool that is capable of performing advanced operations that a good amount of practice and training to master. The more you explore the world of coding, the more useful ADB will become for you. However, for the sake of keeping things simple, we are just going to cover some basics and mainly teach you how to install an APK using ADB.
How does it work?
ADB uses USB debugging to take control of your device. When connected to a computer using a USB cable, ADB client is able to detect the connected device. It uses a command line or command prompt as the medium to relay the commands and information between the computer and the Android device. There are special codes or commands which allow you to control the processes and operations on your Android device.
What are the various Pre-requisites for using ADB?
Now, before you can install APK using ADB commands, you need to make sure the following pre-requisites are met.
- The first thing that you need is to make sure that the device’s driver is installed on your PC. Every Android smartphone comes with its own device driver that automatically gets installed when you connect your phone to your PC. If your device does not have one then you need to download the driver separately. For Google devices like Nexus, you can find just install Google USB Driver which is a part of SDK (we will discuss this later). Other companies like Samsung, HTC, Motorola, etc. provide drivers on their respective sites.
- The next thing that you need is to enable USB debugging on your Android smartphone. The option to do so can be found under Developer options. First, enable the Developer Options from the Settings menu.
How does it work?
ADB uses USB debugging to take control of your device. When connected to a computer using a USB cable, ADB client is able to detect the connected device. It uses a command line or command prompt as the medium to relay the commands and information between the computer and the Android device. There are special codes or commands which allow you to control the processes and operations on your Android device.
What are the various Pre-requisites for using ADB?
Now, before you can install APK using ADB commands, you need to make sure the following pre-requisites are met.
- The first thing that you need is to make sure that the device’s driver is installed on your PC. Every Android smartphone comes with its own device driver that automatically gets installed when you connect your phone to your PC. If your device does not have one then you need to download the driver separately. For Google devices like Nexus, you can find just install Google USB Driver which is a part of SDK (we will discuss this later). Other companies like Samsung, HTC, Motorola, etc. provide drivers on their respective sites.
- The next thing that you need is to enable USB debugging on your Android smartphone. The option to do so can be found under Developer options. First, enable the Developer Options from the Settings menu.
You are now a developer | How to Install APK Using ADB Commands
After that, you need to enable USB debugging from the Developer options.
b. Now, tap on Developer options.
c. Scroll down and under the Debugging section, you will find the setting for USB debugging. Simply toggle on the switch and you are good to go.
- Last but not least, you need to download and install ADB on your computer. We will discuss this in the next section and guide you through the entire installation process.
How to Download and Install ADB on Windows?
As mentioned earlier, ADB is a part of the Android SDK and thus, you need to download the entire setup package for the tool kit. Follow the steps given below to download and install ADB on Windows 10:
- Click here to go to the downloads page for Android SDK platform tools.
- Now, click on the “Download SDK Platform-Tools for Windows” button. You can select the other options as well depending upon the operating system that you are using.
- Agree to the Terms and Conditions and click on the Download button.
Once the zip file is downloaded, extract it at a location where you want to save the tool kit files.
You will be able to see the ‘ADB’ present in the folder along with other tools. The installation process is now complete. We will now be moving to the next step that is using ADB to install APK on your device.
How to Use ADB to install APK on your device?
Before you proceed to install APK using ADB commands, you need to make sure that ADB is set up properly and the device connected is being detected properly.
- To do this, connect your Android device to the computer and then open the folder containing the SDK platform tools.
- In this folder, hold down Shift and then right-click. From the menu select the “Open Command window here” option. If the option to open the command window is not available, then click on the “Open PowerShell window here”.
Now, in the Command Prompt window/PowerShell window type the following code: “.\adb devices” and press Enter.
- This will display the name of your device in the command window.
- If it does not, then there is a problem with the device’s driver.
- There is a simple solution to this problem. Go to the search bar on your computer and open Device Manager.
- Your Android device will be listed there. Right-click on it and simply tap on the update driver option.
- Next, click on the option to look for Drivers online. If there are any new drivers available then they will automatically get downloaded and installed on your computer.
- Now, go back to command prompt/PowerShell window and type the same command provided above and press Enter. You will now be able to see the name of the device displayed on the screen.
This confirms that ADB has been successfully set up and your device is connected properly. You can now perform any operations on your phone using the ADB commands. These commands need to be entered in the Command Prompt or PowerShell window. In order to install an APK on your device via ADB, you need to have the APK file stored on your computer. Let us assume that we are installing the APK file for the VLC media player.
Follow the steps given below to install the app on your device:
- The first thing that you need to do is move the APK file to the folder containing the SDK platform tools. This will make it easier as you would not have to type the entire path for the location of the APK file separately.
- Next, open the command prompt window or PowerShell window and type in the following command: “adb install ” where the app name is the name of the APK file. In our case, it will be “VLC.apk”
- Once the installation is complete, you will be able to see the message “Success” displayed on your screen.