AndroidTestWithoutSource
AndroidTestWithoutSource copied to clipboard
AndroidTestWithoutSourceCode
This project demonstrates how to run Android instrumentation test without source code.
Without modifying anything, you can do instrument test for well-known ApiDemos. Step by Step:
- Build and install ApiDemos
- Build and install the APK file of this project
- Execute command adb shell am instrument -w -e class net.cmoaciopm.androidtest.TestWithoutSourceCode net.cmoaciopm.androidtest/android.support.test.runner.AndroidJUnitRunner
How to make it work to test other apps?
- Resign APK file that you want to test using your own signature file, then install the resigned APK to Android device
- Modify android:targetPackage in src/main/AndroidManifest.xml to the package that you want to test
- Modify ACTIVITY_TO_BE_TESTED in src/main/java/net/cmoaciopm/androidtest/TestWithoutSourceCode.java to the acitvity you want to test
- Build and install the APK file of this project
- Execute command adb shell am instrument -w -e class net.cmoaciopm.androidtest.TestWithoutSourceCode net.cmoaciopm.androidtest/android.support.test.runner.AndroidJUnitRunner
Checkout branch test_aws.apps.keyeventdisplay to see how to run test against KeyEvent Display(https://play.google.com/store/apps/details?id=aws.apps.keyeventdisplay)