I published a private app in closed tracks to my own organization using Play Console, explained here.
Under Pricing & distribution -> User Programs -> Managed Google Play it says:
This app is privately targeted to 1 organization.
You can also target app releases in closed tracks to organizations. Manage closed tracks or Learn more
Under Release management -> App Releases -> Manage testers I added my organization.
Still, when setting my app to force install in my Android Management Api policy for my devices, my private app won't get installed and is also not visible to my dedicated devices using that policy.
Previously, I published a private app as a production release to my organization and everything works like a charm. So what exactly do I have to do to target my organization in a closed track release?
I realised that you just have to add the "releaseTrackId", which can be found in the URL of the Play Console page that displays the app’s track information, to my application json object inside the policy. As it says here and here
List of the app’s track IDs that a device belonging to the enterprise can access. If the list contains multiple track IDs, devices receive the latest version among all accessible tracks. If the list contains no track IDs, devices only have access to the app’s production track. More details about each track are available in AppTrackInfo.
So basically in my applications array in the particular policy I just had to add the "releaseTrackId" of my closed track app in the "accessibleTrackIds" array.
"applications": [
{
"packageName": "some.package.com.closedtrackapp",
"installType": "FORCE_INSTALLED",
"accessibleTrackIds": [
"myreleaseTrackId"
]
}
],