adb shell 打开应用程序
来源:互联网 发布:长城软件怎么样 编辑:程序博客网 时间:2024/06/04 00:36
在Android中,除了从界面上启动程序之外,还可以从命令行启动程序,使用的是命令行工具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 ] []
启动的方法为
$ adb shell
$ am start -n {包(package)名}/{包名}.{活动(activity)名称}
程序的入口类可以从每个应用的AndroidManifest.xml的文件中得到,以计算器(calculator)为例,它的
package="com.android.calculator2" …>…
由此计算器(calculator)的启动方法为:
# am start -n com.android.calculator2/com.android.calculator2.Calculator
对于HelloActivity这个示例工程,AndroidManifest.xml如下所示:
package="com.example.android.helloactivity" …>
由此它的启动方法为:
# am start -n com.example.android.helloactivity/com.example.android.helloactivity.HelloActivity
其他的一些应用启动命令,如下所示:
calendar(日历)的启动方法为:
# am start -n com.android.calendar/com.android.calendar.LaunchActivity
AlarmClock(闹钟)的启动方法为:
# am start -n com.android.alarmclock/com.android.alarmclock.AlarmClock
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
一般情况希望,一个Android应用对应一个工程。值得注意的是,有一些工程具有多个活动(activity),而有一些应用使用一个工程。例如:在Android界面中,Music和Video是两个应用,但是它们使用的都是packages/apps/Music这一个工程。而在这个工程的AndroidManifest.xml文件中,有包含了不同的活动(activity)。
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.google.cn/
拨打电话 :
am start -a android.intent.action.CALL -d tel:10086
启动 google map 直接定位到北京 :
am start -a android.intent.action.VIEW geo:0,0?q=beijing
url:http://greatverve.cnblogs.com/archive/2012/02/10/android-am.html
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 ] []
启动的方法为
$ adb shell
$ am start -n {包(package)名}/{包名}.{活动(activity)名称}
程序的入口类可以从每个应用的AndroidManifest.xml的文件中得到,以计算器(calculator)为例,它的
package="com.android.calculator2" …>…
由此计算器(calculator)的启动方法为:
# am start -n com.android.calculator2/com.android.calculator2.Calculator
对于HelloActivity这个示例工程,AndroidManifest.xml如下所示:
package="com.example.android.helloactivity" …>
由此它的启动方法为:
# am start -n com.example.android.helloactivity/com.example.android.helloactivity.HelloActivity
其他的一些应用启动命令,如下所示:
calendar(日历)的启动方法为:
# am start -n com.android.calendar/com.android.calendar.LaunchActivity
AlarmClock(闹钟)的启动方法为:
# am start -n com.android.alarmclock/com.android.alarmclock.AlarmClock
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
一般情况希望,一个Android应用对应一个工程。值得注意的是,有一些工程具有多个活动(activity),而有一些应用使用一个工程。例如:在Android界面中,Music和Video是两个应用,但是它们使用的都是packages/apps/Music这一个工程。而在这个工程的AndroidManifest.xml文件中,有包含了不同的活动(activity)。
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.google.cn/
拨打电话 :
am start -a android.intent.action.CALL -d tel:10086
启动 google map 直接定位到北京 :
am start -a android.intent.action.VIEW geo:0,0?q=beijing
url:http://greatverve.cnblogs.com/archive/2012/02/10/android-am.html
0 0
- adb shell 打开应用程序
- adb shell 终止应用程序
- Android adb shell启动应用程序的方法
- [原创] adb shell 启动,停止 android 应用程序
- Android adb shell启动应用程序的方法
- Android adb shell启动应用程序的方法
- adb shell 启动,停止 android 应用程序
- Android adb shell启动应用程序的方法
- Android adb shell启动应用程序的方法
- adb shell 启动,停止 android 应用程序
- Android adb shell启动应用程序的方法
- Android adb shell启动应用程序的方法
- android如何用adb shell启动应用程序
- adb shell 启动,停止 android 应用程序
- Android adb shell启动应用程序的方法
- Android adb shell启动应用程序的方法
- adb shell 启动,停止 android 应用程序
- adb shell 启动,停止 android 应用程序
- leetcode系列(65)Swap Nodes in Pairs
- PAT乙级 反转链表 (25)
- Android学习笔记-SharedPreferences
- PHP 正则表达式常用的函数
- 线检测
- adb shell 打开应用程序
- 崩溃问题:iOS9 This application is modifying the autolayout engine from a background thread, which
- Keil MDK之RTX系统时钟节拍和时间管理
- ccf+模版生成系统+字符串的大量应用
- 给树莓派安装vnc server并设置自启动
- 最小二乘法进行曲线拟合(Python)
- ubuntu14.04 开机自动运行应用程序
- 直方图均衡化
- Android性能优化——Layout的优化