Skip to content

Get Installed Apps

Summary

  • Internal name: GetInstalledApps
  • Category: Package Manager
  • Purpose: List all applications installed on the device as a JSON array. Each entry contains the package name, label, version, and system/enabled flags.
  • Task type: Normal

Compatibility

  • Minimum AndroMate version: 1.1.0

  • Maximum AndroMate version: 1.1.0

  • Minimum Android: Android 13 (API 33)

  • Maximum Android tested: Android 16 (API 36)

  • Required permissions: QUERY_ALL_PACKAGES


Detailed description

The Get Installed Apps task enumerates every package on the device via PackageManager.getInstalledPackages() and produces a JSON array. System apps are excluded by default; enable include_system to include them.

The output is lightweight — it does not read the APK size per app (which would require file-system access for every package), keeping the task fast even on devices with hundreds of apps.

Since Android 11 (API 30), apps cannot enumerate other packages by default (package visibility filtering). AndroMate declares the QUERY_ALL_PACKAGES permission so the full list is visible.


Input parameters

Parameter Type Required Possible values / Rules Android Compatibility AndroMate Compatibility Default
include_system Boolean No true to include pre-installed system apps Android 13 (API 33) → Android 16 (API 36) 1.1.0 → 1.1.0 false

Output parameters

Field Type Trigger condition Android Compatibility AndroMate Compatibility Default
json_array_output JSON Array Always on success — array of installed app objects Android 13 (API 33) → Android 16 (API 36) 1.1.0 → 1.1.0 <ANDROMATE_NULL_VALUE>

Array element structure

Each element of json_array_output has the following shape:

{
  "packageName": "com.whatsapp",
  "appName": "WhatsApp",
  "versionName": "2.24.1",
  "versionCode": 24001,
  "isSystemApp": false,
  "isEnabled": true
}

Exceptions

This task does not throw exceptions. If no apps match, an empty JSON array is returned.


Execution flowchart

flowchart TD
    Start([▶ GetInstalledApps]) --> List[📦 getInstalledPackages]

    List --> Loop[🔁 For each package]

    Loop --> SystemCheck{System app and\ninclude_system = false ?}

    SystemCheck -->|Skip| Loop
    SystemCheck -->|Keep| Build[🧩 Build JSON object\npackage, name, version, flags]

    Build --> Loop

    Loop --> Store[💾 Set json_array_output\nJsonArrayTaskResult]

    Store --> Success([✅ JsonArrayTaskResult])

    style Start fill:#e3f2fd
    style Success fill:#c8e6c9
    style List fill:#fff9c4
    style Build fill:#f3e5f5
    style Store fill:#c8e6c9

How it works:

  1. List: getInstalledPackages() returns all packages
  2. Filter: system apps are skipped unless include_system is true
  3. Build: a JSON object is built for each app (package, label, version, flags)
  4. Store: the JSON array is written to json_array_output
  5. Result: returns JsonArrayTaskResult

Code examples

Example 1 — List user apps only

{
  "GetInstalledApps": [
    {
      "id": "1",
      "title": "List user apps",
      "include_system": false,
      "json_array_output": "$apps"
    }
  ]
}

Example 2 — Include system apps

{
  "GetInstalledApps": [
    {
      "id": "2",
      "title": "List all apps",
      "include_system": true,
      "json_array_output": "$all_apps"
    }
  ]
}

Input parameter details

include_system — Include system apps

Controls whether pre-installed system apps appear in the result.

  • false (default): only user-installed apps are listed
  • true: system apps (those with FLAG_SYSTEM) are also included
  • Supports variable interpolation (e.g. $with_system)

Output parameter details

json_array_output — Installed apps list

Stores the full list of installed apps as a JSON array in the specified workflow variable. Each element is an object:

Key Type Description
packageName String Package identifier (e.g. com.whatsapp)
appName String Display label (e.g. "WhatsApp")
versionName String Human-readable version (e.g. "2.24.1")
versionCode Number Integer version code (e.g. 24001)
isSystemApp Boolean true if a pre-installed system app
isEnabled Boolean true if the app is enabled

The array can be further processed with the JSON Object Operation task (e.g. read its size, iterate, extract a field).


Complete JSON example

{
  "GetInstalledApps": [
    {
      "id": "1",
      "title": "Get Installed Apps",
      "include_system": false,
      "json_array_output": "$INSTALLED_APPS"
    }
  ]
}