(移植android OS 到 openwrt)

确保linux能够识别adb命令,请自行添加环境变量。

root@Ray:/home/floyd/adt-bundle-linux/sdk/platform-tools# ./adb devices -lList of devices attached 02a0251d               device usb:2-1.1

注,确保adb运行权限为root,否则

floyd@Ray:~/adt-bundle-linux/sdk/platform-tools$ ./adb devices -lList of devices attached ????????????           no permissions usb:2-1.1

且无法使用adb -s device_id shell连接设备。

root@Ray:/home/floyd/adt-bundle-linux/sdk/platform-tools# ./adb -s 02a0251d shell$ lsacct                 init.goldfish.rc     sbincache                init.qcom.rc         sd-extconfig               init.qcom.sh         sdcardd                    init.rc              sysdata                 init.target.rc       systemdefault.prop         mnt                  ueventd.goldfish.rcdev                  persist              ueventd.rcetc                  proc                 vendorinit                 root

如何连接开发板

adb connect 192.168.1.2:5555 #端口5555,192.168.1.2为开发板IPadb shell #进入终端模式

adb的关闭与启动

root@Ray:/home/floyd/adt-bundle-linux/sdk/platform-tools# ./adb kill-serverroot@Ray:/home/floyd/adt-bundle-linux/sdk/platform-tools# ./adb start-server

与设备之间文件的传输

adb push <本机文件目录> <设备文件目录>

adb pull <本机文件目录> <设备文件目录>

安装APK程序到设备

adb install <APK文件路径>

连接到Android设备后请求root权限,su,如果手机的话,注意在手机上允许root权限请求。

默认下apk软件安装到/data/app

adb命令启动Android程序

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

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

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. Android文件浏览器的开发
  2. android布局文件中的include
  3. Android 学习 设备管理器勾选后不能再取消了
  4. Android上传文件到Web服务器,PHP接收文件(二)
  5. 新建android工程 没有R.java文件
  6. Android 读取 assets目录下的文件
  7. android 五种 布局文件

随机推荐

  1. 发送和拦截短信
  2. [Google Android] GCM: Getting Started
  3. 整理文:Android设备唯一码
  4. Android:这是一份全面&详细的 热修复 学习
  5. Xutils3.0的cookie设置
  6. android 背景边框变圆角的几种方法
  7. android Splash闪屏的实现
  8. Android_文档学习_UI_creating menus
  9. eclipse创建2dx项目
  10. 手机上使用google 搜索引擎