Skip to content

feat: Added support to cleanup apps#1999

Merged
saikrishna321 merged 3 commits intomainfrom
fix-cleanup-apps
Dec 12, 2025
Merged

feat: Added support to cleanup apps#1999
saikrishna321 merged 3 commits intomainfrom
fix-cleanup-apps

Conversation

@saikrishna321
Copy link
Copy Markdown
Member

This pull request introduces a device cleanup feature that enables automatic uninstallation of specified apps from Android and iOS devices after a session ends. It adds configuration options for specifying which apps to uninstall, implements the uninstall logic in both Android and iOS device managers, and integrates the cleanup process into the plugin lifecycle. Additionally, there are minor dependency and test updates.

Device cleanup feature:

  • Added new configuration options androidCleanUpApps and iosCleanUpApps to IPluginArgs, package.json schema, and set defaults in DefaultPluginArgs to allow users to specify apps to uninstall after sessions. [1] [2] [3]
  • Extended the IDeviceManager interface and implemented uninstallApp methods in both AndroidDeviceManager and IOSDeviceManager to handle app uninstallation logic for real devices and simulators. [1] [2] [3]
  • Integrated the cleanup process into the plugin's session deletion flow: after a session ends, the plugin checks for configured cleanup apps and invokes the uninstall logic for the respective platform/device.

Codebase and dependency updates:

  • Updated imports and exports for device managers to support direct access to AndroidDeviceManager and IOSDeviceManager. [1] [2]
  • Added deviceFarmCapabilities property to the IDevice interface to support per-device cleanup configuration.
  • Updated submodules and test configuration for consistency and to support the new features. [1] [2] [3] [4]

These changes collectively enable flexible and automated device cleanup, improving the reliability and hygiene of device sessions in the device farm.

Usage in Capabilities

    androidCleanUpApps: [
      'com.vodqareactnative',
      'com.wdiodemoapp',
      'io.appium.uiautomator2.server',
      'io.appium.uiautomator2.server.test',
    ],
    iosCleanUpApps: ['com.apple.xx', 'com.apple.tt'],

ServerArgs can also be used

{
  "server": {
    "port": 31337,
    "plugin": {
      "device-farm": {
        "platform": "both",
        "skipChromeDownload": true,
        "iosDeviceType": "real",
        "liveStreaming": true,
        "androidCleanUpApps": [
          "com.vodqareactnative",
          "com.wdiodemoapp"
        ],
        "iosCleanUpApps": [
          "org.reactjs.native.example.VodQAReactNative"
        ]
      }
    }
  }
}

cc: @SubbuLomada

saikrishna321 and others added 3 commits December 12, 2025 21:03
Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com>
Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com>
Co-authored-by: SrinivasanTarget <srinivasan.sekar1990@gmail.com>
@saikrishna321 saikrishna321 merged commit bbac6ec into main Dec 12, 2025
4 of 5 checks passed
@saikrishna321 saikrishna321 deleted the fix-cleanup-apps branch December 12, 2025 16:05
saikrishna321 pushed a commit that referenced this pull request Dec 12, 2025
## [11.3.0](v11.2.15...v11.3.0) (2025-12-12)

### Features

* Added support to cleanup apps ([#1999](#1999)) ([bbac6ec](bbac6ec))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 11.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant