Git Product home page Git Product logo

appspider's Introduction

App Spider

安装appium

  1. 环境要求:
    node.js 建议使用最新的lts版本,如20.12.1

  2. 使用npm在全局范围内安装Appium

    npm i -g appium
  3. 安装完成后,您应该可以从命令行运行Appium

    appium

安装 UiAutomator2 驱动

  1. 安装Android SDK并设置ANDROID_HOME环境变量
    Android Studio下载

  2. 安装Java JDK并设置JAVA_HOME环境变量
    Java JDK下载地址1
    Java JDK下载地址2

  3. 创建模拟器

  4. 启动模拟器

    # 查看模拟器列表
    emulator -list-avds
    emulator -avd <name>
    
  5. 安装Appium驱动器

    appium driver install uiautomator2

安装客户端

npm i --save-dev webdriverio

虚拟机安装app

# 启动虚拟机
emulator -avd <name>
# 安装app
adb install app.apk

常见问题

小米手机和oppo手机appium启动时报错:writing to settings requires:android.permission.WRITE_SECURE_SETTINGS 小米手机:打开“USB调试(安全设置)” oppo: 打开“禁止权限监控"

经过以上配置后oppo手机安装时提示输入手机密码,输入正确后仍然安装失败(显示安装包异常), 预计与appium server等待超时导致(会发现它又重新发起了安装命令) 此时可以放弃使用appium自动安装settings_apk-debug.apk, 改用手动通过adb安装 安装成功appium检测到已安装后将不再自动安装

列出包名

adb shell pm list packages
adb shell pm list packages -3
# 搜索带google的包名
adb shell pm list packages | grep google

获取app启动页

# step1: 启动app
# step2:
adb shell dumpsys window | grep mCurrentFocus
adb shell dumpsys window | findstr mCurrentFocus

查看app当前页面布局

adb shell uiautomator dump
adb pull /sdcard/window_dump.xml

自动下载chromedriver版本 appium --allow-insecure chromedriver_autodownload

appium/appium#17276

appspider's People

Contributors

rcjiang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.