1、第一个错误如下:
main.js: error: argument "--app": Expected one argument. null
这个一般是appium服务端安装的时候路径里面的目录名包含了空格,比如默认安装的目录为“Program Files (x86)”’,中间带有空格。
建议在安装的时候直接安装在根目录下,名称为appium即可,如“C:\appium”
2、第二个错误如下:
info: [debug] Cleaning up appium session
> error: Failed to start an Appium session, err was: Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
> info: [debug] Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
> at [object Object].<anonymous> (D:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1146:21)
> at [object Object].<anonymous> (D:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
> at ChildProcess.exithandler (child_process.js:742:7)
> at ChildProcess.emit (events.js:110:17)
> at maybeClose (child_process.js:1016:16)
> at Socket.<anonymous> (child_process.js:1184:11)
> at Socket.emit (events.js:107:17)
> at Pipe.close (net.js:484:11)
这是由于设置的appActivity不对造成的,需要根据实际情况填写
3、第三个错误如下:
执行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: A new session could not be created. (Original error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 621QECQ23DKQP is not online
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)))
解决方法一:增加一个参数appWaitActivity,把后启动的activity放到这里,如百度app:
解决方法二:勾选appium中的参数Override Existing Session