Search code examples
androidandroid-management-api

How do accessible track ids get applied to app using Android Management API


I'm using the Android Management API to provision kiosk tablets. I'm going through app testing - note that I'm using managed google play, and that this app is tied to an organization. I was able to provision via QR code, it downloaded the app to all of our devices (we have a separate policy per device). This all went swimmingly, really appreciate everyone that worked on this... it has made my life easier!

I didn't realize during this process that you could specify track id's; I had just pushed the app to the production track. Going forward, I want to provision devices with either alpha, beta, or internal app testing tracks. I did a release for internal 3 days ago, and a release for alpha and beta respectively yesterday. I created a new policy for a new test device and specified the track ids. I've done one id a time, just wanting to test that it downloads the app version from the track, and have also done it where I have specified all 3 track ids in the policy. No matter, it keeps downloading the version that I have on production track. For reference, the prod. version code is 5 @ 0.1.3, and the other 3 tracks are all higher version codes: Internal, 7 @ 0.1.4; Alpha, 10 @ 0.1.4, and Beta, 9 @0.1.4.

Am I misunderstanding how all of this is supposed to work? I'm wondering if perhaps not enough time has passed, that maybe the app's track info is just not updated yet. When I query enterprises.applications.get for the app, the appTracks[] are empty.

Side note, if I try to set a min. version code that is > 5, I get this error message: "Invalid minimum version code 7 for <app_name>. The published version code is 5".

  1. How and when will my app get updated with the track releases I've created?
  2. When the app does get the track updates, am I doing this correctly via the policies?
  3. Once I'm able to provision an app that corresponds to the track, am I still bound by the 'published' version code? Meaning, if my test tracks are of a higher version code, can they be recognized and a higher minimum set for these these tracks on the policy?

Hope this is all clear enough; I could be misunderstanding. I appreciate any help.


Solution

  • For the release tracks to be available to your organization, you have to add the enterprise ID in the track under Manage testers > Organizations. For reference, you can check this link under Add organizations to the test section.

    Once the track is added, it should be shown in the appTracks[] when calling enterprises.applications.get.

    Track ID is added under Application Policy with the accessibleTrackIds field.

    Your policy should look similar to this one:

    {
                    "packageName": "this.is.an.app",
                    "installType": "FORCE_INSTALLED",
                    "accessibleTrackIds":[
                        "XXXXXXXXXXXXXXXXXX"
                    ]
                }
    }