• For android devices ,how to test the update the OTA


    Background:

    1.The OTA (Fireware version is lower version than the currect version ,or now the firewire version is not the updatest version)

    Then it will let you to update the watch app on the watch pairing or auto trigger when sync the data on the mobile with the watch.

    2.

    • Now my fireware is the lastest,so I need download the old fireware to install my mobile 
    • install greenleaf on the andrind mobile(For ios install baymax)

                                                    

    • Android moile 

    3.Put the download file to from Mac to the android: adb pull download_file sdcard

    4.

    Greenleaf->Device information ,make sure the state is Conected instead of connecting

    Greenlead->OTA->Upload the download file and click OTA

     

    Then open the watch app and it should be auto trigged the OTA update 

    Also another scenario is when you remove the watch and reset the bluetooth,turn off internet to pair watch to the app.
    Then turn on the internet to trigger the latest firmware.

    adb push (PC到Android设备)

    adb push C:UsersAdministratorDesktop est.jpg sdcard 

    adb pull(Android设备到PC)

    其他常用adb指令:
    1.adb install +包名 adb安装apk (覆盖安装是使用 -r 选项)

    2.adb uninstall +包名 adb卸载apk

    3.adb connect +设备IP 网络连接Android设备

    4.adb reboot 重启Android设备

    5.adb devices 获取连接的设备列表及设备状态

    6.adb get-state 获取设备的状态 (设备的状态有 3 钟,device:设备正常连接 , offline:连接出现异常,设备无响应 , unknown:没有连接设备)

    7.查看运行在 Android设备上的 adb 后台进程:

    执行 adb shell ps | grep adbd ,可以找到该后台进程,windows 请使用 findstr 替代 grep

    8.adb shell 命令
    adb 命令是 adb 这个程序自带的一些命令,而 adb shell 则是调用的 Android 系统中的命令,这些 Android 特有的命令都放在了 Android 设备的 system/bin 目录下

    8.1. adb shell bugreport , 打印dumpsys、dumpstate、logcat的输出,也是用于分析错误

    输出比较多,建议重定向到一个文件中

    adb shell dumpsys > d:ugreport.log

    8.2 pm
    Package Manager , 可以用获取到一些安装在 Android 设备上得应用信息

    8.2.1 adb shell pm list package 列出所有的应用的包名 (-s:列出系统应用 -3:列出第三方应用 -f:列出应用包名及对应的apk名及存放位置 -i:列出应用包名及其安装来源)

    8.2.2 adb shell pm path+包名 列出对应包名.apk 位置

    8.2.3 adb shell pm install +apk存放路径 安装应用(目标 apk 存放于PC端,用 adb install 安装 目标 apk 存放于Android设备上,用 pm install 安装)

    8.3 am

    8.3.1 adb shell am start +包名/.Activity (要启动的Activity) 启动一个 Activity (-s先停止目标应用,再启动 -w 等待应用完成启动 -a 启动默认浏览器打开一个网页例:adb shell am start -a android.intent.action.VIEW -d http://testerhome.com)

    8.3.2 adb shell am monitor 监控 crash 与 ANR

    8.3.3 adb shell am force-stop 后跟包名,结束应用

    8.3.4 adb shell am startservice 启动一个服务

    8.3.5 adb shell am broadcast 发送一个广播

    8.4 input

    这个命令可以向 Android 设备发送按键事件

    8.4.1 adb shell input text +具体内容 发送文本内容,不能发送中文

    8.4.2 adb shell input keyevent + 按键事件 发送按键事件 例如:adb shell input keyevent KEYCODE_HOME 模拟按下Home键

    8.4.3 adb shell input tap +触摸事件的位置 , 对屏幕发送一个触摸事件 例如:点击屏幕上坐标为 500 500 的位置(adb shell input tap 500 500)

    8.4.4 adb shell input tap , 对屏幕发送一个触摸事件

    8.4.4 adb shell input swipe 滑动事件 例如:从右往左滑动屏幕

    adb shell input swipe 800 600 100 600
    8.5 screencap

    截图命令

    adb shell screencap -p /sdcard/DCIM/screenTest.png
    8.6 screenrecord

    4.4以上系统版本新增的录制命令

    adb shell screenrecord /sdcard/demo.mp4
    执行命令后操作手机,ctrl + c 结束录制,录制结果保存至 sdcard/ 下

    8.7 ime

    列出设备上的输入法

    adb shell ime list -s
    其他
    1.获取系统版本

    adb shell getprop ro.build.version.release

    2.获取系统api版本

    adb shell getprop ro.build.version.sdk

    3.获取手机相关制造商信息

    adb shell getprop | grep "model|version.sdk|manufacture
    r|hardware|platform|revision|serialno|product.name|brand"

    3,获取手机系统信息( CPU,厂商名称等)

    adb shell "cat /system/build.prop | grep "product""

    或者

    adb shell

    cat /system/build.prop | grep "product"

    4,获取手机设备型号

    adb -d shell getprop ro.product.model

    5,获取手机厂商名称

    adb -d shell getprop ro.product.brand

    或者分开执行

    adb shell

    getprop ro.product.brand

    6,获取手机的序列号

    有两种方式

    1,adb get-serialno
    2,adb shell getprop ro.serialno

    7,获取手机MAC地址

    adb shell cat /sys/class/net/wlan0/address

    8,获取手机内存信息

    adb shell cat /proc/meminfo

    9,获取手机存储信息

    adb shell df

    10,获取手机内部存储信息

    adb shell df /data

    11,获取Android设备屏幕分辨率

    adb shell "dumpsys window | grep mUnrestrictedScreen"

    12,连接多个设备对其中一个进行操作
    //以adb shell 为例
    adb -s 192.168.101.37:5555 shell

    13,查看运行进程

    adb shell procrank

    14,关闭或杀掉进程

    adb shell kill 366

    15,保留数据和缓存文件,重新安装,升级

    adb install -r test.apk

    16,卸载app但保留数据和缓存文件

    adb uninstall -k cnblogs.apk

    17,查看目录下的文件大小

    adb shell du -sh *

    18,查看正在运行的Services

    adb shell dumpsys activity services [<packagename>]

    19,查看正在运行的Activity

    adb shell dumpsys activity [<packagename>]

    20,clear 清除应用数据

    adb shell pm clear com.baidu

    21,cp复制文件

    adb shell 进入Android Linux命令中

    cp -f system/app/Music/Music.apk /sdcard/Music.apk

    22,删除命令

    adb shell 进入Android Linux命令中

    rm -r /mnt/sdcard/a.mp3

    删除文件夹的时候需要加上-r参数

    cd dir
    rm * 删除dir中所有文件

    23,重启进入recovery模式

    adb reboot recovery

    24,cat查看文件

    cat /sdcard/test.txt

    25,查看指定进程PID

    ps + 进程的包名

    26,查看进程具体的信息

    例如:1460是要查看的进程的PID
    cat /proc/1460/maps 查看进程的文件结构
    cat /proc/1460/status 查看进程的状态

    27,findstr 和 grep过滤搜索

    1)cmd下搜索包名为com.android.launcher3的进程
    adb shell ps|findstr /i “com.android.launcher3”

    2)shell下面搜索
    先使用adb shell进去,然后使用grep命令过滤
    ps | grep “com.linux.test”



  • 相关阅读:
    从netty源码里拿到的关于http错误码,自己学习下
    9步搞定:用迅雷等工具下载百度网盘资源
    jstack定位cpu高占用
    solr学习笔记section2-solr单机(节点)简单的core操作
    solr学习笔记section1-在tomcat中部署单(节点)机solr5.5.4
    简单排序
    Thrift生成的bean对象,用java内省操作时注意(自己笔记)
    Netty方法误解ChannelHandlerContext.writeAndFlush(Object msg)
    腾讯笔试题,木棍组成多边形判断
    微软笔试题,luckstring
  • 原文地址:https://www.cnblogs.com/JacquelineQA/p/15129474.html
Copyright © 2020-2023  润新知