Sideload MDX-enabled apps for development

Introduction

During the development phase, you might need to test a debug build of your app on enrolled devices. As discussed in the section about distributing MDX-enabled applications, you must upload the APK file to the Managed Google Play Store. However, Google only allows you to upload the release build of your APK file – MDX-enabled, or otherwise – to the Managed Google Play Store. So, to distribute the debug build of your app, you must upload the release build of the APK file onto the Managed Google Play Store, and sideload the debug build of the APK onto the device using ADB.

Pre-requisites

Before you proceed, ensure that you have met the following prerequisites:

  • Access to Citrix Endpoint Management environment to upload your .mdx and .apk files and to publish the app.

  • Android Enterprise needs to be enabled and set up in this environment. For more details, see setting up Android Enterprise.

  • You have successfully built your MDX-enabled app and have a signed .apk file of both build types - “Release” and “Debug”.
  • You have already generated a .mdx file using the release APK, either manually or by making the necessary changes to the build.gradle files of your project.

    Note: It is imperative to use the same certificate that you signed your APK with when generating the MDX file.

  • You have the device plugged-in in USB Debugging mode.
  • ADB is installed on your machine.

Sideload an MDX-enabled app

  1. Add a Restrictions Policy to your chosen delivery group which has the following policies turned ON.
    • Allow VPN configuration
    • Allow USB debugging
    • Allow non-Google Play apps

    Restriction Policy

  2. Publish the release build of your app as you would do for Android Enterprise by following the steps in the page Distributing MDX-enabled Apps.

  3. Enroll your device so that the work profile is created. Install the release build of your app by following the steps in the page Test your app - Android Enterprise.

  4. Find the work profile user-id by running the following command:

    Note: In the following snippet, the work profile user id is 16.

       user@User-MacBook-Pro release % adb shell pm list users
       * daemon not running; starting now at tcp:5037
       * daemon started successfully
       Users:
           UserInfo{0:Owner:c13} running
           UserInfo{16:Work profile:1030} running
     <!--NeedCopy-->
    
  5. Finally, sideload the debug build of your app into the work profile by running the following command:

     user@User-MacBook-Pro debug % adb install --user 16  <path to app-debug.apk>
     Performing Streamed Install
     Success
     <!--NeedCopy-->
    
  6. Your app is accessible through the work profile.

    Work Profile

Sideload MDX-enabled apps for development