博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何用adb命令启动你的Android程序
阅读量:2298 次
发布时间:2019-05-09

本文共 4522 字,大约阅读时间需要 15 分钟。

分类: 
 
595人阅读 
(1) 
 

我们都知道用"adb install filename.apk"命令可以安装一个android程序,那你知道在安装后如何启动你的程序吗?

试试下面的命令吧。

adb shell am start     
-
a android.intent.action.MAIN
-
c android.intent.category.LAUNCHER
-
n breakan.test
/
break
an.test.TestActivity

或简单一些。

adb shell am start     
-
n breakan.test
/
breakan.test.TestActivity

其中"breakan.test/breakan.test.TestActivity"中的"breakan.test"是程序的包名,"TestActivity"是程序Activity类的类名。

我们来看下adb shell am命令的帮助。

usage: am [subcommand] [options]    start an Activity: am start [    
-
D] [
-
W]
<
INTENT
>
-
D: enable debugging
-
W: wait
for
launch to complete start a Service: am startservice
<
INTENT
>
send a broadcast Intent: am broadcast
<
INTENT
>
start an Instrumentation: am instrument [flags]
<
COMPONENT
>
-
r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)
-
e
<
NAME
>
<
VALUE
>
: set argument
<
NAME
>
to
<
VALUE
>
-
p
<
FILE
>
: write profiling data to
<
FILE
>
-
w: wait
for
instrumentation to finish before returning start profiling: am profile
<
PROCESS
>
start
<
FILE
>
stop profiling: am profile
<
PROCESS
>
stop
<
INTENT
>
specifications include these flags: [
-
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
>
...] [
-
e
|--
ei
<
EXTRA_KEY
>
<
EXTRA_INT_VALUE
>
...] [
-
n
<
COMPONENT
>
] [
-
f
<
FLAGS
>
] [
--
grant
-
read
-
uri
-
permission] [
--
grant
-
write
-
uri
-
permission] [
--
debug
-
log
-
resolution] [
--
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] [
--
receiver
-
registered
-
only] [
--
receiver
-
replace
-
pending] [
<
URI
>
]

转载地址:http://mwkib.baihongyu.com/

你可能感兴趣的文章
SpringBoot + Mybatis-plus实战之Mybatis-plus的一级缓存、二级缓存
查看>>
HTML表格跨行跨列操作(rowspan、colspan)
查看>>
前端页面弹框遮罩禁止页面滚动
查看>>
html 指定页面字符集的两种方法
查看>>
HTML5拖拽文件上传的示例代码
查看>>
Canvas在超级玛丽游戏中的应用详解
查看>>
使用HTML和CSS实现的标签云效果(附demo)
查看>>
h5页面背景图很长要有滚动条滑动效果的实现
查看>>
详解如何将 Canvas 绘制过程转为视频
查看>>
html table呈现个人简历以及单元格宽度失效的问题解决
查看>>
详解如何解决H5开发使用wx.hideMenuItems无效果不生效
查看>>
HTML5 drag和drop具体使用详解
查看>>
HTML5 canvas实现的静态循环滚动播放弹幕
查看>>
前端使用canvas生成盲水印的加密解密的实现
查看>>
JavaScript 防篡改对象的用法示例
查看>>
jquery插件实现代码雨特效
查看>>
jquery插件实现堆叠式菜单
查看>>
FrontPage怎么自定义设置CSS外部样式表?
查看>>
CSS3只让背景图片旋转180度的实现示例
查看>>
myeclipse注释模板添加
查看>>