How to Test Secured Android Apps Using Espresso

Last updated March 10, 2024 by Appdome

Learn how Android developers can re-use an automated test they wrote for a non-secured app using the Espresso automation tool (in Android Studio) and run it on the Appdome-secured app.

What is Espresso?

Espresso is a test automation tool for Android applications developed by Google. It enables developers and testers to write automated tests for the Android UI.

How to Test Appdome-secured Apps Using Espresso

Note: The tester must have the Espresso test apk and the target fused app apk to be tested. However, in order for the process to succeed, both Espresso test apk and the Appdome-secured app must be signed by the same developer/signer.

To run the Espresso automated test through a computer terminal follow these steps:

  1. Connect the phone to your computer using USB cable.
  2. Make sure the phone is reachable by Android Debug Bridge (adb):
    adb devices
  3. Install the Appdome-secured app (test target app) on an Android mobile device.
  4. On the computer run the following command:
    adb shell am instrument -w -m -e debug false \
    -e class ‘<YOUR_APP_BUNDLE_ID>.<YOUR_TEST_NAME>’ \
    <YOUR_APP_BUNDLE_ID>.test/android.support.test.runner.AndroidJUnitRunner

For example:
app bunder id: com.android.myapp
Espresso test name: myTest

adb shell am instrument -w -m -e debug false \
-e class ‘com.android.myapp.myTest’ \ com.android.myapp.test/android.support.test.runner.AndroidJUnitRunner

Related Articles

If you have any questions, please send them our way at support.appdome.com or via the chat window on the Appdome platform.

Thank you!

Thanks for visiting Appdome! Our mission is to secure every app on the planet by making mobile app security easy. We hope we’re living up to the mission with your project. If you don’t already have an account, you can sign up for free.

Appdome

Want a Demo?

Test Secured Mobile Apps

GilWe're here to help
We'll get back to you in 24 hours to schedule your demo.