我们都知道用"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     >     ]          

更多相关文章

  1. GitHub 标星 2.5K+!教你通过玩游戏的方式学习 VIM!
  2. 如何在后台运行Linux命令?
  3. No.11 使用firewall配置的防火墙策略的生效模式
  4. 如何打包Android(安卓)Wearable 应用程序
  5. Android(安卓)Intent的用法及其传取值
  6. Android(安卓)Permission大全1.0最终版本
  7. adnroid联网
  8. 解决android工程引用多个jar包导致的文件重复的错误
  9. Android(安卓)PMEM驱动研究 在应用程序中使用PMEM

随机推荐

  1. Tkinter & mysql 的登录框设计
  2. python尝试自定义数据结构不知道怎么下手
  3. Python JSON里保存中文为'\uXXX'
  4. python解析json文件读取Android permissi
  5. 语法怪癖或者为什么是有效的python
  6. 如何在Scrapy CrawlSpider中访问特定的st
  7. 踏出第一步——安装并跑通python程序
  8. 使用python实现人脸检测
  9. python 虚拟机是单线程;当线程执行I/O密集
  10. 使用python如何在列表列表中找到元素,而关