deployidroid/usage.org

12 KiB

deployidroid <command> [Global Options] [args] [-h|--help]

Global Options:
    PKG, package name, such as org.fdroid.fdroid
    APP, application id, should be same with package name
    VERAPP, application that could special the version code, such as org.fdroid.fdroid, org.fdroid.fdroid=1007051
    DEVICEAPP, installed applications in android device
    APPLINE, the format is [user_x:]appid[:options]
      appid could be application id or special app name that defined in $backup_spec_apps
      if user field missing, it will be set to user_0
      for example org.fdroid.fdroid, user_0:org.fdroid.fdroid:type=app+data;repo=fdroid
    BACKUPAPPLINE, same format with APPLINE, and the app should be installed in device
    RESTOREAPPLINE, same format with APPLINE, and the app should be backup-ed in data dir
    -c, --config, special config file [default: '~/.config/deployidroid/config.sh']
    --cache-dir, special cache directory [default: '~/.cache/deployidroid']
    -u, --user, special user id, could set multiple times
      the value could be 'cur', 'current', 'sys', 'system', 'all' and the user id number
      if not specialized will action for all users
      for command new, it means generate apps list from special users
      for command restore, it means restore apps to special users, and no effect if --profile exists
      for command install, it means install apps to special users
      for command uninstall, it means uninstall apps from special users
    --no-color, remove colorful message
    -v, --verbose, show verbose message
    -vv, --verbose2, show more verbose message
    -V, --version, show version
    -h, --help, show help message

    ADB function options:
        --busybox, special busybox command in android
          could set the value to 'toybox' or 'busybox' command, if not set just use
          the sub-commands(cp, rm, tar, etc) that linked to system path
        --device-tmpdir, special tmpdir in android [default: '/data/local/tmp']
        --root-type, could be 'auto', 'su', 'adb-root' or 'none' (default: 'auto')
        -s, --serial, use device with given serial (overrides $ANDROID_SERIAL)

    Backup command options:
        --appdir, special application direcotory [default: './app']
        --archive-side, create and extract archive in device or host [default: 'auto']
          could be 'auto', 'device' and 'host'. Archive in device will save lots of time
          for the huge data, but 'tar' and 'gzip' commands requires in device.
        --name, profile name [default: 'default' or profile filename]
        -p, --profile, target profile file
        --password, encrypt the user data archive with password
          if set to '-', will read from input
        --options, override options in APPLINE, such as type=app+data;repo=fdroid
        --filter, only apply APPLINE that match the filter
          the format is [user_x:][keyword], such as user_0, org.fdroid.fdroid and user_0:org.fdroid.fdroid

    F-Droid command options:
        --allow-unstable, allow unstable application release
        -r, --repo, special repo, could set multiple times

Commands:
    adb <adb-wrapped-command>
        run adb wrapped commands, helps for debug work
    backup [--name name] [--password pwd] [--options options] [--filter filter] [--appdir dir] [--device-tmpdir dir] [--archive-side value] <--profile file.sh|BACKUPAPPLINE..|appinfo.sh..>
        backup android application and user data
    check [--fix] [--clean] [--copy-to dir] [--move-to dir] [--appdir dir] [dir|--profile file.sh]
        check backup app and data in special directory or profile
        --fix, fix incompatible issues if possible
        --clean, remove apk files that lost reference, only works without --profile
        --copy-to, copy the related app and data to another directory, only works with --profile
        --move-to, move the related app and data to another directory, only works with --profile
    cleanup [--options options] [--filter filter] [--disable] [--enable] <--profile file.sh|APPLINE..>
        cleanup applications from profile
        --disable, disable applications instead of uninstalling them
        --enable, enable applications instead of uninstalling them
    complete [--bash|--fish]
        generate command completion code for shell
        --bash, show completion code for bash
        --fish, show completion code for fish
    deploy [--options options] [--filter filter] <--profile file.sh|APPLINE..>
        deploy applications from profile
    download [-r|--repo name] [--allow-unstable] [--force-download] <VERAPP..>
        download applications
        if already exists, check the hash
        --force-download, always download application even through file exists
    install [-r|--repo name] [-u|--user id] [--allow-unstable] [--allow-downgrade] [--install-path dir] <VERAPP|APKFILE..>
        download and install applications
        --install-path, install system application to special directory [default: '/system/app']
        --allow-downgrade, allow downgrade application
    list [-r|--repo name] [--cat] [--desc] [--ver] [--sug] [--only-ver] [--allow-unstable] [--appid] [keyword|APP..]
        list matched applications
        --appid, use application id instead keyword
          the keyword support awk regexp syntax
        --cat, show and match for category
        --desc, show and match for application description
        --ver, show all application version details
        --sug, show suggest version
          only works for keyword or APP specialized
        --only-ver, show application versions only
    new [--profile-type type] [--3rd-app] [--3rd-data] [--sys-app] [--sys-data] [--freq-app] [--freq-data] [--spec-data] [--name name] [-u|--user id] [--appdir dir] [--device-tmpdir dir] <--profile file.sh>
        new template profile for different commands
        --profile-type, append different template code for different types, could set multiple times
          the value could be 'backup', 'restore', 'deploy' and 'cleanup'
        --3rd-app, backup 3rd application
        --3rd-data, backup 3rd application data
        --sys-app, backup system application
        --sys-data, backup system application data
        --freq-app, backup frequently used application which defined in $backup_freq_apps
          such as contacts, call logs
          (conflict with --sys-app and --sys-data)
        --freq-data, backup frequently used application data
        --spec-data, backup special data which defined in $backup_spec_apps
          such as user accounts, saved wifi access points
    restore [--name name] [-u|--user id] [--options options] [--filter filter] [--wait-sys-app seconds] [--default-install-path] [--appdir dir] [--device-tmpdir dir] [--archive-side value] <--profile file.sh|RESTOREAPPLINE..|appinfo.sh..>
        restore android application and user data, for multiple users, will create user if need
        --wait-sys-app, wait for new installed system app ready [default: 3]
        --default-install-path, install app to /data/app or /system/app instead of the defined install_path in appinfo.sh
    uninstall [-u|--user id] [--keep-data] <DEVICEAPP..>
        uninstall applications
        --keep-data, keep the data and cache directories after removal
    update [-r|--repo name]
        download fdroid repo index.xml file to cache direcotry
    upgrade [-r|--repo name] [-u|--user id] [--allow-unstable] [-l|--list] [DEVICEAPP..]
        upgrade applications
        if no application id specialized, will upgrade all applications
        -l, --list, only list all upgradeable applications

Adb Wrapped Commands:
    autoshell <command>
    check-online
    check-root
    chown-recursive <ownership> <path>
    clear-default-launcher [user-id] (user-id default: all users)
    clear-package <PKG> [user-id] (user-id default: all users)
    create-user <user-id> <user-name>
    disable <PKG-OR-COMPONENT> [user-id] (user-id default: all users)
    disable-autostart <PKG> [user-id] (user-id default: all users)
    disable-battery-optimization <PKG>
    disable-run-background <PKG> [user-id] (user-id default: all users)
    enable <PKG-OR-COMPONENT> [user-id] (user-id default: all users)
    enable-autostart <PKG> [user-id] (user-id default: all users)
    enable-battery-optimization <PKG>
    enable-run-background <PKG> [user-id] (user-id default: all users)
    ensure-user-exists <user-id> <user-name>
    fix-package-datadir-permission <PKG> [user-id] (user-id default: current user)
    fix-selinux-permission <path>
    get-android-abi-list
    get-android-api-level
    get-android-version
    get-current-user
    get-default-launcher [user-id] (user-id default: all users)
    get-file-timestamp <device-path>
    get-kernel-version
    get-package-datadir <PKG> [user-id] [apilevel] (user-id default: all users)
    get-package-display-name <PKG>
    get-package-path <PKG>
    get-package-uid <PKG> <user-id>
    get-package-version-code <PKG>
    get-package-version-name <PKG>
    get-user-name [user-id] (user-id default: current user)
    grant-location-permission <PKG> [user-id] (user-id default: all users)
    grant-permission <PKG> <permission> [user-id] (user-id default: all users)
    grant-storage-permission <PKG> [user-id] (user-id default: all users)
    has-root
    install <host-appfile> [user-id] (user-id default: all users)
    install-sys <host-appfile> [device-install-dir]
    is-3rd-package <PKG> [user-id] (user-id default: all users)
    is-cmd-exists <cmd>
    is-dir-exists <device-path>
    is-file-exists <device-path>
    is-mountpoint <path>
    is-mountpoint-ro <path>
    is-mountpoint-rw <path>
    is-online
    is-only-one-user
    is-package-installed <PKG> [user-id] (user-id default: all users)
    is-pm-support-multiuser [apilevel]
    is-support-multiuser [apilevel]
    is-sys-package <PKG>
    is-user-exists <user-id>
    kill-package <PKG> [user-id] (only kill background package, user-id default: all users)
    list-3rd-packages [user-id] (user-id default: current user)
    list-autostart-components [PKG]
    list-packages [user-id] (user-id default: current user)
    list-sys-packages
    list-users
    make-pkg-installed-for-user <PKG> <user-id>
    pull <device-path> <host-path> [use-tmpdir]
    push <host-path> <device-path> [use-tmpdir]
    remount-ro <path> remount /system or /vendor as read and write
    remount-rw <path> remount /system or /vendor as read and write
    remount-system-ro remount /system as read only
    remount-system-rw remount /system as read and write
    revoke-location-permission <PKG> [user-id] (user-id default: all users)
    revoke-permission <PKG> <permission> [user-id] (user-id default: all users)
    revoke-storage-permission <PKG> [user-id] (user-id default: all users)
    rootshell <command>
    set-default-launcher <activity> [user-id] (user-id default: all users)
    set-file-timestamp <device-path> <seconds>
    shell <command>
    start-package <PKG>
    stop-package <PKG> [user-id] (user-id default: all users)
    uninstall <PKG> [user-id] (user-id default: all users)
    uninstall-sys <PKG>

Usage:
    deployidroid update
    deployidroid list fdroid
    deployidroid list --cat --desc --ver --sug --appid org.fdroid.fdroid
    deployidroid install org.fdroid.fdroid=1007051
    deployidroid backup org.fdroid.fdroid cf.vojtechh.apkmirror
    deployidroid restore --user 10 --user 11 org.fdroid.fdroid
    deployidroid restore --user 10 --user 11 ./data/default/user_0/org.fdroid.fdroid/appinfo.sh
    deployidroid new --3rd-app --3rd-data --freq-data --profile ./test.sh
    deployidroid backup --profile ./test.sh
    deployidroid restore --profile ./test.sh
    deployidroid check-backup .