Whenever you consider installing an app on your Android smartphone, what is actually the first thing that comes to your mind? Google Play Store, right? Downloading and also installing an app from the Play Store is actually the simplest and easiest method to do that. However, it most certainly isn’t the only method as well. Well, for starters, you always have the option in order to install apps from their APK files. These files are just like setup files for software that can be downloaded via a web browser like chrome and then installed as and whenever required. The only requirement is that you turn on the Unknown Sources permission for your browser. In this article, we are going to talk about How to Install APK Using ADB Commands. Let’s begin!
Now, the described method needs you to have direct access to your device. However, consider a situation where accidentally some system file damages. This actually causes your UI to crash and leaving you along with no way to access your phone. The only way in order to resolve the issue is to install a third-party UI app so that the device starts working again. This is actually where ADB comes in. It permits you to control your device via a computer. It is the only way in which you guys can install apps on your device in a situation like this.
Well, this is just one of many scenarios where ADB could actually be a lifesaver. Hence, it would only do you good if you knew more about ADB and learned how you can use it and that’s exactly what we are going to do. We are now going to discuss what is ADB and how it works. We will also take you through the numerous steps involved in the process of setting up and then using ADB in order to install apps on your device.
How to Install APK Using ADB Commands
What is ADB?
ADB basically stands for Android Debug Bridge. It is a command-line tool that is actually part of the Android SDK (Software Development Kit). It permits you to control your Android smartphone using a PC provide that your device is connect to the computer through a USB cable. You can also use it to install or uninstall apps, transfer files, get information about the network, or also a Wi-Fi connection. Check battery status, take screenshots or screen recording and so much more as well. It also has a set of codes that allow you to perform a lot of operations on your device.
As a matter of fact, ADB is a really powerful tool that is capable of performing advanced operations that a good amount of practice and training to master as well. The more you explore the world of coding, the more useful ADB will it become for you as well. But, actually for the sake of keeping things simple, we are just going to cover some basics and mainly teach you how you guys can install an APK using ADB.
How does it work?
ADB uses USB debugging in order to take control of your device. When connected to a computer via a USB cable, the ADB client is able in order to detect the connected device. It also uses a command line or command prompt whenever the medium is in order to relay the commands and information between the computer and the Android device as well. There are special codes or commands which permit you to control the processes and operations on your Android device.
What are the various Prerequisites for using ADB?
Now, before you guys can install APK using ADB commands, you have to make sure the following pre-requisites are met.
- The first thing that you need is just to make sure that the device’s driver is install on your PC. Each and every Android smartphone comes along with its own device driver that automatically gets installed whenever you connect your phone to your PC. If your device does not have one then you have to download the driver separately. For Google devices such as Nexus, you can find just install Google USB Driver which is a part of SDK (we will discuss this later). Many other companies such as Samsung, HTC, Motorola, etc. give drivers on their respective sites.
- The next thing that you need is just to enable USB debugging on your Android smartphone. The option to do that you can find under Developer options. First, turn on the Developer Options from the Settings menu.
- After that, you have to enable USB debugging from the Developer options.
- Open Settings and then tap on the System option.
- Now, click on Developer options.
- Scroll down and then under the Debugging section, you guys will find the setting for USB debugging. Simply toggle on the switch and now you are good to go.
- Last but not least, you have to download and install ADB on your computer. We will also discuss this in the next section and guide you through the whole installation process.
How to Download and Install ADB on Windows?
As mentioned earlier, ADB is also a part of the Android SDK and thus, you guys have to download the whole setup package for the tool kit.
- Tap on here to head to the downloads page for Android SDK platform tools.
- Now, tap on the “Download SDK Platform-Tools for Windows” button. You can choose the other options as well relying upon the operating system that you are using.
- Agree to the Terms and Conditions and then tap on the Download button.
- When the zip file is downloads then extract it at a location where you want to save the tool kit files.
You guys 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 actually using ADB to install APK on your device.
How can you Use ADB to install APK on your device?
Before you guys proceed to install APK using ADB commands, you have to make sure that ADB is set up properly and the device connected is being detected properly as well.
- In order to do this, just connect your Android device to the computer and then open the folder containing the SDK platform-tools as well.
- Now in this folder, you have to hold down Shift and then right-click. From the menu select the “Open Command window here” option. If the option in order to open the command window is really not available, then just click on the “Open PowerShell window here”.
- Then, in the Command Prompt window/PowerShell window type the following code: “.\adb devices” and click on Enter.
- This will also show the name of your device in the command window.
- If it does not, then there is a problem along with the device’s driver.
- There is also a simple solution to this problem. Head to the search bar on your computer and open Device Manager.
- Your Android device will actually be listed there. Right-click on it and simply click on the update driver option.
- Next, just tap 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 PC as well.
- Then, head back to the command prompt/PowerShell window and type the same command provided above, and click on Enter. You will now be able to see the name of the device displayed on the screen.
This basically confirms that ADB has been successfully set up and your device is actually connected properly. You can now perform any operations on your phone via the ADB commands. These commands have to be entered in the Command Prompt or PowerShell window. In order to install an APK on your device through ADB, you need to have the APK file saved on your computer. Let us assume that we are installing the APK file for the VLC media player as well.
Follow the steps given below to install the app on your device:
- The very first thing that you have to do is move the APK file to the folder containing the SDK platform tools. This will also make it easier as you would not have to type the whole path for the location of the APK file separately.
- Next, open the command prompt window or PowerShell window and also type in the following command: “adb install <app name.apk>” where the app name is actually the name of the APK file. In our case, it will also be “VLC.apk”
- When the installation is complete, you guys will be able to see the message “Success” displayed on your screen.
Hence, you have now successfully learned how you can install APK using ADB commands. But, as mentioned above ADB is a powerful tool and can be used to perform a lot of other operations. All that you have to know is the correct code and syntax and you will be able to do that much more. In the next section, we also have a little bonus for you. We will be listing down many selected important commands that you guys can try and have fun experimenting with.
Other Important ADB Commands
- “ADB installs -r <app name.apk>” – This command permits you to re-install or update an existing app. Take for example you already have an app installed on your device, however, you want to update the app via the latest APK file for the app. It is also useful whenever a system app is corrupt and you have to replace the corrupt app via its APK file.
- “ADB installs -s <app name.apk>” – This command allows you in order to install an app on your SD card provided the app is actually compatible to be installed on the SD card. And also if your device permits apps to install on the SD card.
- “Also ADB uninstalls <app name.apk>” – This command permits you to uninstall an app from your device. But, one thing that needs to keep in mind is that you have to type in the entire package name whenever uninstalling an app. Such as you have to write “com.Instagram.android” in order to uninstall Instagram from your device as well.
- “ADB logcat” – This command allows you in order to view the device’s log files.
- “ADB shell” – This command also allows you to open an interactive Linux command-line shell on your Android device as well.
- “Also, ADB push <file location path>/sdcard/<folder name>” – This command permits you in order to transfer some files on your computer to the SD card of your Android device. Here “file location path” actually stands for the pathway of the file on your computer and “folder name” is actually the directory where the file will also get transferred on your Android device.
- “ADB pull /sdcard/<file name><file location path>” – This command can also be considered to be the reverse of the push command. It permits you to transfer a file from your Android device to your PC. You have to type in the name of the file on your SD card in place of “filename”. Specify the location on your computer where you guys want to save the file in place of “file location path” as well.
- “adb reboot” – This command also permits you to restart your device. You can also chose to boot your device in bootloader via adding -bootloader after reboot. Some devices also permit you to directly boot into Recovery mode via typing “reboot recovery” rather than simply reboot.
Alright, That was all Folks! I hope you guys like this article and also find it helpful to you. Give us your feedback on it. Also if you guys have further queries and issues related to this article. Then let us know in the comments section below. We will get back to you shortly.
Have a Great Day!