appium跑自动化,应用首页打开后卡住不动了,无明显报错行为,请问是怎么回事

在使用Appium进行自动化测试时,启动应用com.android.calculator2的模拟器会卡在首页无法继续操作。Appium日志显示已成功创建会话,但设备上并未出现预期的交互。尽管没有明显的错误信息,警告提示建议设置'automationName'为'UiAutomator2',因为'UiAutomator1'不再被操作系统供应商维护。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[info] [35m[Appium][39m Welcome to Appium v1.13.0
[info] [35m[Appium][39m Non-default server args:
[info] [35m[Appium][39m address: 127.0.0.1
[info] [35m[Appium][39m Appium REST http interface listener started on 127.0.0.1:4723[info] [35m[HTTP][39m [37m–>[39m [37mPOST[39m [37m/wd/hub/session[39m
[info] [35m[HTTP][39m [90m{“desiredCapabilities”:{“appActivity”:".Calculator",“appPackage”:“com.android.calculator2”,“platformVersion”:“6.0”,“automationName”:“Appium”,“platformName”:“Android”,“deviceName”:“Android Emulator”},“capabilities”:{“firstMatch”:[{“appium:appActivity”:".Calculator",“appium:appPackage”:“com.android.calculator2”,“appium:automationName”:“Appium”,“appium:deviceName”:“Android Emulator”,“platformName”:“android”,“appium:platformVersion”:“6.0”}]}}[39m
[debug] [35m[W3C][39m Calling AppiumDriver.createSession() with args: [{“appActivity”:".Calculator",“appPackage”:“com.android.calculator2”,“platformVersion”:“6.0”,“automationName”:“Appium”,“platformName”:“Android”,“deviceName”:“Android Emulator”},null,{“firstMatch”:[{“appium:appActivity”:".Calculator",“appium:appPackage”:“com.android.calculator2”,“appium:automationName”:“Appium”,“appium:deviceName”:“Android Emulator”,“platformName”:“android”,“appium:platformVersion”:“6.0”}]}]
[debug] [35m[BaseDriver][39m Event ‘newSessionRequested’ logged at 1569293904764 (10:58:24 GMT+0800 (中国标准时间))
[warn] [35m[Appium][39m
[warn] [35m[Appium][39m ======================================================================
[warn] [35m[Appium][39m DEPRECATION WARNING:
[warn] [35m[Appium][39m
[warn] [35m[Appium][39m The ‘automationName’ capability was not provided in the desired
[warn] [35m[Appium][39m capabilities for this Android session
[warn] [35m[Appium][39m
[warn] [35m[Appium][39m Setting ‘automationName=UiAutomator1’ by default and using the
[warn] [35m[Appium][39m UiAutomator1 Driver
[warn] [35m[Appium][39m
[warn] [35m[Appium][39m The next minor version of Appium (1.14.x) will set
[warn] [35m[Appium][39m ‘automationName=UiAutomator2’ by default and use the UiAutomator2
[warn] [35m[Appium][39m Driver
[warn] [35m[Appium][39m
[warn] [35m[Appium][39m The next major version of Appium (2.x) will require the
[warn] [35m[Appium][39m ‘automationName’ capability to be set for all sessions on all
[warn] [35m[Appium][39m platforms
[warn] [35m[Appium][39m
[warn] [35m[Appium][39m If you are happy with ‘UiAutomator1’ and do not wish to upgrade
[warn] [35m[Appium][39m Android drivers, please add ‘automationName=UiAutomator1’ to your
[warn] [35m[Appium][39m desired capabilities
[warn] [35m[Appium][39m
[warn] [35m[Appium][39m For more information about drivers, please visit
[warn] [35m[Appium][39m http://appium.io/docs/en/about-appium/intro/ and explore the
[warn] [35m[Appium][39m ‘Drivers’ menu
[warn] [35m[Appium][39m
[warn] [35m[Appium][39m ======================================================================
[warn] [35m[Appium][39m
[info] [35m[Appium][39m Setting automation to ‘UiAutomator1’.
[warn] [35m[Appium][39m Consider setting ‘automationName’ capability to ‘UiAutomator2’ on Android >= 6, since UIAutomator1 framework is not maintained anymore by the OS vendor.
[info] [35m[Appium][39m Appium v1.13.0 creating new AndroidDriver (v4.15.1) session
[info] [35m[Appium][39m Capabilities:
[info] [35m[Appium][39m platformName: android
[info] [35m[Appium][39m appActivity: .Calculator
[info] [35m[Appium][39m appPackage: com.android.calculator2
[info] [35m[Appium][39m automationName: Appium
[info] [35m[Appium][39m deviceName: Android Emulator
[info] [35m[Appium][39m platformVersion: 6.0
[debug] [35m[BaseDriver][39m W3C capabilities {“alwaysMatch”:{“platformNa… and MJSONWP desired capabilities {“appActivity”:”.Calculator… were provided
[debug] [35m[BaseDriver][39m Creating session with W3C capabilities: {“alwaysMatch”:{“platformNa…
[info] [35m[BaseDriver][39m Session created with session id: 48f69ece-e641-4ca3-a4b7-76b40f87b7fc
[info] [35m[ADB][39m Using ‘adb.exe’ from ‘E:\android-sdk-windows\platform-tools\adb.exe’
[info] [35m[AndroidDriver][39m Retrieving device list
[debug] [35m[ADB][39m Trying to find a connected android device
[debug] [35m[ADB][39m Getting connected devices…[debug] [35m[ADB][39m 1 device(s) connected
[info] [35m[AndroidDriver][39m Looking for a device with Android ‘6.0’
[debug] [35m[ADB][39m Setting device id to 8025d028
[info] [35m[ADB][39m Getting device platform version
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell getprop ro.build.version.release’
[debug] [35m[ADB][39m Current device property ‘ro.build.version.release’: 6.0.1
[info] [35m[AndroidDriver][39m Using device: 8025d028
[info] [35m[ADB][39m Using ‘adb.exe’ from ‘E:\android-sdk-windows\platform-tools\adb.exe’
[debug] [35m[ADB][39m Setting device id to 8025d028
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell getprop ro.build.version.sdk’
[debug] [35m[ADB][39m Current device property ‘ro.build.version.sdk’: 23
[debug] [35m[ADB][39m Device API level: 23
[warn] [35m[AndroidDriver][39m Consider setting ‘automationName’ capability to ‘uiautomator2’ on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor.
[info] [35m[AndroidDriver][39m App file was not listed, instead we’re going to run com.android.calculator2 directly on the device
[debug] [35m[AndroidDriver][39m Checking whether package is present on the device
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell pm list packages com.android.calculator2’[info] [35m[AndroidDriver][39m Starting Android session
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 wait-for-device’
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell echo ping’
[debug] [35m[AndroidDriver][39m Pushing settings apk to device…
[debug] [35m[ADB][39m Getting install status for io.appium.settings
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell dumpsys package io.appium.settings’[debug] [35m[ADB][39m ‘io.appium.settings’ is installed
[debug] [35m[ADB][39m Getting package info for ‘io.appium.settings’
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell dumpsys package io.appium.settings’
[info] [35m[ADB][39m Using ‘aapt.exe’ from ‘E:\android-sdk-windows\build-tools\29.0.2\aapt.exe’[debug] [35m[ADB][39m The version name of the installed ‘io.appium.settings’ is greater or equal to the application version name (‘2.14.0’ >= ‘2.14.0’)
[debug] [35m[ADB][39m There is no need to install/upgrade ‘C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk’
[debug] [35m[ADB][39m Getting IDs of all ‘io.appium.settings’ processes
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell ‘pgrep --help; echo $?’’
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell pgrep -f io\.appium\.settings’[info] [35m[AndroidDriver][39m Granting android.permission.SET_ANIMATION_SCALE, CHANGE_CONFIGURATION, ACCESS_FINE_LOCATION by pm grant
[debug] [35m[ADB][39m Granting permissions [“android.permission.SET_ANIMATION_SCALE”,“android.permission.CHANGE_CONFIGURATION”,“android.permission.ACCESS_FINE_LOCATION”] to ‘io.appium.settings’
[debug] [35m[ADB][39m Got the following command chunks to execute: [[“pm”,“grant”,“io.appium.settings”,“android.permission.SET_ANIMATION_SCALE”,”;",“pm”,“grant”,“io.appium.settings”,“android.permission.CHANGE_CONFIGURATION”,";",“pm”,“grant”,“io.appium.settings”,“android.permission.ACCESS_FINE_LOCATION”,";"]]
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell pm grant io.appium.settings android.permission.SET_ANIMATION_SCALE ; pm grant io.appium.settings android.permission.CHANGE_CONFIGURATION ; pm grant io.appium.settings android.permission.ACCESS_FINE_LOCATION ;’[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell appops set io.appium.settings android:mock_location allow’[debug] [35m[Logcat][39m Starting logcat capture[info] [35m[ADB][39m Getting device platform version
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell getprop ro.build.version.release’
[debug] [35m[ADB][39m Current device property ‘ro.build.version.release’: 6.0.1
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell wm size’[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell getprop ro.product.model’[debug] [35m[ADB][39m Current device property ‘ro.product.model’: OPPO R9s
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell getprop ro.product.manufacturer’
[debug] [35m[ADB][39m Current device property ‘ro.product.manufacturer’: OPPO
[warn] [35m[AndroidDriver][39m No app sent in, not parsing package/activity
[debug] [35m[AndroidDriver][39m No app capability. Assuming it is already on the device
[debug] [35m[ADB][39m Getting install status for com.android.calculator2
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell dumpsys package com.android.calculator2’[debug] [35m[ADB][39m ‘com.android.calculator2’ is installed
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell am force-stop com.android.calculator2’[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell pm clear com.android.calculator2’[debug] [35m[AndroidDriver][39m Performed fast reset on the installed ‘com.android.calculator2’ application (stop and clear)
[debug] [35m[AndroidBootstrap][39m Watching for bootstrap disconnect
[debug] [35m[ADB][39m Forwarding system: 4724 to device: 4724
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 forward tcp:4724 tcp:4724’
[debug] [35m[UiAutomator][39m Starting UiAutomator
[debug] [35m[UiAutomator][39m Moving to state ‘starting’
[debug] [35m[UiAutomator][39m Parsing uiautomator jar
[debug] [35m[UiAutomator][39m Found jar name: ‘AppiumBootstrap.jar’
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell mkdir -p /data/local’
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 push C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\bootstrap\bin\AppiumBootstrap.jar /data/local/tmp/’[debug] [35m[ADB][39m Attempting to kill all uiautomator processes
[debug] [35m[ADB][39m Getting IDs of all ‘uiautomator’ processes
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell pgrep -f uiautomator’
[info] [35m[ADB][39m No ‘uiautomator’ process has been found
[debug] [35m[UiAutomator][39m Starting UIAutomator
[debug] [35m[ADB][39m Creating ADB subprocess with args: ["-P",5037,"-s",“8025d028”,“shell”,“uiautomator”,“runtest”,“AppiumBootstrap.jar”,"-c",“io.appium.android.bootstrap.Bootstrap”,"-e",“pkg”,“com.android.calculator2”,"-e",“disableAndroidWatchers”,false,"-e",“acceptSslCerts”,false][debug] [35m[UiAutomator][39m Moving to state ‘online’
[info] [35m[AndroidBootstrap][39m Android bootstrap socket is now connected
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell dumpsys window’
[debug] [35m[AndroidBootstrap][39m [BOOTSTRAP LOG] [debug] Registered crash watchers.
[debug] [35m[AndroidBootstrap][39m [BOOTSTRAP LOG] [debug] Client connected
[info] [35m[AndroidDriver][39m Screen already unlocked, doing nothing
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell am start -W -n com.android.calculator2/.Calculator -S’[info] [35m[Appium][39m New AndroidDriver session created successfully, session 48f69ece-e641-4ca3-a4b7-76b40f87b7fc added to master session list
[debug] [35m[BaseDriver][39m Event ‘newSessionStarted’ logged at 1569293919676 (10:58:39 GMT+0800 (中国标准时间))
[debug] [35m[W3C (48f69ece)][39m Cached the protocol value ‘W3C’ for the new session 48f69ece-e641-4ca3-a4b7-76b40f87b7fc
[debug] [35m[W3C (48f69ece)][39m Responding to client with driver.createSession() result: {“capabilities”:{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“android”,“appActivity”:".Calculator",“appPackage”:“com.android.calculator2”,“automationName”:“Appium”,“deviceName”:“Android Emulator”,“platformVersion”:“6.0”},“platformName”:“android”,“appActivity”:".Calculator",“appPackage”:“com.android.calculator2”,“automationName”:“Appium”,“deviceName”:“8025d028”,“platformVersion”:“6.0.1”,“deviceUDID”:“8025d028”,“deviceScreenSize”:“1080x1920”,“deviceModel”:“OPPO R9s”,“deviceManufacturer”:“OPPO”}}
[info] [35m[HTTP][39m [37m<-- POST /wd/hub/session [39m[32m200[39m [90m14914 ms - 735[39m
[info] [35m[HTTP][39m [90m[39m
[info] [35m[HTTP][39m [37m–>[39m [37mGET[39m [37m/wd/hub/session/48f69ece-e641-4ca3-a4b7-76b40f87b7fc[39m
[info] [35m[HTTP][39m [90m{}[39m
[debug] [35m[W3C (48f69ece)][39m Calling AppiumDriver.getSession() with args: [“48f69ece-e641-4ca3-a4b7-76b40f87b7fc”]
[debug] [35m[W3C (48f69ece)][39m Responding to client with driver.getSession() result: {“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“android”,“appActivity”:".Calculator",“appPackage”:“com.android.calculator2”,“automationName”:“Appium”,“deviceName”:“Android Emulator”,“platformVersion”:“6.0”},“platformName”:“android”,“appActivity”:".Calculator",“appPackage”:“com.android.calculator2”,“automationName”:“Appium”,“deviceName”:“8025d028”,“platformVersion”:“6.0.1”,“deviceUDID”:“8025d028”,“deviceScreenSize”:“1080x1920”,“deviceModel”:“OPPO R9s”,“deviceManufacturer”:“OPPO”}
[info] [35m[HTTP][39m [37m<-- GET /wd/hub/session/48f69ece-e641-4ca3-a4b7-76b40f87b7fc [39m[32m200[39m [90m2 ms - 667[39m
[info] [35m[HTTP][39m [90m[39m[warn] [35m[BaseDriver][39m Shutting down because we waited 60 seconds for a command
[debug] [35m[AndroidDriver][39m Shutting down Android driver
[warn] [35m[Appium][39m Closing session, cause was ‘New Command Timeout of 60 seconds expired. Try customizing the timeout using the ‘newCommandTimeout’ desired capability’
[info] [35m[Appium][39m Removing session 48f69ece-e641-4ca3-a4b7-76b40f87b7fc from our master session list
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell am force-stop com.android.calculator2’[debug] [35m[ADB][39m Pressing the HOME button
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell input keyevent 3’[debug] [35m[AndroidBootstrap][39m Sending command to android: {“cmd”:“shutdown”}
[debug] [35m[AndroidBootstrap][39m [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“shutdown”}
[debug] [35m[AndroidBootstrap][39m [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[debug] [35m[AndroidBootstrap][39m [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”}
[debug] [35m[AndroidBootstrap][39m Received command result from bootstrap
[debug] [35m[UiAutomator][39m Shutting down UiAutomator
[debug] [35m[UiAutomator][39m Moving to state ‘stopping’
[debug] [35m[AndroidBootstrap][39m [BOOTSTRAP LOG] [debug] Closed client connection
[debug] [35m[UiAutomator][39m UiAutomator shut down normally
[debug] [35m[UiAutomator][39m Moving to state ‘stopped’
[debug] [35m[ADB][39m Attempting to kill all uiautomator processes
[debug] [35m[ADB][39m Getting IDs of all ‘uiautomator’ processes
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell pgrep -f uiautomator’[info] [35m[ADB][39m No ‘uiautomator’ process has been found
[debug] [35m[UiAutomator][39m Moving to state ‘stopped’
[debug] [35m[Logcat][39m Stopping logcat capture
[debug] [35m[ADB][39m Running ‘E:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 8025d028 shell am force-stop io.appium.unlock’[debug] [35m[AndroidDriver][39m Not cleaning generated files. Add clearSystemFiles capability if wanted.[info] [35m[HTTP][39m [37m–>[39m [37mGET[39m [37m/wd/hub/sessions[39m
[info] [35m[HTTP][39m [90m{}[39m
[debug] [35m[GENERIC][39m Calling AppiumDriver.getSessions() with args: []
[debug] [35m[GENERIC][39m Responding to client with driver.getSessions() result: []
[info] [35m[HTTP][39m [37m<-- GET /wd/hub/sessions [39m[32m200[39m [90m4 ms - 40[39m
[info] [35m[HTTP][39m [90m[39m

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值