App store apps are software that is installed directly from an external app store. Fleet currently supports
the Apple App Store (via [VPP](https://developer.apple.com/documentation/devicemanagement/managing-apps-and-books-through-web-services-legacy) apps (for macOS, iOS, and iPadOS hosts))
In-house apps are installed using the Apple MDM protocol similar to VPP apps.
- Fleet first sends an `InstallApplication` command with a `ManifestURL` key, which contains the Fleet `:title_id/in_house_app/manifest` endpoint, instead of an `iTunesStoreID` key.
- The host sends a request to that endpoint to get the manifest, which contains metadata and a download URL which is the `:title_id/in_house_app` endpoint.
- Fleet optionally cloudfront signs the download URL.
- The in-house app gets verified the same way as VPP installs, using `InstalledApplicationList`.
```mermaid
sequenceDiagram
autonumber
Note over Fleet,Host: Installation
Fleet->>+Host: InstallApplication Command
Host->>+Fleet: Get manifest
Fleet-->>-Host: App manifest
Host->>+Fleet: Get .ipa file
Fleet-->>-Host: Send .ipa file
Host->>-Host: Install app
Note over Fleet,Host: Verification
Fleet->>Fleet: Start timeout
loop Verification loop
Fleet->>+Host: InstalledApplicationListCommand
Host-->>-Fleet: Acknowledged<br/>[list of apps]
critical Check app status
option app in list, installed, exit:
Fleet->>+Fleet: Move status to "Installed"
option app not in list, timeout:
Fleet->>+Fleet: Move status to "Failed"
end
end
```
### Android app install
Android app installation works a bit differently than on other platforms. Fleet uses the Google Android Management API (AMAPI) which
sends one declarative "policy" to devices. When an Android app is added to a fleet, a job gets triggered to add this app to the policy
on relevant hosts with the InstallType set to "[AVAILABLE](https://developers.google.com/android/management/reference/rest/v1/enterprises.policies#InstallType)".
For each host, this job will send a request to [enterprises.policies.modifyPolicyApplications](https://developers.google.com/android/management/reference/rest/v1/enterprises.policies/modifyPolicyApplications) which will make the app available for download in the Play Store for that host, and record its result in the database.
Setup experience: currently, setup experience will add all relevant apps to a host's policy,
but with InstallType set to "[PREINSTALLED](https://developers.google.com/android/management/reference/rest/v1/enterprises.policies#InstallType)"
which will automatically install the app on the device.