I hope, All of you aready know how to install or uninstall app in real android device. But If you wants to work with android emulators for manual or automation testing, You must be aware about how to install or uninstall android applications in android emulators. Here I am present steps of how to install android app or uninstall any android app from android virtual device(Emulator).
PREREQUISITES :
- All PREVIOUS 14 STEPS of appium tutorial should be executed without any error.
- Android emulator should be created as described in THIS POST.
- .apk file should be available in your PC which you wants to install in emulator. Here I am installing APK Info android application. So have it's source file com.intelloware.apkinfo.apk in my PC to install it in emulator. You can download it from Google Play Store or THIS PAGE.
Steps to Install APK in Android Emulator
- Launch android emulator. Wait till it starts properly as shown bellow
- Open platform-tools folder of SDK. For me It is located at E:\SDK\platform-tools. View THIS POST to know more about SDK folder.
- Copy-paste com.intelloware.apkinfo.apk (Which you wants to install in emulator) file in platform-tools folder.
- Navigate to platform-tools folder in command prompt. In platform-tools folder, Press keyboard's CTRL+Shift+Mouse Right Click. It will open right click context menu as shown in bellow image. Select Open command window here option from context menu.
- It will open command prompt with navigation to platform-tools folder.
- Run adb install com.intelloware.apkinfo.apk in command prompt.
- Note : Here, com.intelloware.apkinfo.apk Is APK file name. You need to replace it with your APK file name if you are installing any other app.
- It will start installing app in emulator. It will show message Success after installation of app.
- Now you can verify app is installed or not in your android emulator. Navigate to main menu in emulator screen. New installed app APK Info will display there on emulator screen as shown bellow.
Steps to Uninstall APK From Android Emulator
App uninstall process from emulator is similar to installation process from command prompt. There are two ways to uninstall app from android emulator.
1. Uninstall App Manually From Emulator Interface :
It is same as you uninstall app from your android device.
- Go to Settings of Emulator.
- Tap on Apps.
- Tap on App which you wants to uninstall.
- Click on Uninstall button. It will uninstall app from emulator.
Verify your app will be uninstalled from emulator.
2. Uninstall App Using Command Prompt
To uninstall app using command prompt,
- Open command prompt and navigate to platform-tools folder in it.
- Run command adb uninstall com.intelloware.apkinfo in command prompt.
- When app get uninstalled, It will show you message Success. That means app is uninstalled from your emulator. You can verify it in your emulator.
This way you can install and uninstall any app in your emulator.
We can run adb command from any where no need go to platfrom/tools folder.
ReplyDelete-Open CMD, go to apk location and run install command.
-Ex.
>> cd C:\Users\ABC\Downloads
>>adb install 11.22.16_Build.apk
True
ReplyDelete