Use image injection

Learn how to test your app camera using image injection, so you can ensure end-users can take photos or scan QR codes with your app.

Before you start

Enable image injection for your app with one of these options:

  • Enable Instrument application for camera injection when installing your app before you test your in-app camera (Android only).

  • Add Kobiton image injection SDK into your Android or iOS apps. Follow this guide for android, and this guide for iOS.

    Do not enable Instrument application for camera injection when installing an app that already has image injection SDK added.

Add an image to the library

To add an image to your injection library, select Image Injection, Set Simulated Image, then choose one or more .jpg, .jpeg, or .png files from your computer.

"A manual session with image injection open and the icon highlighted.

Remove an image from the library

To remove an image from your injection library, select the x icon in the corner of an image.

"A manual session with image injection open and the icon highlighted.

Inject an image

During a manual testing session, you can use the Kobiton portal to inject images into the camera view of your application. The portal provides the following buttons:

  • Set Simulated Image: Click the Set Simulated Image button to choose an image file from your computer.

  • Inject Image: Click the Inject button to inject the selected image into the camera view.

  • Clear Image: Click the Clear Image button to remove the uploaded images from the portal.

  • Reset Camera: Click the Reset Camera button to reset the camera view.

To inject an image into your app, launch the app and open the in-app camera. Choose an image from the library, then select Inject.

A close-up of the image injection library containing one image.

When you’re finished, select Reset Camera to stop image injection.

Limitations

  • No image size in the image injection control’s UI.

  • Image injection via app instrumentation is only available for Android apps.

  • For app instrumentation, images cannot be injected into some Android applications due to the immense number of required libraries, we currently support the most common libraries. If you encounter issues, please contact our Support team through support@kobiton.com.

  • Inject the image after launching the camera. Injecting the image before launching the camera might crash the app.

  • It may take up to 5 seconds for the image injection process to complete.

  • The injected image is zoomed a little when in use, compared to the actual size.

Known issues

The Android application with custom SDK crashes when attempting to start the camera services.

Cause: The custom SDK utilizes hidden APIs from Android, which may not be turned on and cause the app to crash.

Solution: Enable a Cleanup Policy with Device settings will be reset option checked. If no Cleanup Policy is enabled, enter the following command in adb shell:

settings put global hidden_api_policy 1