Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & Accessibility Testing
No Result Found

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.

Important: The App Patching feature is available only to Enterprise customers.

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.

Note: You should not enable camera injection or biometric auth feature before starting the session.

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.
Note: After getting instrumented app, complete the following steps:
  1. After you receive the instrumented app,patched_app.apk, from BrowserStack support, you must sign the app with your certificates.
  2. After signing the app, you can upload the app and start the App Live session.
Ensure that you disable Biometric Authentication, Image Injection and Remove Screenshot Block options after uploading the app. The instrumented app process fails if these options are not disabled.

Sign Your Instrumented App

Prerequisites:

To sign the instrumented app, complete the following steps:

  1. 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>
    
  2. 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





Thank you for your valuable feedback

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle