1. Shinedowngirl87's Avatar
    Here's what I get.

    C:\Users\jenns>adb shell pm grant com.gsamlabs.bbm android.permission.BATTERY_STATS Bad argument: java.lang.IllegalArgumentException: Unknown package: com.gsamlabs.bbm usage: pm path [--user USER_ID] PACKAGE pm dump PACKAGE pm install [-lrtsfd] [-i PACKAGE] [--user USER_ID] [PATH] pm install-create [-lrtsfdp] [-i PACKAGE] [-S BYTES] [--install-location 0/1/2] [--force-uuid internal|UUID] pm install-write [-S BYTES] SESSION_ID SPLIT_NAME [PATH] pm install-commit SESSION_ID pm install-abandon SESSION_ID pm uninstall [-k] [--user USER_ID] PACKAGE pm set-installer PACKAGE INSTALLER pm move-package PACKAGE [internal|UUID] pm move-primary-storage [internal|UUID] pm clear [--user USER_ID] PACKAGE pm enable [--user USER_ID] PACKAGE_OR_COMPONENT pm disable [--user USER_ID] PACKAGE_OR_COMPONENT pm disable-user [--user USER_ID] PACKAGE_OR_COMPONENT pm disable-until-used [--user USER_ID] PACKAGE_OR_COMPONENT pm default-state [--user USER_ID] PACKAGE_OR_COMPONENT pm hide [--user USER_ID] PACKAGE_OR_COMPONENT pm unhide [--user USER_ID] PACKAGE_OR_COMPONENT pm grant [--user USER_ID] PACKAGE PERMISSION pm revoke [--user USER_ID] PACKAGE PERMISSION pm reset-permissions pm set-app-link [--user USER_ID] PACKAGE {always|ask|never|undefined} pm get-app-link [--user USER_ID] PACKAGE pm set-install-location [0/auto] [1/internal] [2/external] pm get-install-location pm set-permission-enforced PERMISSION [true|false] pm trim-caches DESIRED_FREE_SPACE [internal|UUID] pm create-user [--profileOf USER_ID] [--managed] [--restricted] [--ephemeral] [--guest] USER_NAME pm remove-user USER_ID pm get-max-users
    NOTE: 'pm list' commands have moved! Run 'adb shell cmd package' to display the new commands.
    pm path: print the path to the .apk of the given PACKAGE.
    pm dump: print system state associated with the given PACKAGE.
    pm install: install a single legacy package pm install-create: create an install session -l: forward lock application -r: replace existing application -t: allow test packages -i: specify the installer package name -s: install application on sdcard -f: install application on internal flash -d: allow version code downgrade (debuggable packages only) -p: partial application install -g: grant all runtime permissions -S: size in bytes of entire session
    pm install-write: write a package into existing session; path may be '-' to read from stdin -S: size in bytes of package, required for stdin
    pm install-commit: perform install of fully staged session pm install-abandon: abandon session
    pm set-installer: set installer package name
    pm uninstall: removes a package from the system. Options: -k: keep the data and cache directories around after package removal.
    pm clear: deletes all data associated with a package.
    pm enable, disable, disable-user, disable-until-used, default-state: these commands change the enabled state of a given package or component (written as "package/class").
    pm grant, revoke: these commands either grant or revoke permissions to apps. The permissions must be declared as used in the app's manifest, be runtime permissions (protection level dangerous), and the app targeting SDK greater than Lollipop MR1.
    pm reset-permissions: revert all runtime permissions to their default state.
    pm get-install-location: returns the current install location. 0 [auto]: Let system decide the best location 1 [internal]: Install on internal device storage 2 [external]: Install on external media
    pm set-install-location: changes the default install location. NOTE: this is only intended for debugging; using this can cause applications to break and other undersireable behavior. 0 [auto]: Let system decide the best location 1 [internal]: Install on internal device storage 2 [external]: Install on external media
    pm trim-caches: trim cache files to reach the given free space.
    pm create-user: create a new user with the given USER_NAME, printing the new user identifier of the user.
    pm remove-user: remove the user with the given USER_IDENTIFIER, deleting all data associated with that user
    C:\Users\jenns>pm grant adb shell grant com.gsamlabs.bbm.android.permission.BATTERY_STATS 'pm' is not recognized as an internal or external command, operable program or batch file.
    C:\Users\jenns>adb shell cmd package Package manager (package) commands: help Print this help text.
    compile [-m MODE | -r REASON] [-f] [-c] [--reset] [--check-prof (true | false)] (-a | TARGET-PACKAGE) Trigger compilation of TARGET-PACKAGE or all packages if "-a". Options: -a: compile all packages -c: clear profile data before compiling -f: force compilation even if not needed -m: select compilation mode MODE is one of the dex2oat compiler filters: verify-none verify-at-runtime verify-profile interpret-only space-profile space speed-profile speed everything -r: select compilation reason REASON is one of: first-boot boot install bg-dexopt ab-ota nsys-library shared-apk forced-dexopt core-app --reset: restore package to its post-install state --check-prof (true | false): look at profiles when doing dexopt? list features Prints all features of the system. list instrumentation [-f] [TARGET-PACKAGE] Prints all test packages; optionally only those targeting TARGET-PACKAGE Options: -f: dump the name of the .apk file containing the test package list libraries Prints all system libraries. list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [--user USER_ID] [FILTER] Prints all packages; optionally only those whose name contains the text in FILTER. Options: -f: see their associated file -d: filter to only show disabled packages -e: filter to only show enabled packages -s: filter to only show system packages -3: filter to only show third party packages -i: see the installer for the packages -u: also include uninstalled packages list permission-groups Prints all known permission groups. list permissions [-g] [-f] [-d] [-u] [GROUP] Prints all known permissions; optionally only those in GROUP. Options: -g: organize by group -f: print all information -s: short summary -d: only list dangerous permissions -u: list only the permissions users will see dump-profiles TARGET-PACKAGE Dumps method/class profile files to /data/misc/profman/TARGET-PACKAGE.txt resolve-activity [--brief] [--components] [--user USER_ID] INTENT Prints the activity that resolves to the given Intent. query-activities [--brief] [--components] [--user USER_ID] INTENT Prints all activities that can handle the given Intent. query-services [--brief] [--components] [--user USER_ID] INTENT Prints all services that can handle the given Intent. query-receivers [--brief] [--components] [--user USER_ID] INTENT Prints all broadcast receivers that can handle the given Intent. suspend [--user USER_ID] TARGET-PACKAGE Suspends the specified package (as user). unsuspend [--user USER_ID] TARGET-PACKAGE Unsuspends the specified package (as user). set-home-activity [--user USER_ID] TARGET-COMPONENT set the default home activity (aka launcher).
    <INTENT> specifications include these flags and arguments: [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>] [-c <CATEGORY> [-c <CATEGORY>] ...] [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...] [--esn <EXTRA_KEY> ...] [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...] [--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...] [--el <EXTRA_KEY> <EXTRA_LONG_VALUE> ...] [--ef <EXTRA_KEY> <EXTRA_FLOAT_VALUE> ...] [--eu <EXTRA_KEY> <EXTRA_URI_VALUE> ...] [--ecn <EXTRA_KEY> <EXTRA_COMPONENT_NAME_VALUE>] [--eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]] (mutiple extras passed as Integer[]) [--eial <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]] (mutiple extras passed as List<Integer>) [--ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]] (mutiple extras passed as Long[]) [--elal <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]] (mutiple extras passed as List<Long>) [--efa <EXTRA_KEY> <EXTRA_FLOAT_VALUE>[,<EXTRA_FLOAT_VALUE...]] (mutiple extras passed as Float[]) [--efal <EXTRA_KEY> <EXTRA_FLOAT_VALUE>[,<EXTRA_FLOAT_VALUE...]] (mutiple extras passed as List<Float>) [--esa <EXTRA_KEY> <EXTRA_STRING_VALUE>[,<EXTRA_STRING_VALUE...]] (mutiple extras passed as String[]; to embed a comma into a string, escape it using "\,") [--esal <EXTRA_KEY> <EXTRA_STRING_VALUE>[,<EXTRA_STRING_VALUE...]] (mutiple extras passed as List<String>; to embed a comma into a string, escape it using "\,") [--f <FLAG>] [--grant-read-uri-permission] [--grant-write-uri-permission] [--grant-persistable-uri-permission] [--grant-prefix-uri-permission] [--debug-log-resolution] [--exclude-stopped-packages] [--include-stopped-packages] [--activity-brought-to-front] [--activity-clear-top] [--activity-clear-when-task-reset] [--activity-exclude-from-recents] [--activity-launched-from-history] [--activity-multiple-task] [--activity-no-animation] [--activity-no-history] [--activity-no-user-action] [--activity-previous-is-top] [--activity-reorder-to-front] [--activity-reset-task-if-needed] [--activity-single-top] [--activity-clear-task] [--activity-task-on-home] [--receiver-registered-only] [--receiver-replace-pending] [--receiver-foreground] [--selector] [<URI> | <PACKAGE> | <COMPONENT>]

    Before I could just type this: adb shell pm grant com.gsamlabs.bbm android.permission.BATTERY_STATS
    and it would work, so what would I type now? I downloaded Accubattery until I can figure out the new command.
    06-19-2017 04:08 AM
  2. Golfdriver97's Avatar
    Have you made sure that the device is set to file transfers? If that is set, when you plug int the device type adb devices. You should see your phone.
    06-19-2017 11:14 AM
  3. Shinedowngirl87's Avatar
    Yes, and I do see it. But ADB changed the pm grant command and I'm trying to find the right command.
    06-19-2017 08:54 PM
  4. timmeegee's Avatar
    Yes, and I do see it. But ADB changed the pm grant command and I'm trying to find the right command.
    You're missing one part of the command. They don't tell you on the app

    adb -d shell pm grant com.gsamlabs.bbm android.permission.BATTERY_STATS
    03-08-2018 06:51 AM

Similar Threads

  1. Cannot get email working on my Oppo r9
    By Stevii in forum Ask a Question
    Replies: 2
    Last Post: 12-17-2017, 09:15 PM
  2. Can't copy/move files to G6 with Windows 10?
    By Catseyeguy in forum LG G6
    Replies: 5
    Last Post: 06-25-2017, 06:45 AM
  3. Why does my call drop as soon as I dial it.
    By Joy McSparren in forum Ask a Question
    Replies: 1
    Last Post: 06-20-2017, 01:40 PM
  4. Cannot access icons on S7 after updates
    By AC Question in forum Samsung Galaxy S7
    Replies: 1
    Last Post: 06-19-2017, 06:52 AM
  5. Replies: 1
    Last Post: 06-19-2017, 06:48 AM