appium连接android真机错误提示

来源:1-6 appium启动代码配置讲解

qq_王超_8

2019-03-14

图片描述买了教程后,有点小崩溃了,哈哈。

教程一开始用的是模拟环境,我用的是安卓手机。

在启动appium的时候,需要几个配置参数。老师用的是平台名称、设备名称、和app的安装路径。我用的是平台名称、设备名称、appPAckage、appActivity。
我输入后面四个参数手机能正常连上appium

所以我在编写代码时,直接复制了四个参数。

可是。。。一编译就一堆报错。

我想确认事情:
我能用那四个参数来启动appium吗(apk路径的方法我搞了好几次,都显示错误运行不了appium)我都下了x-plore看到了手机端的路径

老师方便的后,以后可以加入真机的详细配置操作图片描述

我终于用源代码把安卓真机端的app运行起来了。一个礼拜填了好多坑,也学到了很多。代码看上去没啥区别,可能一个空格、一个断码模式就能引发nd的问题。sublime和pycharm 我以前一窍不通,一个礼拜下来,感觉pycharm更适合新手,里面的代码检查可以帮助新人查到代码的根本原因。我会继续加油的。

写回答

5回答

Mushishi

2019-03-15

 platformName 'e6866ad3' 这个千万不能错。appium 或者你不配置

0
2
qq_王超_8
谢谢了。我终于跑起来了。下了pycharm的汉化包,然后用代码检查命令发现是由于1.webdriver.Remote("http://127.0.0.1:4723/wd/hub", capabilities) capablitities前面少了一个空格 2.webdriver.Remote("http://127.0.0.1:4723/wd/hub", capabilities) 我之前用的是http://0.0.0.0:4723/wd/hub 3.webdriver.Remote("http://127.0.0.1:4723/wd/hub", capabilities) 提示说什么最后空白行之类的 4.参数里面的字母不对,调整格式后成功 作为小白,一个礼拜了,终于搞清了好多工具是干啥用,我会继续加油的
2019-03-19
共2条回复

Mushishi

2019-03-15

/哥 ,//img.mukewang.com/szimg/5c8b0c0e000124ab05950158.jpg这个无论模拟器还是真机都是医院得,平台,永远都是appium 还有uiautomator2 当然4.4以前另外说。这个不变。deviceName是我们adb devices获取道德,这个你为啥这么写呢。waitactivity先别配置。按照教程一步一步走。后面会有无法启动真机德教程

0
0

qq_王超_8

提问者

2019-03-14

又发现个问题,platformName和devicesName的参数搞反了,改过来依旧不能允许成功,继续

0
0

qq_王超_8

提问者

2019-03-14

不行,我还是搞不定,还请老师帮忙解惑


E:\新建文件夹\python.exe E:/untitled/AppiumPython/case/start_appium.py

Traceback (most recent call last):

  File "E:/untitled/AppiumPython/case/start_appium.py", line 7, in <module>

    webdriver.Remote("http://127.0.0.1:4723/wd/hub",capabilities)

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\appium\webdriver\webdriver.py", line 129, in __init__

    proxy

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__

    self.start_session(capabilities, browser_profile)

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\appium\webdriver\webdriver.py", line 204, in start_session

    response = self.execute(RemoteCommand.NEW_SESSION, parameters)

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute

    self.error_handler.check_response(response)

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response

    raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not find a driver for platformName 'e6866ad3'. Please check your desired capabilities.



Process finished with exit code 1


0
0

qq_王超_8

提问者

2019-03-14

E:\新建文件夹\python.exe E:/untitled/AppiumPython/case/start_appium.py

Traceback (most recent call last):

  File "E:/untitled/AppiumPython/case/start_appium.py", line 7, in <module>

    webdriver.Remote("http://127.0.0.1:4723/wd/hub",capabilities)

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\appium\webdriver\webdriver.py", line 129, in __init__

    proxy

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__

    self.start_session(capabilities, browser_profile)

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\appium\webdriver\webdriver.py", line 204, in start_session

    response = self.execute(RemoteCommand.NEW_SESSION, parameters)

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute

    self.error_handler.check_response(response)

  File "C:\Users\wangchao\AppData\Roaming\Python\Python37\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response

    raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not find a driver for platformName 'e6866ad3'. Please check your desired capabilities.



Process finished with exit code 1


0
1
qq_王超_8
我再试下,可能是手机这边安全屏蔽了。
2019-03-14
共1条回复

Python主讲移动端自动化测试框架Appium

APP自动化基础知识、po模型、关键字模型、服务自动化、持续集成

1508 学习 · 1333 问题

查看课程