Appendix: Find an APK and Install the App¶
If you would like to execute Apptests using a different app, the following instructions show you how to find the APK for this app. For example, an app that you download from the Play store or one that is already on your phone. Once again, we will use the Selendroid Test App as an example.
1. Find the APK¶
Get the APK file (also called a package
) using the adb
tool, which comes with the Android SDK.
Open the command line and enter the following:
1 | adb shell pm list packages |
The output displays a long list of packages installed on your phone. Search for io.selendroid.testapp
, which is the app we will be using. selendroid
is the name of the provider and testapp
is the app's name. When searching for other packages, they follow a similar provider/app name format.
Note |
---|
If the adb commands do not work, it may be because you did not Set the Environment Variables. |
2. Get APK onto Your PC¶
Find the location of the app on the phone by entering the following command into the command line:
1 | adb shell pm path io.selendroid.testapp |
Copy the returned path and enter the following, replacing <path-to-apk>
with the copied path:
1 | adb pull <path-to-apk> |
This will create a file named "base.apk" in the directory where you have issued the command from. Rename the file to the package name and include also some version information in the name as you might test a newer version of it later in your project.