Skip to content

Feature Request: device-upgrade command for device-installed app updates #89

@benedictjohannes

Description

@benedictjohannes

Summary

Add a new subcommand, device-update (or device-upgrade), that uses a connected device's internal package metadata to identify and install pending updates specifically for apps originally managed by F-Droid.

Motivation

Currently, fdroidcl install -u requires an app ID or a manual list. For users with multiple devices, upgrading "everything" currently requires an "involved" workflow:

  1. Running fdroidcl scan to find what's there.
  2. Manually piping or scripting that list into fdroidcl install.
  3. Managing the "Hybrid Install" risk where F-Droid might try to overwrite a Play Store version of the same app (which fails due to signatures but wastes time/bandwidth).

A device-driven approach removes this friction by letting the phone's own "Installer" metadata act as the filter. This would allow fdroidcl to act as a desktop-powered Update All functionality currently available in F-Droid Android client, which would add a significant value as Google's identification policy make on-device sideloading increasingly cumbersome.

Proposed Implementation

1. Command Workflow

  • Step A (Device Selection): * If ANDROID_SERIAL is set, use it. If multiple devices are detected and no serial is provided, offer a simple interactive picker (TUI) to select the target.

  • Step B (The "Installer" Filter): * Run adb shell pm list packages -i and filter for lines containing installer=org.fdroid.fdroid. This ensures we only attempt to update apps that the user has intentionally placed on the F-Droid track.

  • Step C (Delta Comparison): * Compare the versionCode of the filtered device packages against the local fdroidcl index.

  • Step D (Batch Execution): * Download and execute adb install -r -i org.fdroid.fdroid for the identified updates.

2. Proposed CLI Interface

# Standard usage: auto-selects if one device is connected
$ fdroidcl device-update

# Example output with interactive picker:
# ? Select device:
# > [RFCT...] Samsung S25 Ultra
#   [TAB9...] Samsung Tab S9 Plus

# Result:
# [✓] org.journiv.app: 1.0.2 -> 1.0.5
# [✓] org.syncthing.android: 1.27.2 -> 1.27.3
# Done. 2 apps updated.

# Exclude specific apps via substring match
$ fdroidcl device-update -e syncthing -e "work.app"

# Update the index before performing the update
$ fdroidcl device-upgrade -u

# Override the default org.fdroid.fdroid installer filtering
$ fdroidcl device-upgrade -i org.fdroid.basic

Technical Details

  • Exclusion Logic: The -e flag should support multiple instances and perform a case-insensitive substring match against the package ID.
  • Installer Preservation: Using the -i org.fdroid.fdroid flag during the adb install phase is recommended to maintain the "Installer" metadata on the device for future cycles.
  • TUI: For the device picker, utilizing a lightweight TUI library (or simply mimicking the existing devices output with an index) would keep dependencies minimal.

I'll be happy to contribute a PR to implement this functionality if this direction align with the project's goals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions