NOTE: This web site is out of date. This is the course web site from a past quarter, Winter 2015. If you are a current student taking the course, this is not your class web site, and you should visit the current class web site instead at http://cs193a.stanford.edu/. If you are already at cs193a.stanford.edu, the web page may not be updated yet for the new quarter. Please be advised that courses change with each new quarter and instructor. Any information on this out-of-date page may not apply to you this quarter.

Installing a .APK App Archive into Your Phone or Virtual Device

last updated Thu 2015/01/15

Android apps can be distributed as archive files with the .apk extension. These archives can be installed onto your Android hardware device and/or onto the Android virtual devices (AVDs) you have created in the emulator.

To install an APK, first download the APK onto your computer. Then go to Android Studio. Launch your virtual device through the AVD Manager so that it is up and running.

In the top menu bar of Android Studio, click Tools, then click Open Terminal. A console window should appear in the bottom area of Android Studio. Click your mouse into this area so that you can type into it. You should type:

adb install /full/path/to/fileName.apk

For example, on a Windows machine you might end up typing something like:

adb install C:\Users\JSmith\Desktop\Example24.apk

On a Mac, it might look something like this:

adb install /Users/JSmith/Documents/Example24.apk

If you see an error about "device not found", you may not have started up your virtual device properly.

If you see an error about the adb command being not recognized, you may not have the ADB utility installed on your computer. Go to the Android SDK Manager from within Android Studio and under Tools, find the entry for ADB. Check its box and click Install Update.

This document and its content are copyright © Marty Stepp, 2015. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the authors' expressed written permission.