pm.go 582 B

123456789101112131415161718192021
  1. package shell
  2. func (d DeviceShell) pm(args ...string) ([]byte, error) {
  3. return d.RunSync("pm", args...)
  4. }
  5. // InstalledApps returns installed apps. See ParseInstalledApps
  6. func (d DeviceShell) InstalledApps() ([]byte, error) {
  7. return d.pm("list", "packages")
  8. }
  9. // PackagePath returns path to package. See ParsePackagePath
  10. func (d DeviceShell) PackagePath(pkgName string) ([]byte, error) {
  11. return d.pm("path", pkgName)
  12. }
  13. // ClearPackageData clears installed package's data
  14. func (d DeviceShell) ClearPackageData(pkgName string) ([]byte, error) {
  15. return d.pm("clear", pkgName)
  16. }