Testing Secured Android Apps Using Espresso, Mobile DevSecOps Best Practices

Last updated June 14, 2021 by Appdome

Learn how Android developers can re-use an automated test they wrote for the 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

 

 

 

NEED HELP?

let's solve it together

LironMaking your security project a success!
By filling out this form, you opt-in to recieve emails from us.