0.先启动appium
1.编写代码
如下:
from appium import webdriver
from appium.webdriver.extensions.android.nativekey import AndroidKey
desired_caps = {
'platformName': 'Android',
'platformVersion': '10',
'deviceName': ':VOG_AL10',
'appPackage': 'com.sankuai.meituan',
'appActivity': 'com.meituan.android.pt.homepage.activity.MainActivity',
'unicodeKeyboard': True,
'resetKeyboard': True,
'noReset': True,
'newCommandTimeout': 6000,
'automationName': 'UiAutomator2'
}
# 连接Appium Server,初始化自动化环境
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
2.运行代码之前打开时间记录
3.日志的查看
The server is running
[2024-06-02 05:53:12][Appium] Welcome to Appium v1.22.3
[2024-06-02 05:53:12][Appium] Non-default server args:
[2024-06-02 05:53:12][Appium] logTimestamp: true
[2024-06-02 05:53:12][Appium] relaxedSecurityEnabled: true
[2024-06-02 05:53:12][Appium] allowInsecure: {
[2024-06-02 05:53:12][Appium] }
[2024-06-02 05:53:12][Appium] denyInsecure: {
[2024-06-02 05:53:12][Appium] }
[2024-06-02 05:53:12][Appium] Appium REST http interface listener started on 0.0.0.0:4723
[2024-06-02 05:53:18][HTTP] Request idempotency key: 1d9e1251-c0b4-4491-9d82-a3dce9e117f8
[2024-06-02 05:53:18][HTTP] --> POST /wd/hub/session
[2024-06-02 05:53:18][HTTP] {"capabilities":{"alwaysMatch":{"platformName":"Android","appium:platformVersion":"10","appium:deviceName":":VOG_AL10","appium:appPackage":"com.sankuai.meituan","appium:appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","appium:unicodeKeyboard":true,"appium:resetKeyboard":true,"appium:noReset":true,"appium:newCommandTimeout":6000,"appium:automationName":"UiAutomator2"},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"Android","platformVersion":"10","deviceName":":VOG_AL10","appPackage":"com.sankuai.meituan","appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard":true,"resetKeyboard":true,"noReset":true,"newCommandTimeout":6000,"automationName":"UiAutomator2"}}
[2024-06-02 05:53:18][W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"10","deviceName":":VOG_AL10","appPackage":"com.sankuai.meituan","appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard":true,"resetKeyboard":true,"noReset":true,"newCommandTimeout":6000,"automationName":"UiAutomator2"},null,{"alwaysMatch":{"platformName":"Android","appium:platformVersion":"10","appium:deviceName":":VOG_AL10","appium:appPackage":"com.sankuai.meituan","appium:appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","appium:unicodeKeyboard":true,"appium:resetKeyboard":true,"appium:noReset":true,"appium:newCommandTimeout":6000,"appium:automationName":"UiAutomator2"},"firstMatch":[{}]}]
[2024-06-02 05:53:18][BaseDriver] Event 'newSessionRequested' logged at 1717321998483 (17:53:18 GMT+0800 (中国标准时间))
[2024-06-02 05:53:18][Appium] Appium v1.22.3 creating new AndroidUiautomator2Driver (v1.70.1) session
[2024-06-02 05:53:18][Appium] Applying relaxed security to 'AndroidUiautomator2Driver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[2024-06-02 05:53:18][BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[2024-06-02 05:53:18][BaseDriver] Creating session with W3C capabilities: {
[2024-06-02 05:53:18][BaseDriver] "alwaysMatch": {
[2024-06-02 05:53:18][BaseDriver] "platformName": "Android",
[2024-06-02 05:53:18][BaseDriver] "appium:platformVersion": "10",
[2024-06-02 05:53:18][BaseDriver] "appium:deviceName": ":VOG_AL10",
[2024-06-02 05:53:18][BaseDriver] "appium:appPackage": "com.sankuai.meituan",
[2024-06-02 05:53:18][BaseDriver] "appium:appActivity": "com.meituan.android.pt.homepage.activity.MainActivity",
[2024-06-02 05:53:18][BaseDriver] "appium:unicodeKeyboard": true,
[2024-06-02 05:53:18][BaseDriver] "appium:resetKeyboard": true,
[2024-06-02 05:53:18][BaseDriver] "appium:noReset": true,
[2024-06-02 05:53:18][BaseDriver] "appium:newCommandTimeout": 6000,
[2024-06-02 05:53:18][BaseDriver] "appium:automationName": "UiAutomator2"
[2024-06-02 05:53:18][BaseDriver] },
[2024-06-02 05:53:18][BaseDriver] "firstMatch": [
[2024-06-02 05:53:18][BaseDriver] {}
[2024-06-02 05:53:18][BaseDriver] ]
[2024-06-02 05:53:18][BaseDriver] }
[2024-06-02 05:53:18][BaseDriver] Session created with session id: e2d696a2-5d0b-4f0d-865b-863543d0fb51
[2024-06-02 05:53:18][UiAutomator2] Starting 'com.sankuai.meituan' directly on the device
[2024-06-02 05:53:18][ADB] Found 2 'build-tools' folders under 'G:\Program Files\Java\sdk' (newest first):
[2024-06-02 05:53:18][ADB] G:/Program Files/Java/sdk/build-tools/29.0.3
[2024-06-02 05:53:18][ADB] G:/Program Files/Java/sdk/build-tools/29.0.2
[2024-06-02 05:53:18][ADB] Using 'adb.exe' from 'G:\Program Files\Java\sdk\platform-tools\adb.exe'
[2024-06-02 05:53:18][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 start-server'
[2024-06-02 05:53:18][AndroidDriver] Retrieving device list
[2024-06-02 05:53:18][ADB] Trying to find a connected android device
[2024-06-02 05:53:18][ADB] Getting connected devices
[2024-06-02 05:53:18][ADB] Connected devices: [{"udid":"Q5X7N19605002672","state":"device"}]
[2024-06-02 05:53:18][AndroidDriver] Looking for a device with Android '10.0.0'
[2024-06-02 05:53:18][ADB] Setting device id to Q5X7N19605002672
[2024-06-02 05:53:18][ADB] Getting device platform version
[2024-06-02 05:53:18][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell getprop ro.build.version.release'
[2024-06-02 05:53:18][ADB] Current device property 'ro.build.version.release': 10
[2024-06-02 05:53:18][AndroidDriver] Using device: Q5X7N19605002672
[2024-06-02 05:53:18][ADB] Using 'adb.exe' from 'G:\Program Files\Java\sdk\platform-tools\adb.exe'
[2024-06-02 05:53:18][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 start-server'
[2024-06-02 05:53:18][ADB] Setting device id to Q5X7N19605002672
[2024-06-02 05:53:18][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell getprop ro.build.version.sdk'
[2024-06-02 05:53:18][ADB] Current device property 'ro.build.version.sdk': 29
[2024-06-02 05:53:18][ADB] Getting device platform version
[2024-06-02 05:53:18][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell getprop ro.build.version.release'
[2024-06-02 05:53:18][ADB] Current device property 'ro.build.version.release': 10
[2024-06-02 05:53:18][ADB] Device API level: 29
[2024-06-02 05:53:18][UiAutomator2] Relaxing hidden api policy
[2024-06-02 05:53:18][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell 'settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1''
[2024-06-02 05:53:19][AndroidDriver] No app sent in, not parsing package/activity
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 wait-for-device'
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell echo ping'
[2024-06-02 05:53:19][AndroidDriver] Pushing settings apk to device...
[2024-06-02 05:53:19][ADB] Getting install status for io.appium.settings
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell dumpsys package io.appium.settings'
[2024-06-02 05:53:19][ADB] 'io.appium.settings' is installed
[2024-06-02 05:53:19][ADB] Getting package info for 'io.appium.settings'
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell dumpsys package io.appium.settings'
[2024-06-02 05:53:19][ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.4.0' >= '3.4.0')
[2024-06-02 05:53:19][ADB] There is no need to install/upgrade 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[2024-06-02 05:53:19][ADB] Getting IDs of all 'io.appium.settings' processes
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell 'pgrep --help; echo $?''
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell pgrep -f \(\[\[:blank:\]\]\|\^\)io\.appium\.settings\(\[\[:blank:\]\]\|\$\)'
[2024-06-02 05:53:19][AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell appops set io.appium.settings android:mock_location allow'
[2024-06-02 05:53:19][Logcat] Starting logs capture with command: 'G:\\Program Files\\Java\\sdk\\platform-tools\\adb.exe' -P 5037 -s Q5X7N19605002672 logcat -v threadtime
[2024-06-02 05:53:19][AndroidDriver] Enabling Unicode keyboard support
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell settings get secure default_input_method'
[2024-06-02 05:53:19][AndroidDriver] Unsetting previous IME io.appium.settings/.UnicodeIME
[2024-06-02 05:53:19][AndroidDriver] Setting IME to 'io.appium.settings/.UnicodeIME'
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell ime enable io.appium.settings/.UnicodeIME'
[2024-06-02 05:53:19][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell ime set io.appium.settings/.UnicodeIME'
[2024-06-02 05:53:20][UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8201
[2024-06-02 05:53:20][ADB] Forwarding system: 8201 to device: 6790
[2024-06-02 05:53:20][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 forward tcp:8201 tcp:6790'
[2024-06-02 05:53:20][UiAutomator2] Server package at 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is not writeable. Will copy it into the temporary location at 'C:\Users\dell\AppData\Local\Temp\202452-27964-axgrd9.ghnb' as a workaround. Consider making this file writeable manually in order to improve the performance of session startup.
[2024-06-02 05:53:20][UiAutomator2] Server package at 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk' is not writeable. Will copy it into the temporary location at 'C:\Users\dell\AppData\Local\Temp\202452-27964-axgrd9.ghnb' as a workaround. Consider making this file writeable manually in order to improve the performance of session startup.
[2024-06-02 05:53:20][ADB] Getting install status for io.appium.uiautomator2.server
[2024-06-02 05:53:20][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell dumpsys package io.appium.uiautomator2.server'
[2024-06-02 05:53:20][ADB] 'io.appium.uiautomator2.server' is installed
[2024-06-02 05:53:20][ADB] Getting package info for 'io.appium.uiautomator2.server'
[2024-06-02 05:53:20][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell dumpsys package io.appium.uiautomator2.server'
[2024-06-02 05:53:21][ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.27.0' >= '4.27.0')
[2024-06-02 05:53:21][UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[2024-06-02 05:53:21][ADB] Checking app cert for C:\Users\dell\AppData\Local\Temp\202452-27964-axgrd9.ghnb\appium-uiautomator2-server-v4.27.0.apk
[2024-06-02 05:53:21][ADB] Using 'apksigner.jar' from 'G:\Program Files\Java\sdk\build-tools\29.0.3\lib\apksigner.jar'
[2024-06-02 05:53:21][ADB] Starting apksigner: 'G:\\Program Files\\Java\\jdk-22\\bin\\java.exe' -Xmx1024M -Xss1m -jar 'G:\\Program Files\\Java\\sdk\\build-tools\\29.0.3\\lib\\apksigner.jar' verify --print-certs C:\\Users\\dell\\AppData\\Local\\Temp\\202452-27964-axgrd9.ghnb\\appium-uiautomator2-server-v4.27.0.apk
[2024-06-02 05:53:21][ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[2024-06-02 05:53:21][ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[2024-06-02 05:53:21][ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[2024-06-02 05:53:21][ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[2024-06-02 05:53:21][ADB]
[2024-06-02 05:53:21][ADB] sha256 hash did match for 'appium-uiautomator2-server-v4.27.0.apk'
[2024-06-02 05:53:21][ADB] 'C:\Users\dell\AppData\Local\Temp\202452-27964-axgrd9.ghnb\appium-uiautomator2-server-v4.27.0.apk' is signed with the default certificate
[2024-06-02 05:53:21][ADB] Getting install status for io.appium.uiautomator2.server.test
[2024-06-02 05:53:21][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell dumpsys package io.appium.uiautomator2.server.test'
[2024-06-02 05:53:21][ADB] 'io.appium.uiautomator2.server.test' is installed
[2024-06-02 05:53:21][ADB] Checking app cert for C:\Users\dell\AppData\Local\Temp\202452-27964-axgrd9.ghnb\appium-uiautomator2-server-debug-androidTest.apk
[2024-06-02 05:53:21][ADB] Starting apksigner: 'G:\\Program Files\\Java\\jdk-22\\bin\\java.exe' -Xmx1024M -Xss1m -jar 'G:\\Program Files\\Java\\sdk\\build-tools\\29.0.3\\lib\\apksigner.jar' verify --print-certs C:\\Users\\dell\\AppData\\Local\\Temp\\202452-27964-axgrd9.ghnb\\appium-uiautomator2-server-debug-androidTest.apk
[2024-06-02 05:53:22][ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[2024-06-02 05:53:22][ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[2024-06-02 05:53:22][ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[2024-06-02 05:53:22][ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[2024-06-02 05:53:22][ADB]
[2024-06-02 05:53:22][ADB] sha256 hash did match for 'appium-uiautomator2-server-debug-androidTest.apk'
[2024-06-02 05:53:22][ADB] 'C:\Users\dell\AppData\Local\Temp\202452-27964-axgrd9.ghnb\appium-uiautomator2-server-debug-androidTest.apk' is signed with the default certificate
[2024-06-02 05:53:22][UiAutomator2] Server packages are not going to be (re)installed
[2024-06-02 05:53:22][UiAutomator2] Waiting up to 30000ms for services to be available
[2024-06-02 05:53:22][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell pm list instrumentation'
[2024-06-02 05:53:22][UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available
[2024-06-02 05:53:22][ADB] Adding packages ["io.appium.settings","io.appium.uiautomator2.server","io.appium.uiautomator2.server.test"] to Doze whitelist
[2024-06-02 05:53:22][ADB] Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server.test",";"]]
[2024-06-02 05:53:22][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;'
[2024-06-02 05:53:22][UiAutomator2] No app capability. Assuming it is already on the device
[2024-06-02 05:53:22][UiAutomator2] Performing shallow cleanup of automation leftovers
[2024-06-02 05:53:22][UiAutomator2] The following obsolete sessions are still running: ["86600d71-a983-4a5e-a3da-4c27fd8ab244"]
[2024-06-02 05:53:22][UiAutomator2] Cleaning up 1 obsolete session
[2024-06-02 05:53:23][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell am force-stop io.appium.uiautomator2.server.test'
[2024-06-02 05:53:23][UiAutomator2] Starting UIAutomator2 server 4.27.0
[2024-06-02 05:53:23][UiAutomator2] Using UIAutomator2 server from 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk' and test from 'C:\Program Files\Appium Server GUI\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk'
[2024-06-02 05:53:23][UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online...
[2024-06-02 05:53:23][ADB] Creating ADB subprocess with args: ["-P",5037,"-s","Q5X7N19605002672","shell","am","instrument","-w","-e","disableAnalytics",true,"io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[2024-06-02 05:53:23][WD Proxy] Matched '/status' to command name 'getStatus'
[2024-06-02 05:53:23][WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[2024-06-02 05:53:23][WD Proxy] socket hang up
[2024-06-02 05:53:24][Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
[2024-06-02 05:53:24][WD Proxy] Matched '/status' to command name 'getStatus'
[2024-06-02 05:53:24][WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[2024-06-02 05:53:24][WD Proxy] socket hang up
[2024-06-02 05:53:25][WD Proxy] Matched '/status' to command name 'getStatus'
[2024-06-02 05:53:25][WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[2024-06-02 05:53:25][WD Proxy] socket hang up
[2024-06-02 05:53:26][WD Proxy] Matched '/status' to command name 'getStatus'
[2024-06-02 05:53:26][WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body
[2024-06-02 05:53:26][WD Proxy] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}}
[2024-06-02 05:53:26][UiAutomator2] The initialization of the instrumentation process took 3109ms
[2024-06-02 05:53:26][WD Proxy] Matched '/session' to command name 'createSession'
[2024-06-02 05:53:26][WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8201/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","platformVersion":"10","deviceName":":VOG_AL10","appPackage":"com.sankuai.meituan","appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard":true,"resetKeyboard":true,"noReset":true,"newCommandTimeout":6000,"automationName":"UiAutomator2"},"platformName":"Android","platformVersion":"10","deviceName":"Q5X7N19605002672","appPackage":"com.sankuai.meituan","appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard":true,"resetKeyboard":true,"noReset":true,"newCommandTimeout":6000,"automationName":"UiAutomator2","deviceUDID":"Q5X7N19605002672"}],"alwaysMatch":{}}}
[2024-06-02 05:53:26][WD Proxy] Got response with status 200: {"sessionId":"5818c854-ef81-4b4b-b669-4b752caddd7d","value":{"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"10","deviceName":":VOG_AL10","appPackage":"com.sankuai.meituan","appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard":true,"resetKeyboard":true,"noReset":true,"newCommandTimeout":6000,"automationName":"UiAutomator2"},"platformName":"Android","platformVersion":"10","deviceName":"Q5X7N19605002672","appPackage":"com.sankuai.meituan","appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard":true,"resetKeyboard":true,"noReset":true,"newCommandTimeout":6000,"automationName":"UiAutomator2","deviceUDID":"Q5X7N19605002672"}],"alwaysMatch":{}},"sessionId":"5818c854-ef81-4b4b-b669-4b752caddd7d"}}
[2024-06-02 05:53:26][WD Proxy] Determined the downstream protocol as 'W3C'
[2024-06-02 05:53:26][WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8201/wd/hub/session/5818c854-ef81-4b4b-b669-4b752caddd7d/appium/device/info] with no body
[2024-06-02 05:53:26][WD Proxy] Got response with status 200: {"sessionId":"5818c854-ef81-4b4b-b669-4b752caddd7d","value":{"androidId":"4247a7c9b8af9bea","apiVersion":"29","bluetooth":{"state":"OFF"},"brand":"HUAWEI","carrierName":"中国电信","displayDensity":480,"locale":"zh_CN_#Hans","manufacturer":"HUAWEI","model":"VOG-AL10","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":1048576,"linkUpstreamBandwidthKbps":1048576,"networkCapabilities":"NET_CAPABILITY_NOT_METERED,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_FOREGROUND,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED","signalStrength":-45,"transportTypes":"TRANSPORT_WIFI"},"detailedState":"CONNECTED","extraInfo":null,"isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":0,"subtypeName":"","type":1,"typeName":"WIFI"}],"platformVersion":"10","realDisplaySize":"1080x2340","timeZone":"Asia/Shanghai"}}
[2024-06-02 05:53:26][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell dumpsys window'
[2024-06-02 05:53:26][AndroidDriver] Screen already unlocked, doing nothing
[2024-06-02 05:53:26][UiAutomator2] Starting 'com.sankuai.meituan/com.meituan.android.pt.homepage.activity.MainActivity and waiting for 'com.sankuai.meituan/com.meituan.android.pt.homepage.activity.MainActivity'
[2024-06-02 05:53:26][ADB] Running 'G:\Program Files\Java\sdk\platform-tools\adb.exe -P 5037 -s Q5X7N19605002672 shell am start -W -n com.sankuai.meituan/com.meituan.android.pt.homepage.activity.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
[2024-06-02 05:53:28][WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8201/wd/hub/session/5818c854-ef81-4b4b-b669-4b752caddd7d/appium/device/pixel_ratio] with no body
[2024-06-02 05:53:28][WD Proxy] Got response with status 200: {"sessionId":"5818c854-ef81-4b4b-b669-4b752caddd7d","value":3}
[2024-06-02 05:53:28][WD Proxy] Matched '/appium/device/system_bars' to command name 'getSystemBars'
[2024-06-02 05:53:28][WD Proxy] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8201/wd/hub/session/5818c854-ef81-4b4b-b669-4b752caddd7d/appium/device/system_bars] with no body
[2024-06-02 05:53:28][WD Proxy] Got response with status 200: {"sessionId":"5818c854-ef81-4b4b-b669-4b752caddd7d","value":{"statusBar":104}}
[2024-06-02 05:53:28][WD Proxy] Matched '/window/current/size' to command name 'getWindowSize'
[2024-06-02 05:53:28][WD Proxy] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8201/wd/hub/session/5818c854-ef81-4b4b-b669-4b752caddd7d/window/current/size] with no body
[2024-06-02 05:53:28][WD Proxy] Got response with status 200: {"sessionId":"5818c854-ef81-4b4b-b669-4b752caddd7d","value":{"height":2118,"width":1080}}
[2024-06-02 05:53:28][Appium] New AndroidUiautomator2Driver session created successfully, session e2d696a2-5d0b-4f0d-865b-863543d0fb51 added to master session list
[2024-06-02 05:53:28][BaseDriver] Event 'newSessionStarted' logged at 1717322008966 (17:53:28 GMT+0800 (中国标准时间))
[2024-06-02 05:53:28][W3C (e2d696a2)] Cached the protocol value 'W3C' for the new session e2d696a2-5d0b-4f0d-865b-863543d0fb51
[2024-06-02 05:53:28][W3C (e2d696a2)] 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","platformVersion":"10","deviceName":":VOG_AL10","appPackage":"com.sankuai.meituan","appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard":true,"resetKeyboard":true,"noReset":true,"newCommandTimeout":6000,"automationName":"UiAutomator2"},"platformName":"Android","platformVersion":"10","deviceName":"Q5X7N19605002672","appPackage":"com.sankuai.meituan","appActivity":"com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard":true,"resetKeyboard":true,"noReset":true,"newCommandTimeout":6000,"automationName":"UiAutomator2","deviceUDID":"Q5X7N19605002672","deviceApiLevel":29,"deviceScreenSize":"1080x2340","deviceScreenDensity":480,"deviceModel":"VOG-AL10","deviceManufacturer":"HUAWEI","pixelRatio":3,"statBarHeight":104,"vie...
[2024-06-02 05:53:28][HTTP] <-- POST /wd/hub/session 200 10486 ms - 1142
[2024-06-02 05:53:28][HTTP]
成功的解决方法,我的情况
set java_exe=G:\Program Files\Java\jdk1.8.0_202\bin\java.exe
rem call lib\find_java.bat
5.ui automator viewer 的使用
未完。