{"id":13748552,"url":"https://github.com/patrickfav/uber-adb-tools","last_synced_at":"2025-08-20T18:32:28.825Z","repository":{"id":38360369,"uuid":"67927627","full_name":"patrickfav/uber-adb-tools","owner":"patrickfav","description":"A tool that enables advanced features through adb installing and uninstalling apps like wildcards and multi device support. Useful if you want to clean your test device from all company apks or install a lot of apks in one go.  Written in Java so it should run on your platform.","archived":false,"fork":false,"pushed_at":"2023-10-30T14:23:39.000Z","size":1931,"stargazers_count":164,"open_issues_count":4,"forks_count":25,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-12-07T09:50:26.105Z","etag":null,"topics":["adb","adb-commands","android","android-debug-bridge","apk","bugreport","cli","uninstall","wildcard"],"latest_commit_sha":null,"homepage":"https://favr.dev/opensource/uber-adb-tools","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickfav.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-11T12:04:35.000Z","updated_at":"2024-11-17T12:45:19.000Z","dependencies_parsed_at":"2024-01-07T06:49:57.389Z","dependency_job_id":"9acf167a-2e89-4d60-90e8-2185be528f1f","html_url":"https://github.com/patrickfav/uber-adb-tools","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickfav%2Fuber-adb-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickfav%2Fuber-adb-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickfav%2Fuber-adb-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickfav%2Fuber-adb-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickfav","download_url":"https://codeload.github.com/patrickfav/uber-adb-tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445926,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adb","adb-commands","android","android-debug-bridge","apk","bugreport","cli","uninstall","wildcard"],"created_at":"2024-08-03T07:00:44.070Z","updated_at":"2024-12-19T14:06:55.142Z","avatar_url":"https://github.com/patrickfav.png","language":"Java","funding_links":[],"categories":["Java","Debug"],"sub_categories":[],"readme":"# Uber Adb Tools for Android\nA simple tool that makes it more convenient to **install, uninstall and creating bug reports and more for multiple apps\non multiple devices** with one command. Additionally, uninstalling allows to use **wildcards as package name**. This is\nbasically a front-end for the [Android Debug Bridge (ADB)](https://developer.android.com/studio/command-line/adb.html)\nwhich is required to run.\n\n[![GitHub release](https://img.shields.io/github/release/patrickfav/uber-adb-tools.svg)](https://github.com/patrickfav/uber-adb-tools/releases/latest)\n[![Github Actions](https://github.com/patrickfav/uber-adb-tools/actions/workflows/build.yml/badge.svg)](https://github.com/patrickfav/uber-adb-tools/actions)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=patrickfav_uber-adb-tools\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=patrickfav_uber-adb-tools)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=patrickfav_uber-adb-tools\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=patrickfav_uber-adb-tools)\n\nMain features:\n\n* Process multiple apps with wildcard support for package matching (e.g. `com.android.*` or `com.android.*e`) for features like: uninstalling, stopping, starting, clearing and showing app info\n* Installing multiple apks from different locations with one command\n* All commands can be executed on all connected devices simultaneously\n* Fast and easy bug report features with screenshot, logcats, customizable dumpsys logs, pm and more\n* Starting custom activities to log additional information with bug report\n\nBasic usage:\n\n```bash\njava -jar uber-adb-tools.jar --install /folder/apks/\njava -jar uber-adb-tools.jar --uninstall com.your.packa*\njava -jar uber-adb-tools.jar --bugreport\n```\n\nMore features:\n\n```bash \njava -jar uber-adb-tools.jar --force-stop com.your.packa*\njava -jar uber-adb-tools.jar --clear com.your.packa*\njava -jar uber-adb-tools.jar --appinfo com.your.packa*\njava -jar uber-adb-tools.jar --start com.your.packa*\n```\n\nThis should run on any Windows, Mac or Linux machine,\n\n### Requirements\n\n* JDK 8\n* [Android Debug Bridge (ADB)](https://developer.android.com/studio/command-line/adb.html) set in `PATH`\n  or `ANDROID_HOME` is set (some default locations work also, see below)\n\n## Download\n\n**[Grab jar from the latest Release](https://github.com/patrickfav/uber-adb-tools/releases/latest)**\n\n### Using the *.exe Launcher\n\n![logo](misc/icon_sm.png)\n\n[Launch4J](http://launch4j.sourceforge.net/) is used to wrap the `.jar` into a Windows executable. It should\nautomatically download the needed JRE if required. If a single argument will be passed (i.e. a path) the tool will\nautomatically install if it is an `.apk` (or folder with apks), so you can use it to drag an `.apk` over the `.exe` or\nuse it to \"Open with...\" to automatically install an apk if double-clicked.\n\n## Demo\n\n[![asciicast](https://asciinema.org/a/91091.png)](https://asciinema.org/a/91091)\n\n## Command Line Interface\n\nThe documentation of all possible parameters\n\n```\n --adbPath \u003cpath\u003e                         Full path to adb executable. If this is omitted the tool tries to find\n                                          adb in PATH env variable.\n --appinfo \u003cpackage filter\u003e               Will show additional information for like version, install-time, etc of\n                                          the apps matching the argument. Argument is the filter string that has\n                                          to be a package name or part of it containing wildcards '*'. Can be\n                                          multiple filter Strings space separated. Example: 'com.android.*' or\n                                          'com.android.* com.google.*'.\n-b,--bugreport \u003cout folder\u003e                 Creates a generic bug report (including eg. logcat and screenshot) from\n                                          all connected devices and zips it to the folder given as arg. If no\n                                          folder is given tries to zips it in the location of the .jar.\n --clear \u003cpackage filter\u003e                 Will clear app data for given packages. Argument is the filter string\n                                          that has to be a package name or part of it containing wildcards '*'.\n                                          Can be multiple filter Strings space separated. Example: 'com.android.*'\n                                          or 'com.android.* com.google.*'.\n --debug                                  Prints additional info for debugging.\n --dryRun                                 Use this to see what would be installed/uninstalled on what devices with\n                                          the given params. Will not install/uninstall anything.\n --dumpsysServices \u003cservice-name\u003e         Only for bugreport: include only theses dumpsys services. See all\n                                          services with 'adb shell dumpsys list'\n --force                                  If this flag is set all matched apps will be installed/uninstalled\n                                          without any further warning. Otherwise a user input is necessary.\n --force-stop \u003cpackage filter\u003e            Will stop the process of given packages. Argument is the filter string\n                                          that has to be a package name or part of it containing wildcards '*'.\n                                          Can be multiple filter Strings space separated. Example: 'com.android.*'\n                                          or 'com.android.* com.google.*'.\n --grant                                  Only for install: will grant all permissions set in the apk\n                                          automatically.\n-h,--help                                   Prints docs\n-i,--install \u003capk file/folder\u003e              Provide path to an apk file or folder containing apk files and the tool\n                                          tries to install all of them to all connected devices (if not a specfic\n                                          device is selected). It is possible to pass multiple files/folders as\n                                          arguments e.g. '/apks apk1.apk apk2.apk'\n --keepData                               Only for uninstall: Uses the '-k' param on 'adb uninstall' to keep data\n                                          and caches of the app.\n --quiet                                  Prints less output.\n --reportDebugIntent \u003cpackage\u003e \u003cintent\u003e   Only for Bugreport: This is useful to start a e.g. activity that e.g.\n                                          logs additional info before reading the logcat. First param is a package\n                                          filter (see --uninstall argument) followed by a series of params\n                                          appended to a 'adb shell am' type command to start an activity or\n                                          service (See https://goo.gl/MGK7ck). This will be executed for each\n                                          app/package that is matched by the first parameter. You can use the\n                                          placeholder '${package}' and will substitute the package name. Example:\n                                          'com.google* start -n ${package}/com.myapp.LogActivity --ez LOG true'\n                                          See https://goo.gl/luuPfz for the correct intent start syntax.\n-s,--serial \u003cdevice serial\u003e                 If this is set, will only use given device. Default is all connected\n                                          devices. Device id is the same that is given by 'adb devices'\n --simpleBugreport                        Only for bugreport: report will only contain the most essential data\n --skipEmulators                          Skips device emulators for install/uninstall.\n --start \u003cpackage filter\u003e \u003c[seconds]\u003e     Will start the launcher activity of this app. Argument is the filter\n                                          string that has to be a package name or part of it containing wildcards\n                                          '*'. Can be multiple filter Strings space separated. Example:\n                                          'com.android.*' or 'com.android.* com.google.*'. The last argument may\n                                          be a int in seconds which represents the wait time between the apps eg.:\n                                          'com.exmaple.* 10' will have a 10 sec delay between starts.\n-u,--uninstall \u003cpackage filter\u003e             Filter string that has to be a package name or part of it containing\n                                          wildcards '*' for uninstalling. Can be multiple filter Strings space\n                                          separated. Example: 'com.android.*' or 'com.android.* com.google.*'.\n --upgrade                                Only for install: Uses the '-r' param on 'adb install' for trying to\n                                          reinstall the app and keeping its data.\n-v,--version                                Prints current version.\n --waitForDevice                          If set, will wait until a device is connected and debug mode is enabled.\n```\n\n### General\n\nTest what would happen with dryrun:\n\n```bash \njava -jar uber-adb-tools.jar --install /myfolder -dryRun\n```\n\nInstall/Uninstall only on a certain device by providing the device's serial (check `adb devices`):\n\n```bash \njava -jar uber-adb-tools.jar --uninstall com.your.packa* -s IUG65621532\n```\n\nSkip user prompt:\n\n```bash \njava -jar uber-adb-tools.jar --uninstall com.your.packa* --force\n```\n\nProvide your own adb executables:\n\n```bash \njava -jar uber-adb-tools.jar --bugreport --adbPath \"C:\\pathToAdb\\adb.exe\"\n```\n\nWait until device is connected:\n\n```bash \njava -jar uber-adb-tools.jar --uninstall com.your.packa* --waitForDevice \n```\n\n### Install\n\nIf the apk is already installed upgrade to new version while keeping the app's data:\n\n```bash \njava -jar uber-adb-tools.jar --install /myfolder/my-apk.apk --upgrade\n```\n\nOnly install a certain apk file (as opposed to installing all from a folder):\n\n```bash \njava -jar uber-adb-tools.jar --install /myfolder/my-apk.apk\n```\n\nProvide multiple files/folder\n\n```bash \njava -jar uber-adb-tools.jar --install /myfolder/my-apk.apk /otherfolder /apk1.apk\n```\n\n### Uninstall\n\nProvide more than one package filter:\n\n```bash \njava -jar uber-adb-tools.jar --uninstall com.your.packa* com.their.packa* com.third.*\n```\n\n#### Wildcard Support for Package Filter\n\nIt is possible to just use the full package name like using `adb uninstall com.mypackage.app`. \nTo take advantage of the enhance features wildcards are supported:\n\n    com.android.*\n \nWill match e.g. `com.android.app`, `com.android.app.maps`, `com.android.something `\nWill NOT match `com.android`, `org.com.android`\n\n    com.android.*e\n    \nWill match e.g. `com.android.app.service`, `com.android.elle`\nWill NOT match `com.android`, `com.android.app`\n\n    com.android.*.debug\n    \nWill match e.g. `com.android.app.service.debug`, `com.android.maps.debug`\nWill NOT match `com.android.debug`, `com.android.app`\n\nNote: Wildcard is not supported at the beginning of the package filter\n\n### Bugreport\n\nThe idea behind this is to get a smaller faster version of the default `adb bugreport` that is easier to read and understand as well as customizable and more practical for the \"every-day-bug\".\n\n#### Content\n\nA full bugreport will contain the following data:\n\n* a screenshot (downscaled if bigger than 2MB)\n* logcats (normal, radio and event)\n* some dumpsys services logs (either a default list is used or the ones provided with `--dumpsysServices`)\n* info from packagemanger (`adb shell pm ...`)\n* misc data like running processes\n\n#### Examples\n\nProvide your own dumpsys services\n\n```bash \njava -jar uber-adb-tools.jar --bugreport --dumpsysServices package nfc battery\n```\n\nOnly log the most essential\n\n```bash \njava -jar uber-adb-tools.jar --bugreport --simpleBugreport\n```\n\nProvide an activity intent to start before logcat will be pulled for request apps (packages) while using package\nplaceholder:\n\n```bash \njava -jar uber-adb-tools.jar --bugreport --reportDebugIntent your.package.* start -n ${package}/com.company.app.DebugLogActivity --ez HEADLESS true\n```\n\n#### Starting custom intents\n\nWhen using the `--reportDebugIntent` argument you first have to provide a package filter string (see uninstall) and then\na series of arguments describing the activity/service/etc. to start. These arguments are internally appended to\na `adb shell am ...` command, therefore use the same syntax, e.g. start to `start` an activity with intent params\nand `startservice` to start a service. For details on the intent syntax,\nsee https://developer.android.com/studio/command-line/shell.html#IntentSpec.\n\nAn example on how to use this:\n\n1. Create an activity that logs some custom code when a specific flag is set\n\n```java \npublic class DebugLogActivity extends AWalletActivity {\n...\n    private static final String KEY_HEADLESS = \"HEADLESS\"; //used with external programs\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        if (getIntent().getBooleanExtra(KEY_HEADLESS, false)) {\n            //TODO add custom log here\n            finish();\n        } else {\n            setContentView(R.layout.activity_layout);\n            //create here your activity as you normally would if you need ui\n        }\n    }\n...\n}\n```\n\nIn your AndroidManifest declare the activity as exported:\n\n```xml\n\n\u003cactivity\n        android:name=\".DebugLogActivity\"\n        android:label=\"@string/app_name\"\n        android:exported=\"true\"\u003e\n\u003c/activity\u003e\n```\n\nYou should now be able to access this feature with adb:\n\n```bash\nadb shell am start -n \u003cyour_application_id\u003e/\u003cyour_internal_package\u003e.AppInfoActivity --ez HEADLESS true\n```\n\nNote: `\u003cyour_application_id\u003e` is what you set in gradle as applicationId and `\u003cyour_internal_package\u003e` is your actual java package (they might be the same)\n\nNow we might have the problem when using multiple flavours, that you want to use this command on multiple apps - you can use a placeholder for this: `${package}` so the final bugreport call will look like:\n\n    java -jar uber-adb-tools.jar --bugreport --reportDebugIntent your.package.* start -n ${package}/com.company.app.DebugLogActivity --ez HEADLESS true\n\n### Additional Features\n\nClear app data \u0026 caches of all matching apps\n\n```bash\njava -jar uber-adb-tools.jar --clear com.example.*\n```\nForce stop all matching apps\n\n```bash\njava -jar uber-adb-tools.jar --force-stop com.example.*\n```\nShow app info (version, install time, etc.) of matched apps\n\n```bash\njava -jar uber-adb-tools.jar --appinfo com.example.*\n```\nStart all matching apps (launcher activity) with start delay of 9 seconds:\n\n```bash\njava -jar uber-adb-tools.jar --start com.your.packa* 9\n```\n\n### Process Return Value\n\nThis application will return `0` if every install/uninstall was successful, `1` if an error happens (e.g. wrong\narguments) and `2` if at least one part of an installation/uninstall process was not successful.\n\n### ADB Executable Location Strategy\n\nIf you provide a custom location to adb, the tool will try to use it. Otherwise, it will try to use the one provided by\nthe system, which requires adb to be set in `PATH` (See http://stackoverflow.com/questions/20564514 ). As a fallback, if\nthe tool does not find the adb in `PATH` it tries to check some default locations for the Android SDK. One of these\ndefault location checks involves checking if `ANDROID_HOME` is set, so if you don't want to set adb in `PATH`,\nuse `ANDROID_HOME` environment variable.\n\n## Used ADB commands\n\nThis tool uses the following adb commands:\n\n`adb devices -l`\nGathers the attached devices. May use the `-s` param with a device's serial.\n\n`adb shell \"pm list packages -f\"`\nList all installed packages. May use the `-s` param with a device's serial.\n\n`adb shell pm uninstall \u003cpackage\u003e`\nUninstalls an app.\n\n`adb install \u003capk-file\u003e`\nInstalls an app.\n\n## Digital Signatures\n\n### Signed Jar\n\nThe provided JARs in the GitHub release page are signed with my private key:\n\n    CN=Patrick Favre-Bulle, OU=Private, O=PF Github Open Source, L=Vienna, ST=Vienna, C=AT\n    Validity: Thu Sep 07 16:40:57 SGT 2017 to: Fri Feb 10 16:40:57 SGT 2034\n    SHA1: 06:DE:F2:C5:F7:BC:0C:11:ED:35:E2:0F:B1:9F:78:99:0F:BE:43:C4\n    SHA256: 2B:65:33:B0:1C:0D:2A:69:4E:2D:53:8F:29:D5:6C:D6:87:AF:06:42:1F:1A:EE:B3:3C:E0:6D:0B:65:A1:AA:88\n\nUse the jarsigner tool (found in your `$JAVA_HOME/bin` folder) folder to verify.\n\n### Signed Commits\n\nAll tags and commits by me are signed with git with my private key:\n\n    GPG key ID: 4FDF85343912A3AB\n    Fingerprint: 2FB392FB05158589B767960C4FDF85343912A3AB\n\n## Build\n\n### Jar Sign\n\nIf you want to jar sign you need to provide a file `keystore.jks` in the\nroot folder with the correct credentials set in environment variables (\n`OPENSOURCE_PROJECTS_KS_PW` and `OPENSOURCE_PROJECTS_KEY_PW`); alias is\nset as `pfopensource`.\n\nIf you want to skip jar signing just change the skip configuration in the\n`pom.xml` jar sign plugin to true:\n\n    \u003cskip\u003etrue\u003c/skip\u003e\n\n### Build with Maven\n\nUse the Maven wrapper to create a jar including all dependencies\n\n    mvnw clean package\n\n### Checkstyle Config File\n\nThis project uses my [`common-parent`](https://github.com/patrickfav/mvn-common-parent) which centralized a lot of\nthe plugin versions aswell as providing the checkstyle config rules. Specifically they are maintained in [`checkstyle-config`](https://github.com/patrickfav/checkstyle-config). Locally the files will be copied after you `mvnw install` into your `target` folder and is called\n`target/checkstyle-checker.xml`. So if you use a plugin for your IDE, use this file as your local configuration.\n\n## Tech-Stack\n\n* Java 8 (+ [errorprone](https://github.com/google/error-prone) static analyzer)\n* Maven\n\n# Credits\n\n* [Icon for launcher by Yaroslav Shevchuk](https://material.uplabs.com/posts/material-terminal-android-icon)\n\n# License\n\nCopyright 2016 Patrick Favre-Bulle\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickfav%2Fuber-adb-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickfav%2Fuber-adb-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickfav%2Fuber-adb-tools/lists"}