Application.installMode not returning expected value on Android

Hello!

I have an app installed on an Android 9 device. The APK was sideloaded\installed from a Unity Build Automation link.

Under these conditions, I would have expected Application.installMode to return Adhoc or at the very least DeveloperBuild (although it’s not an actual debug\development build)

But it’s actually returning Store which seems wrong to me…

https://docs.unity3d.com/ScriptReference/Application-installMode.html

Could someone from Unity confirm if this is expected behaviour or a bug please?

Application.installMode is DeveloperBuild when GetInstallerPackageName is either a null/empty value or adb. Otherwise it returns Store.

Maybe, use Application.installerName to check if the application has been sideloaded by Unity Build Automation.

Hi @manugil

Thanks for the reply.

So for Android it can only be either DeveloperBuild or Store?

Surely sideloading should be counted as AdHoc?

Application.installerName is returning the following on a sideloaded build…

com.google.android.packageinstaller

Would that also be the case for apps installed from the App Store? (sorry, I can’t test that scenario right now)

My understanding is that from Google Play Store, apps should be installed by com.android.vending.

Thanks @manugil

So couldn’t\shouldn’t installMode be AdHoc (when installerName == “com.google.android.packageinstaller”) and Store (when installerName == “com.android.vending”)

I can always use that approach in code, but it seems better having installMode return a more representative value.

Just an idea anyway, thanks for the feedback.