zoukankan      html  css  js  c++  java
  • adb常用指令与APPium环境搭建

    jdk与sdk环境搭建

    常用adb指令讲解

    Appium环境搭建

    Appium介绍:
    移动端开源自动化测试框架
    开源:完全免费
    跨平台:完全满足IOS和Android两个不同系统提供的自动化测试
    Appium是基于Selenium来实现
    Appium是基于JDK+SDK环境来承载
    Appium Server:已经淘汰,停止更新
    Appium Desktop:持续更新的软件

    Appium环境搭建:
    1.安装JDK1.8,JDK的环境搭建
    系统变量中添加:
    变量名:JAVA_HOME 变量值:java安装路径,例如:C:Program FilesJavajdk1.8.0_40
    在系统path路径中添加:
    %JAVA_HOME%in
    %JAVA_HOME%jrein
    2.安装SDK,在官网下载SDK manager,基于所需要的安卓版本进行选择下载对应库
    adb的常用指令
    1.Monkey指令:专门用于做前端健壮性测试的指令的指令,本质就是安卓系统中的一个monkey.jar文件,
    当执行指令过程中,如果出现异常、错误等情况,monkey会自动停止
    adb shell monkey
    -P:指定的package
    events:事件数
    -v:日志记录,-v是1级,-v-v是2级,-v-v-v是3级
    --throttle:等待时间
    -s Seed:可以理解位ID
    adb shell monkey -p com.tencent.mobileqq -s 01 --throttle 1000 -v -v 20
    --igore-crashes:忽略奔溃,忽略ANR
    PS:pm list package显示系统中所安装的包名称
    pm list package -3 :显示第三方包的包名称
    monkey查看异常:
    1.通过java的编译器进行查看
    2.通过logcat
    3.将日志导出成文件进行查找(导出文件操作,只能基于windows下,而非远程连接)

    3.安装appium,下载安装包
    pip install appium-python-client

    4.inspector调用:
    Desired Capablities:
    deviceName:设备名称
    platformName:操作系统名称
    platformversion:操作系统版本
    appPackage:包名称
    APPActivty:launcher-activity
    获取activity的指令:
    dumpsys window windows |grep -i current

              示例:
                
    sagit:/ $ dumpsys window windows |grep -i current
      mCurrentFocus=Window{fb29de0 u0 com.miui.home/com.miui.home.launcher.Launcher}
    sagit:/ $ dumpsys window windows |grep -i current
    mCurrentFocus=Window{fd58b86 u0 com.tencent.mobileqq/com.tencent.mobileqq.activity.SplashActivity}
    sagit:/ $ dumpsys window windows |grep -i current
    mCurrentFocus=Window{fd58b86 u0 com.tencent.mobileqq/com.tencent.mobileqq.activity.SplashActivity}
    sagit:/ $ dumpsys window windows |grep -i current
    mCurrentFocus=Window{fd58b86 u0 com.tencent.mobileqq/com.tencent.mobileqq.activity.SplashActivity}
    sagit:/ $ dumpsys window windows |grep -i current
    mCurrentFocus=Window{c9b0268 u0 com.tencent.mobileqq/com.tencent.mobileqq.activity.QQSettingSettingActivity}
    sagit:/ $ dumpsys window windows |grep -i current
    mCurrentFocus=Window{fd58b86 u0 com.tencent.mobileqq/com.tencent.mobileqq.activity.SplashActivity}
    多次切换QQ上的不同页面,发现只有activity.SplashActivity不变,故activity.SplashActivity就是APPActivty的值
  • 相关阅读:
    iOS- static extern const
    App 性能分析
    迭代器和生成器
    软件工程之个人软件开发----起步
    myeclipse调式与属性显示
    hdu 6188
    uva10780 质因子分解
    云服务器端口号的几个操作
    Redis错误 : MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.
    ubuntu系统安装宝塔面板Linux版
  • 原文地址:https://www.cnblogs.com/Murraya/p/12571139.html
Copyright © 2011-2022 走看看