(移植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. NPM 和webpack 的基础使用
  2. 【阿里云镜像】使用阿里巴巴DNS镜像源——DNS配置教程
  3. 关于cocos2dx的eclipse的"serializing cdt project settings"解
  4. Android文件浏览器的开发
  5. [置顶] Android4.2.2自增物理按键(frameworks)
  6. Android(安卓)SharedPreferences解析
  7. android布局文件中的include
  8. Android(安卓)学习 设备管理器勾选后不能再取消了
  9. android 播放视频

随机推荐

  1. android 系统的开机启动流程源码解析(从li
  2. android中使用httpclient方法获得网页内
  3. android4.0.3修改源码永不锁屏
  4. Android音乐播放器制作(二 )点击歌曲实现播
  5. [Android] 获取WebView的页面标题(Title)
  6. WebView播放html5视频和全屏。
  7. Android完全关闭应用程序
  8. Android常用控件之GridView使用BaseAdapt
  9. 手机APP制作先选Android还是iOS,为什么?
  10. Android 读取系统信息