请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

启动之后报错,老师该如何解决

Connected to pydev debugger (build 183.4886.43)
Traceback (most recent call last):
File “D:\software_pakage\pthyon\PyCharm Community Edition 2018.3.2\helpers\pydev\pydevd.py”, line 1741, in
main()
File “D:\software_pakage\pthyon\PyCharm Community Edition 2018.3.2\helpers\pydev\pydevd.py”, line 1735, in main
globals = debugger.run(setup[‘file’], None, None, is_module)
File “D:\software_pakage\pthyon\PyCharm Community Edition 2018.3.2\helpers\pydev\pydevd.py”, line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File “D:\software_pakage\pthyon\PyCharm Community Edition 2018.3.2\helpers\pydev_pydev_imps_pydev_execfile.py”, line 18, in execfile
exec(compile(contents+"\n", file, ‘exec’), glob, loc)
File “D:/lishaohui/learn_appium/venv/case/start_appium.py”, line 8, in
webdriver.Remote(“http://127.0.0.1:4723/wd/hub”,capabilities)
File “D:\lishaohui\learn_appium\venv\lib\site-packages\appium\webdriver\webdriver.py”, line 144, in init
proxy
File “D:\lishaohui\learn_appium\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 157, in init
self.start_session(capabilities, browser_profile)
File “D:\lishaohui\learn_appium\venv\lib\site-packages\appium\webdriver\webdriver.py”, line 219, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, parameters)
File “D:\lishaohui\learn_appium\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 321, in execute
self.error_handler.check_response(response)
File “D:\lishaohui\learn_appium\venv\lib\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: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.

正在回答 回答被采纳积分+3

插入代码

3回答

Mushishi 2019-11-20 21:59:53

说的是你activity没有起,你可以把aooium里面启动配置把activity配置上

0 回复 有任何疑惑可以回复我~
提问者 shaohui_Tester 2019-11-20 16:17:46

[ADB] Getting install status for com.tianyuyou.shop

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell dumpsys package com.tianyuyou.shop'

[ADB] 'com.tianyuyou.shop' is installed

[ADB] Getting package info for 'com.tianyuyou.shop'

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell dumpsys package com.tianyuyou.shop'

[ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["D:\\andriodSDK\\platform-tools\\apkanalyzer.bat","D:\\andriodSDK\\emulator\\apkanalyzer.bat","D:\\andriodSDK\\tools\\apkanalyzer.bat","D:\\andriodSDK\\tools\\bin\\apkanalyzer.bat","D:\\andriodSDK\\build-tools\\29.0.2\\apkanalyzer.bat","D:\\andriodSDK\\build-tools\\29.0.1\\apkanalyzer.bat","D:\\andriodSDK\\build-tools\\28.0.3\\apkanalyzer.bat","D:\\andriodSDK\\build-tools\\28.0.2\\apkanalyzer.bat","D:\\andriodSDK\\build-tools\\27.0.3\\apkanalyzer.bat","D:\\andriodSDK\\build-tools\\27.0.0\\apkanalyzer.bat","D:\\andriodSDK\\build-tools\\26.0.2\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'D:\andriodSDK'?

[ADB] The version name of the installed 'com.tianyuyou.shop' is greater or equal to the application version name ('3.3.0' >= '3.3.0')

[ADB] There is no need to install/upgrade 'D:\testpackage\app1004.apk'

[AndroidDriver] Performing fast reset on 'com.tianyuyou.shop'

[ADB] Getting install status for com.tianyuyou.shop

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell dumpsys package com.tianyuyou.shop'

[ADB] 'com.tianyuyou.shop' is installed

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell am force-stop com.tianyuyou.shop'

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell pm clear com.tianyuyou.shop'

[AndroidDriver] Performed fast reset on the installed 'com.tianyuyou.shop' application (stop and clear)

[UiAutomator2] Performing shallow cleanup of automation leftovers

[UiAutomator2] No obsolete sessions have been detected (Error: socket hang up)

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell am force-stop io.appium.uiautomator2.server.test'

[UiAutomator2] Starting UIAutomator2 server 4.3.0

[UiAutomator2] Using UIAutomator2 server from 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.3.0.apk' and test from 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk'

[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online...

[ADB] Creating ADB subprocess with args: ["-P",5037,"-s","CUY0219503002283","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]

[Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:

[WD Proxy] Matched '/status' to command name 'getStatus'

[WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body

[WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"}

[WD Proxy] Matched '/status' to command name 'getStatus'

[WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body

[WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"}

[WD Proxy] Matched '/status' to command name 'getStatus'

[WD Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body

[WD Proxy] Got response with status 200: {"sessionId":"None","value":{"ready":true,"message":"UiAutomator2 Server is ready to accept commands"}}

[UiAutomator2] The initialization of the instrumentation process took 3163ms

[WD Proxy] Matched '/session' to command name 'createSession'

[WD Proxy] Proxying [POST /session] to [POST http://localhost:8200/wd/hub/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","deviceName":"CUY0219503002283","app":"D:\\testpackage\\app1004.apk"},"platformName":"Android","deviceName":"CUY0219503002283","app":"D:\\testpackage\\app1004.apk","deviceUDID":"CUY0219503002283","appPackage":"com.tianyuyou.shop"}],"alwaysMatch":{}}}

[WD Proxy] Got response with status 200: {"sessionId":"445d29b1-81d1-4e2f-be58-9a1c3265d54c","value":{"sessionId":"445d29b1-81d1-4e2f-be58-9a1c3265d54c","capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","deviceName":"CUY0219503002283","app":"D:\\testpackage\\app1004.apk"},"platformName":"Android","deviceName":"CUY0219503002283","app":"D:\\testpackage\\app1004.apk","deviceUDID":"CUY0219503002283","appPackage":"com.tianyuyou.shop"}],"alwaysMatch":{}}}}

[WD Proxy] Determined the downstream protocol as 'W3C'

[WD Proxy] Proxying [GET /appium/device/info] to [GET http://localhost:8200/wd/hub/session/445d29b1-81d1-4e2f-be58-9a1c3265d54c/appium/device/info] with no body

[WD Proxy] Got response with status 200: {"sessionId":"445d29b1-81d1-4e2f-be58-9a1c3265d54c","value":{"androidId":"c7c50250f8cbeaed","manufacturer":"HUAWEI","model":"YAL-AL00","brand":"HONOR","apiVersion":"28","platformVersion":"9","carrierName":"中国电信","realDisplaySize":"1080x2340","displayDensity":480,"networks":[{"type":1,"typeName":"WIFI","subtype":0,"subtypeName":"","isConnected":true,"detailedState":"CONNECTED","state":"CONNECTED","extraInfo":null,"isAvailable":true,"isFailover":false,"isRoaming":false,"capabilities":{"transportTypes":"NET_CAPABILITY_SUPL","networkCapabilities":"","linkUpstreamBandwidthKbps":1048576,"linkDownBandwidthKbps":1048576,"signalStrength":-64,"networkSpecifier":null,"SSID":null}}],"locale":"zh_CN_#Hans","timeZone":"Asia\/Shanghai"}}

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell dumpsys window'

[AndroidDriver] Screen already unlocked, doing nothing

[UiAutomator2] Starting 'com.tianyuyou.shop/com.tianyuyou.shop.activity.SplashActivity and waiting for 'com.tianyuyou.shop/com.tianyuyou.shop.activity.SplashActivity'

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell am start -W -n com.tianyuyou.shop/com.tianyuyou.shop.activity.SplashActivity -S'

[ADB] Waiting up to 20000ms for activity matching pkg: 'com.tianyuyou.shop' and activity: 'com.tianyuyou.shop.activity.SplashActivity' to be focused

[ADB] Possible activities, to be checked: 'com.tianyuyou.shop.activity.SplashActivity', 'com.tianyuyou.shop.com.tianyuyou.shop.activity.SplashActivity'

[ADB] Getting focused package and activity

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell dumpsys window windows'

[ADB] Found package: 'com.huawei.android.launcher' and fully qualified activity name : 'com.huawei.android.launcher.unihome.UniHomeLauncher'

[ADB] Incorrect package and activity. Retrying.


0 回复 有任何疑惑可以回复我~
  • 提问者 shaohui_Tester #1
    这是我的appium大部分日志
    回复 有任何疑惑可以回复我~ 2019-11-20 16:18:12
提问者 shaohui_Tester 2019-11-20 16:14:18

这是appium报错 很是让人头疼

[ADB] Found package: 'com.huawei.android.launcher' and fully qualified activity name : 'com.huawei.android.launcher.unihome.UniHomeLauncher'

[ADB] Incorrect package and activity. Retrying.

[ADB] Getting focused package and activity

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell dumpsys window windows'

[ADB] Found package: 'com.huawei.android.launcher' and fully qualified activity name : 'com.huawei.android.launcher.unihome.UniHomeLauncher'

[ADB] Incorrect package and activity. Retrying.

[ADB] Getting focused package and activity

[ADB] Running 'D:\andriodSDK\platform-tools\adb.exe -P 5037 -s CUY0219503002283 shell dumpsys window windows'

[ADB] Found package: 'com.huawei.android.launcher' and fully qualified activity name : 'com.huawei.android.launcher.unihome.UniHomeLauncher'

[ADB] Incorrect package and activity. Retrying.

[ADB] Getting focused package and activity


0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信