Android App Patching
App Live enables customers to use sensor instrumentation features, such as biometric authentication without getting their app resigned by BrowserStack, thus preventing authentication issues or invalid certificate issues during testing on BrowserStack devices.
In this guide, you will learn about :
Why you need App Patching
As an enterprise customer, you might encounter webpage errors and other issues while using biometric feature on BrowserStack devices. Since BrowserStack instruments your app and resigns it with BrowserStack certificate, the app is treated as an invalid during app testing, thus leading to app crashes.
Using the Android App patching feature, you can convert the original app to an instrumented app and use the sensor instrumentation features such as Biometrics. In this process, you use a BrowserStack endpoint where you can upload an unsigned original app and receive the instrumented app as the response. After app patching instrumentation, your app can use the sensor instrumentation features on BrowserStack devices without any error.
Use App Patching for Android Apps
You must use the BrowserStack endpoint to patch your app, and then sign the app with your own certificate, thus resolving any issues that occur from app resigning.
App instrumentation involves:
a) Uploading an unsigned app (.apk) file to the BrowserStack endpoint and getting the instrumented app(. apk) file.
b) Signing the instrumented app with your certificates
c) Uploading the signed instrumented app to BrowserStack for using the sensor instrumentation features.
Get instrumented app
- Contact BrowserStack support to access an endpoint that you can use to get your app instrumented. You can save the instrumented app,
new-path.apk
, in a directory.
- After you receive the instrumented app,patched_app.apk, from BrowserStack support, you must sign the app with your certificates.
- After signing the app, you can upload the app and start the App Live session.
Sign Your Instrumented App
Prerequisites:
- android build-tools installed on your machine.
- Keystore or certificates from your developer.
- Access to Keystore credentials, which are alias, keystore password, and key password.
To sign the instrumented app, complete the following steps:
-
In your command line tool, open the directory where you have installed
android-build-tools
, and run the following command:zipalign -p 4 <path-to-patched-apk> <new-path.apk>
-
Sign the app with the keystore using the following command:
# command if you are using keystore apksigner sign -v —ks <path-to-keystore> —ks-key-alias <alias> —ks-pass pass:<password> <new-path.apk> # command if you are using certificates apksigner sign --key release.pk8 --cert release.x509.pem <new-path.apk>
After you sign the instrumented app, the apksigner
tool returns the signed instrumented app, new-path.apk
. You can upload this app as an Enterprise user and run your tests.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!