Installing an app

In addition to installing an app through Android Studio or the emulator UI, you can install your app on a virtual device by using the adb utility.

To install an app by using adb, and then run and test the app, follow these general steps:

1.      Build and package your app into an APK as described in Build and Run Your App.

2.      Start the emulator from the command line as described in the previous section, using any startup options necessary.

3.      Install your app using adb.

4.      Run and test your app on the emulator.
While the emulator is running, you can also use the 
Emulator Console to issue commands as needed.

5.      The virtual device preserves the app and its state data across restarts, in a user-data disk partition (userdata-qemu.img). To clear this data, start the emulator with the -wipe-data option or wipe the data in the AVD Manager, for example. For more information about the user-data partition and other storage, see the following section.
To uninstall an app, do so as you would on an Android device.

 

Note: The adb utility sees the virtual device as an actual physical device. For this reason, you might have to use the -d flag with some common adb commands, such as install. The -d flag lets you specify which of several connected devices to use as the target of a command. If you don't specify -d, the emulator targets the first device in its list.