am命令的参数介绍:

usage: am [subcommand] [options]

start an Activity: am start [-D] -D: enable debugging send a broadcast Intent: am broadcast start an Instrumentation: am instrument [flags] -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT) -e : set argument to -p : write profiling data to -w: wait for instrumentation to finish before returning start profiling: am profile start stop profiling: am profile stop specifications include these flags: [-a ] [-d ] [-t ] [-c [-c ] ...] [-e|--es ...] [--ez ...] [-e|--ei ...] [-n ] [-f ] [] tips:你也可以在终端下输入adb shell am 查看更多使用方法

具体使用方法:

am start -n 包(package)名/包名.活动(activity)名称

启动的方法可以从每个应用的AndroidManifest.xml的文件中得到

Music 和 Video(音乐和视频)的启动方法为:

am start -n com.android.music/com.android.music.MusicBrowserActivity

am start -n com.android.music/com.android.music.VideoBrowserActivity

am start -n com.android.music/com.android.music.MediaPlaybackActivity

Camera(照相机)的启动方法为:

am start -n com.android.camera/com.android.camera.Camera

Browser(浏览器)的启动方法为:

am start -n com.android.browser/com.android.browser.BrowserActivity

启动浏览器 :

am start -a android.intent.action.VIEW -d http://www.baidu.com/

拨打电话 :

am start -a android.intent.action.CALL -d tel:10086

启动 google map 直接定位到北京 :

am start -a android.intent.action.VIEW geo:0,0?q=beijing

安卓am命令有很多个参数及使用方法,具体可参考官方网站:Android Debug Bridge

==================================================

pm命令的参数介绍如下:

usage: pm [list|path|install|uninstall]

pm list packages [-f]

pm list permission-groups

pm list permissions [-g] [-f] [-d] [-u] [GROUP]

pm list instrumentation [-f] [TARGET-PACKAGE]

pm path PACKAGE

pm install [-l] [-r] PATH

pm uninstall [-k] PACKAGE

pm enable PACKAGE_OR_COMPONENT

pm disable PACKAGE_OR_COMPONENT

The list packages command prints all packages. Use

the -f option to see their associated file.

The list permission-groups command prints all known

permission groups.

The list permissions command prints all known

permissions, optionally only those in GROUP. Use

the -g option to organize by group. Use

the -f option to print all information. Use

the -s option for a short summary. Use

the -d option to only list dangerous permissions. Use

the -u option to list only the permissions users will see.

The list instrumentation command prints all instrumentations,

or only those that target a specified package. Use the -f option

to see their associated file.

The path command prints the path to the .apk of a package.

The install command installs a package to the system. Use

the -l option to install the package with FORWARD_LOCK. Use

the -r option to reinstall an exisiting app, keeping its data.

The uninstall command removes a package from the system. Use

the -k option to keep the data and cache directories around

after the package removal.

tips:你也可以在终端下输入adb shell pm 查看更多使用方法

具体使用方法:

1.1:察看已安装的包:

pm list package

此时则显示所有已经安装的包名。

pm list package -f

也显示associated文件所在目录(即保存的APK文件)

1.2:察看已知的权限组:

pm list permission-groups

1.3:察看所有已知的权限:

pm list permissions

1.4:列出所有硬件相关信息:

pm list features

结果通常类似:

feature:reqGlEsVersion=0x20000

feature:android.hardware.bluetooth

feature:android.hardware.camera

feature:android.hardware.location

feature:android.hardware.location.network

feature:android.hardware.microphone

feature:android.hardware.sensor.accelerometer

feature:android.hardware.sensor.compass

feature:android.hardware.touchscreen

feature:android.hardware.wifi

1.5:列出指定包名的 associated 文件 (APK存档文件) 所在:

例如:

pm path com.cai.test

package:/mnt/asec/com.cai.test-1/test.apk

1.6: 安装APK:

pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f] PATH

PATH 指 APK文件绝对路径和文件名。

例如:

pm install /data/test.apk

这几个参数很有用:

-r: 安装一个已经安装的APK,保持其数据不变。

-i:指定安装的包名。(没试出来)

-s: 安装到SDCard上。

-f: 安装到内部Flash上。

1.6:卸载APK:

pm uninstall 包名。

例如:

pm uninstall com.cai.test

1.7: 得到和设置缺省安装位置:

The getInstallLocation command gets 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

The setInstallLocation command changes the default install location

0 [auto]: Let system decide the best location

1 [internal]: Install on internal device storage

2 [external]: Install on external media

pm getInstallLocation

得到缺省的安装位置。

设置:

pm setInstallLocation <0|1|2>

0: 自动。 1:内部Flash。 2:扩展存储设备。

android工具am的用法,Android am/pm命令用法相关推荐

  1. Android am/pm命令用法

    am命令的参数介绍: usage: am [subcommand] [options] start an Activity: am start [-D] <INTENT>-D: enabl ...

  2. android pm命令用法

    原址 一.Pm命令 命令格式: pm <command> 命令列表: 命令 功能 实现方法 list packages 列举app包信息 PMS.getInstalledPackages ...

  3. Android工具修复属性,Broken Android Data Extraction(安卓数据修复工具) V3.0.20 官方版

    其他相关 Broken,Android,Data,Extraction_百度搜索if(window.bds&&bds.util&&bds.util.setContain ...

  4. c语言strTrimed函数用法介绍,linux type命令用法_转

    在脚本中type可用于检查命令或函数是否存在,存在返回0,表示成功:不存在返回正值,表示不成功. $ type foo >/dev/null 2>&1 || { echo > ...

  5. linux中comm的用法,linux中comm命令用法

    linux系统中comm命令用法详解 linux系统下的comm命令是一个非常实用的文件对比命令. comm命令功能:   选择或拒绝两个已排序的文件的公共的行. comm命令语法:comm [-12 ...

  6. android 工具类放哪里,android开发工具类——Constants(存放全局变量)

    具体参照代码: 这是个人项目中常用到的一些全局变量. package com.imeibi.constants; import android.os.Environment; /** * Create ...

  7. chmod命令用法(linux中chmod命令用法)

    linuxsort命令有哪些用法? txt apple banana orange pear 2 sort的-u选项 它的作用很简单,就是在输出行中去除重复行. [rocrocket@rocrocke ...

  8. linux find ok用法,linux下find命令用法

    一.Linux中find常見用法示例·find    path    -option    [    -print ]    [ -exec    -ok    command ]    {} /; ...

  9. Android 系统(54)---Android系统开篇

    Android系统开篇[转 学习] 一.引言原网址 Android系统非常庞大.错中复杂,其底层是采用Linux作为基底,上层采用包含虚拟机的Java层以及Native层,通过系统调用(Syscall ...

最新文章

  1. SAP Cloud for Customer Cloud Application Studio的Trace功能
  2. ssm访问不到html_IDEA解决SSM项目的静态资源路径问题:HTML,CSS,JS--详解
  3. 资源放送丨《OGG日常运维及故障处理》PPT视频
  4. 深入剖析java迭代器以及C#迭代器!
  5. 手机4k屏幕测试软件,手机4K屏、2K屏、1080p屏对比测试!惊叹
  6. 多态_python的小窝_百度空间
  7. python实战项目(Django技术点)
  8. 初级程序员面试题总结(一):
  9. 汇编:Debug的常用命令
  10. word文档如何画线条流程图_Word中流程图如何画 手把手教你制作!
  11. t450加固态硬盘教程_ThinkPad T450 开箱安装内存SSD升级Windows10过程小记-5X兴趣社区...
  12. 【Web】CSS(No.33)Css页面布局经典案例(三)《京东首页》
  13. iphone邮件服务器 263,在iphone上怎么设置263邮箱
  14. 如何提升你的面试机会?
  15. node的HTPP请求
  16. 阿里云ECS的1M带宽能干嘛?
  17. HTML代码via浏览器logo,Via浏览器怎么定制首页 几步轻松完成
  18. python实现api接口
  19. 如何判断是否适合学编程?
  20. SAR ADC设计——SAR Logic原理

热门文章

  1. AR眼镜语音转文字实测!效果像开了弹幕,对话记录可保存回溯
  2. 基础知识之一——STA基础概述
  3. 维谛技术(Vertiv):场景驱动的边缘计算
  4. 模板测试+一个好玩的顶点动画效果——UnityShader学习笔记
  5. 【零基础学机器学习 3】机器学习类型简介:监督学习 - 无监督学习 - 强化学习
  6. 华师大数据科学考研_华东师范大学数据科学与工程学院硕士研究生录取名单公示...
  7. 基于java汉服文化平台网站(java毕业设计)
  8. iPhone 11今晚发!我已决定不买,不只是因为钱的问题
  9. 完美解决微信浏览器内长按识别个人收款码的案例分享
  10. CUDA编程(一):GPU计算与CUDA编程简介