Appium连接真机 无法启动app

来源:

Hanson_Meng

2017-01-14

Appium log:

aunching Appium server with command: D:\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 23 --automation-name Appium --device-name "1e1d6bc5" --log-no-color
> info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"deviceName":"1e1d6bc5","platformName":"Android","platformVersion":"23","automationName":"Appium"}
> info: Console LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"unicodeKeyboard":"True","resetKeyboard":"True","appActivity":".activity.SplashActivity","appPackage":"com.tencent.mobileqq","deviceName":"1e1d6bc5","platformVersion":"6.0.1","platformName":"Android"},"requiredCapabilities":{}}
> info: Client User-Agent string: Python-urllib/3.5
> warn: Converting cap unicodeKeyboard from string to boolean. This might cause unexpected behavior.
> warn: Converting cap resetKeyboard from string to boolean. This might cause unexpected behavior.
> 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 a6176ba4-7e7a-4f08-910d-aa42eccbbf6b
> info: Starting android appium
> info: [debug] Getting Java version
> info: Java version is: 1.8.0_77
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from D:\Android\sdk\platform-tools\adb.exe
> warn: No app capability, can't parse package/activity
> 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: D:\Android\sdk\platform-tools\adb.exe devices
> info: [debug] 2 device(s) connected
> info: Found device adb server is out of date.  killing...
> info: [debug] Setting device id to adb server is out of date.  killing...
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  wait-for-device
> info: [debug] Retrying restartAdb
> error: Error running wait-for-device
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  kill-server
> error: Error killing ADB server, going to see if it's online anyway
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  devices
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  wait-for-device
> error: Error running wait-for-device
> info: [debug] Retrying restartAdb
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  kill-server
> error: Error killing ADB server, going to see if it's online anyway
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  devices
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  wait-for-device
> error: Error running wait-for-device
> info: [debug] Retrying restartAdb
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  kill-server
> error: Error killing ADB server, going to see if it's online anyway
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  devices
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  wait-for-device
> error: Error running wait-for-device
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  kill-server
> error: Error killing ADB server, going to see if it's online anyway
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  devices
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  wait-for-device
> error: Error running wait-for-device
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> warn: UiAutomator did not shut down fast enough, calling it gone
> info: [debug] Cleaning up android objects
> info: [debug] Cleaning up appium session
> error: Failed to start an Appium session, err was: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  wait-for-device"
> ADB server didn't ACK
> * could not start server *
>
> info: [debug] Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.  killing...
>  wait-for-device"
> ADB server didn't ACK
> * could not start server *
>
>     at ChildProcess.exithandler (child_process.js:751:12)
>     at ChildProcess.emit (events.js:110:17)
>     at maybeClose (child_process.js:1016:16)
>     at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
> info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\\WINDOWS\\system32\\cmd.exe /s /c \"D:\\Android\\sdk\\platform-tools\\adb.exe -s adb server is out of date.  killing...\r wait-for-device\"\nADB server didn't ACK\r\n* could not start server *\r\n)","killed":false,"code":4294967295,"signal":null,"cmd":"C:\\WINDOWS\\system32\\cmd.exe /s /c \"D:\\Android\\sdk\\platform-tools\\adb.exe -s adb server is out of date.  killing...\r wait-for-device\"","origValue":"Command failed: C:\\WINDOWS\\system32\\cmd.exe /s /c \"D:\\Android\\sdk\\platform-tools\\adb.exe -s adb server is out of date.  killing...\r wait-for-device\"\nADB server didn't ACK\r\n* could not start server *\r\n"},"sessionId":null}
> info: <-- POST /wd/hub/session 500 13841.814 ms - 750

脚本:

#coding=utf-8
import time
from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0.1'
desired_caps['deviceName'] = '1e1d6bc5'
desired_caps['appPackage'] = 'com.tencent.mobileqq'
desired_caps['appActivity'] = '.activity.SplashActivity'
desired_caps['unicodeKeyboard'] = 'True'
desired_caps['resetKeyboard'] = 'True'

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps)
time.sleep(5)
driver.find_element_by_id('iv_my').click()
driver.find_element_by_id('button_nologin').click()

driver.quit()



写回答

2回答

毫末

2017-01-14

D:\Android\sdk\platform-tools\adb.exe -s adb server is out of date.    adb 的服务是如何搭建的?貌似adb的版本有点旧了

0
0

Hanson_Meng

提问者

2017-01-20

安装Android studio 自带的 

0
1
毫末
最好是下载新的sdk,然后用sdkmanager更新一下,会下载最新的adb工具
2017-04-24
共1条回复

安卓自动化测试入门 Python篇

Android测试工程师必备技能,性能 、压力、 接口、 持续集成、自动化脚本

1110 学习 · 336 问题

查看课程