appium 日志

Checking if an update is available
Update not available
Launching Appium server with command: F:\tools\appium\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --session-override --platform-name Android --platform-version 23 --automation-name Appium --log-no-color
info: Welcome to Appium v1.4.0 (REV 8f63e2f91ef7907aed8bda763f4e5ca08e86970a)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {"address":"127.0.0.1","sessionOverride":true,"logNoColors":true,"platformName":"Android","platformVersion":"23","automationName":"Appium"}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"capabilities":{"firstMatch":[{"platformName":"Android","appium:platformVersion":"4.4.2","appium:deviceName":"MI 6","appium:appPackage":"com.hlww.com.hlww","appium:appActivity":"com.netease.nim.demo.zy.model.WelcomActivity","appium:appWaitActivity":"com.netease.nim.demo.zy.model.WelcomActivity","appium:sessionOverride":true}]},"desiredCapabilities":{"platformName":"Android","platformVersion":"4.4.2","deviceName":"MI 6","appPackage":"com.hlww.com.hlww","appActivity":"com.netease.nim.demo.zy.model.WelcomActivity","appWaitActivity":"com.netease.nim.demo.zy.model.WelcomActivity","sessionOverride":true}}
info: Client User-Agent string: selenium/3.141.0 (python windows)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : sessionOverride
info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session 98ad5844-1ab3-4ed6-bfde-dd33bf48ef25
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_191
info: [debug] Checking whether adb is present
info: [debug] Using adb from F:\android-sdk-windows\platform-tools\adb.exe
warn: No app capability, can't parse package/activity
info: [debug] Set chromedriver binary as: F:\tools\appium\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it's already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: F:\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device 127.0.0.1:62001
info: [debug] Setting device id to 127.0.0.1:62001
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: F:\android-sdk-windows\platform-tools\adb.exe -s 127.0.0.1:62001 wait-for-device
info: [debug] Retrying restartAdb
error: Error running wait-for-device
info: [debug] executing cmd: F:\android-sdk-windows\platform-tools\adb.exe -s 127.0.0.1:62001 kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: F:\android-sdk-windows\platform-tools\adb.exe -s 127.0.0.1:62001 devices

代码:

coding=utf-8

from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.4.2'
desired_caps['deviceName'] = 'MI 6'
desired_caps['appPackage'] = 'com.hlww.com.hlww'
desired_caps['appActivity'] = 'com.netease.nim.demo.zy.model.WelcomActivity'
desired_caps['appWaitActivity'] = 'com.netease.nim.demo.zy.model.WelcomActivity'
desired_caps['sessionOverride'] = True # 每次启动时覆盖 session,否则第二次后运行会报错不能新建 session

固定的访问 appium 访问的地址

driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

adb 连接正常
C:\Users\ASUS>adb devices
List of devices attached
127.0.0.1:62001 device

之前都能运行 现在突然跑不动了,pycharm 一直在运行中


↙↙↙阅读原文可查看相关链接,并与作者交流