There are many ways one can install APK’s on their android phones. This method is called as side loading, which can be done by two various ways, one using a Package Manager within Android and second is using ADB Commands from a computer/laptop.
Table of Contents
- What is ADB?
- Why would one use this Method?
- Tools that is required for this Method:
- Installing ADB on the Computer/Laptop
- Enabling Developer Mode and USB Debugging:
- Installing an .APK using ADB:
- Uninstalling an .APK using ADB
- Common Errors made during the method:
- Device does not show up after executing the “adb devices command”
- Errors while using PowerShell instead of Command Prompt
What is ADB?
ADB, known as Android Debug Bridge is a handy tool which uses command line to communicate with an Android based device. It provides the user with a UNIX based shell, which can allow user doing basic commands like Installing and Unistalling Applications which will be covered in this article and advanced setup like unlocking Bootloader and invoking FastBoot.
It consists of 3 parts, a client which sends the commands, a daemon which runs commands on the device and third the server which allows the communication between the client and the daemon. So it is just a small server that is hosted on your device which allows communication from the Computer/Laptop and Android Device using a command line interface.
Why would one use this Method?
One might use this method as a workaround from using the Package Manager present in the device. One can also use it if an application is causing issues and your launcher keeps crashing. This method is quite stable and is easy when once learns the simple commands.
Tools that is required for this Method:
A functioning Laptop & Computer, A working internet connection, USB cable that is used to connect the Android Device to the Computer/Laptop.
Installing ADB on the Computer/Laptop
The first part of the method is to install ADB on the Computer/Laptop.
Step One – Download the ADB tool from the official Google SDK site. Check which operating system you are using, (https://developer.android.com/studio/releases/platform-tools). For this example we are using Windows as a test setup.
Step Two: When the files are downloaded as a .zip file after agreeing to the Terms and Conditions present on the Website, place it on the Desktop and then use a tool like WINRAR or 7-Zip to extract the files to a single folder so it does not cause any sort of confusion.
Step Three: After the folder is extracted, rename the folder to ADB so it’s easily identifiable. Double click on the Folder and open it. That is the ADB tool that we will require for this job.
Enabling Developer Mode and USB Debugging:
Step one: Navigate to Settings of your Android Device and open it.
Step two: Scroll down to About Device, and open it. Find the build number and tap on it for 7 times, after which a small prompt appears that you have enabled the Developer Mode.
Step Three: Find the Developer mode in the settings after its been enabled, Find the option of “USB Debugging”. Turn the Setting on. Voila now your device has access to Developer Settings that will be used in this Method.
Installing an .APK using ADB:
The first requirement is to download the correct APK from the third party websites after checking if your device is x64 or x86 or ARM. This is important otherwise the application might not install correctly and might cause the device to crash.
Step one: You will be seeing a number of files. Leave them as it is for now and connect your device after enabling the USB Debugging option as given above. Make sure all the drivers for your device are installed and keep the phone unlocked and awake for the whole process. This is important as we will learn later.
Step Two: Open the Command Prompt in the ADB Folder on the desktop using a combination of Right Click+Shift and then selecting “Open Command Prompt Here” in the ensuing Menu. For users of Windows 10, the option would be “Open PowerShell Here”.
Step Three: Enter “adb devices” in the Command prompt, without any quotes. Now a prompt will appear on the phone asking to “Allow USB debugging” Check the option to remember the Computer and select “Yes”.
Step Four: Check the output of the command if it says the name of your device with a port number i.e.
List of devices attached
It means that the device is successfully connected and is ready for the procedure.
Step Five: Drag the APK file to the adb folder and copy the name of the .APK so you will not make any mistakes. Enter” adb install app_ name.apk” Replace the app name with the .APK name of your file and remove the quotation marks and press Enter. Give it some time and see the result, if it says “Success”, it means the APK has been successfully installed on your phone.
Step Six: If you want to update an existing application, use “adb install –r app_name.apk” Replace the app name with the .APK name of your file and remove the quotation marks and press Enter. If the command shows success, it means the application was successfully installed on your phone. If you want an application to be installed on your SD Card use “adb install -s app_name.apk”, Replace the app name with the .APK name of your file and remove the quotation marks and press Enter.
Uninstalling an .APK using ADB
Uninstalling an Application can be a bit tricky. Follow the Steps one to four in the section of installing an .APK using ADB. These steps will remain similar for uninstalling without any changes.
Step one: In the Command Prompt Enter, “adb uninstall app_name.apk” Replace the app name with the .APK name of your file and remove the quotation marks and press Enter. If the prompt shows Success, it means the Application was successfully uninstalled from the device.
Step Two: If you want to keep the data and cache directories around after uninstall, use “adb uninstall -k app_name.apk”, make sure to Replace the app name with the .APK name of your file and remove the quotation marks.
Common Errors made during the method:
Device does not show up after executing the “adb devices command”
This error usually occurs if the Device’s driver is not installed correctly; use Windows Update or the manufacturer’s website to reinstall the device drivers. Another error might be if the phone is not connected correctly to the Computer/Laptop. Check if you turned on USB Debugging otherwise the device will not show up.
Errors while using PowerShell instead of Command Prompt
While using Windows 10, you will be using Windows PowerShell instead of Command Prompt which is a tad bit different, if “adb : The term ‘adb’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ adb devices
+ CategoryInfo : ObjectNotFound: (adb:String) , CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3, General]: The command adb was not found, but does exist in the current location.” Sort of error shows up, instead of using “adb devices”, use “.\adb devices”.
This method is quite useful if one needs to install application without any glitches and issues. The method is quite easy and is quite useful in emulator environments while testing an application.