Struct android_tools::adb::AdbShellPm
source · [−]pub struct AdbShellPm { /* private fields */ }
Implementations
sourceimpl AdbShellPm
impl AdbShellPm
pub fn new() -> Self
sourcepub fn list_packages(&mut self, list_packages: String) -> &mut Self
pub fn list_packages(&mut self, list_packages: String) -> &mut Self
Prints all packages, optionally only those whose package 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.--user user_id
: The user space to query.
sourcepub fn list_permission_groups(
&mut self,
list_permission_groups: String
) -> &mut Self
pub fn list_permission_groups(
&mut self,
list_permission_groups: String
) -> &mut Self
Prints all known permission groups.
sourcepub fn list_permission(&mut self, list_permission: bool) -> &mut Self
pub fn list_permission(&mut self, list_permission: bool) -> &mut Self
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.
sourcepub fn list_instrumentation(&mut self, list_instrumentation: bool) -> &mut Self
pub fn list_instrumentation(&mut self, list_instrumentation: bool) -> &mut Self
List all test packages.
Options:
-f
: List the APK file for the test package.target_package
: List test packages for only this app.
sourcepub fn list_features(&mut self, list_features: bool) -> &mut Self
pub fn list_features(&mut self, list_features: bool) -> &mut Self
Prints all features of the system.
sourcepub fn list_libraries(&mut self, list_libraries: bool) -> &mut Self
pub fn list_libraries(&mut self, list_libraries: bool) -> &mut Self
Prints all the libraries supported by the current device.
sourcepub fn list_users(&mut self, list_users: bool) -> &mut Self
pub fn list_users(&mut self, list_users: bool) -> &mut Self
Prints all users on the system.
sourcepub fn path_package(&mut self, path_package: &Path) -> &mut Self
pub fn path_package(&mut self, path_package: &Path) -> &mut Self
Print the path to the APK of the given package.
sourcepub fn install_path(&mut self, install_path: &Path) -> &mut Self
pub fn install_path(&mut self, install_path: &Path) -> &mut Self
Installs a package (specified by path) to the system.
Options:
-r
: Reinstall an existing app, keeping its data.-t
: Allow test APKs to be installed. Gradle generates a test APK when you have only run or debugged your app or have used the Android Studio Build > Build APK command. If the APK is built using a developer preview SDK (if the targetSdkVersion is a letter instead of a number), you must include the -t option with the install command if you are installing a test APK.-i installer_package_name
: Specify the installer package name.--install-location location
: Sets the install location using one of the following values:0
: Use the default install location1
: Install on internal device storage2
: Install on external media
-f
: Install package on the internal system memory.-d
: Allow version code downgrade.-g
: Grant all permissions listed in the app manifest.--fastdeploy
: Quickly update an installed package by only updating the parts of the APK that changed.--incremental
: Installs enough of the APK to launch the app while streaming the remaining data in the background. To use this feature, you must sign the APK, create an [APK Signature Scheme v4 file
], and place this file in the same directory as the APK. This feature is only supported on certain devices. This option forces adb to use the feature or fail if it is not supported (with verbose information on why it failed). Append the--wait
option to wait until the APK is fully installed before granting access to the APK.
sourcepub fn uninstall(&mut self, uninstall: &Path) -> &mut Self
pub fn uninstall(&mut self, uninstall: &Path) -> &mut Self
Removes a package from the system.
Options:
-k
: Keep the data and cache directories around after package removal.
sourcepub fn enable(&mut self, enable: &Path) -> &mut Self
pub fn enable(&mut self, enable: &Path) -> &mut Self
Enable the given package or component (written as “package/class”).
sourcepub fn disable(&mut self, disable: &Path) -> &mut Self
pub fn disable(&mut self, disable: &Path) -> &mut Self
Disable the given package or component (written as “package/class”).
sourcepub fn disable_user(&mut self, disable_user: &Path) -> &mut Self
pub fn disable_user(&mut self, disable_user: &Path) -> &mut Self
Options:
--user user_id
: The user to disable.
sourcepub fn grant(&mut self, grant: String) -> &mut Self
pub fn grant(&mut self, grant: String) -> &mut Self
Grant a permission to an app. On devices running Android 6.0 (API level 23) and higher, the permission can be any permission declared in the app manifest. On devices running Android 5.1 (API level 22) and lower, must be an optional permission defined by the app.
sourcepub fn revoke(&mut self, revoke: String) -> &mut Self
pub fn revoke(&mut self, revoke: String) -> &mut Self
Revoke a permission from an app. On devices running Android 6.0 (API level 23) and higher, the permission can be any permission declared in the app manifest. On devices running Android 5.1 (API level 22) and lower, must be an optional permission defined by the app.
sourcepub fn set_install_location(
&mut self,
set_install_location: InstallLocation
) -> &mut Self
pub fn set_install_location(
&mut self,
set_install_location: InstallLocation
) -> &mut Self
Changes the default install location. Location values:
0
: Auto: Let system decide the best location.1
: Internal: install on internal device storage.2
: External: on external media.
Note
This is only intended for debugging; using this can cause apps to break and other undesireable behavior.
sourcepub fn get_install_location(
&mut self,
get_install_location: InstallLocation
) -> &mut Self
pub fn get_install_location(
&mut self,
get_install_location: InstallLocation
) -> &mut Self
Returns the current install location. Return values:
0
: Auto: Let system decide the best location.1
: Internal: install on internal device storage.2
: External: on external media.
sourcepub fn set_permission_enforced(
&mut self,
set_permission_enforced: bool
) -> &mut Self
pub fn set_permission_enforced(
&mut self,
set_permission_enforced: bool
) -> &mut Self
Specifies whether the given permission should be enforced.
sourcepub fn trim_caches(&mut self, trim_caches: &Path) -> &mut Self
pub fn trim_caches(&mut self, trim_caches: &Path) -> &mut Self
Trim cache files to reach the given free space.
sourcepub fn create_user(&mut self, create_user: String) -> &mut Self
pub fn create_user(&mut self, create_user: String) -> &mut Self
Create a new user with the given user_name, printing the new user identifier of the user.
sourcepub fn remove_user(&mut self, remove_user: String) -> &mut Self
pub fn remove_user(&mut self, remove_user: String) -> &mut Self
Remove the user with the given user_id, deleting all data associated with that user
sourcepub fn get_max_users(&mut self, get_max_users: bool) -> &mut Self
pub fn get_max_users(&mut self, get_max_users: bool) -> &mut Self
Prints the maximum number of users supported by the device.
pub fn f(&mut self, f: bool) -> &mut Self
pub fn d(&mut self, d: bool) -> &mut Self
pub fn e(&mut self, e: bool) -> &mut Self
pub fn s(&mut self, s: bool) -> &mut Self
pub fn third_party(&mut self, third_party: bool) -> &mut Self
pub fn i(&mut self, i: bool) -> &mut Self
pub fn u(&mut self, u: bool) -> &mut Self
pub fn g(&mut self, g: bool) -> &mut Self
pub fn r(&mut self, r: bool) -> &mut Self
pub fn t(&mut self, t: bool) -> &mut Self
pub fn k(&mut self, k: bool) -> &mut Self
pub fn fastdeploy(&mut self, fastdeploy: bool) -> &mut Self
pub fn no_incremental(&mut self, no_incremental: bool) -> &mut Self
pub fn user(&mut self, user: String) -> &mut Self
pub fn run(&self) -> Result<()>
Trait Implementations
sourceimpl Clone for AdbShellPm
impl Clone for AdbShellPm
sourcefn clone(&self) -> AdbShellPm
fn clone(&self) -> AdbShellPm
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for AdbShellPm
impl Default for AdbShellPm
sourcefn default() -> AdbShellPm
fn default() -> AdbShellPm
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for AdbShellPm
impl Send for AdbShellPm
impl Sync for AdbShellPm
impl Unpin for AdbShellPm
impl UnwindSafe for AdbShellPm
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more