# appium启动信息
[info] [Appium] Welcome to Appium v1.18.3
[info] [Appium] Non-default server args:
[info] [Appium] relaxedSecurityEnabled: true
[info] [Appium] allowInsecure: {
[info] [Appium] }
[info] [Appium] denyInsecure: {
[info] [Appium] }
[info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: f401e51d-bcec-4316-823b-0a2a98d62aac
[info] [HTTP] --> POST /wd/hub/session
[info] [HTTP] {"capabilities":{"firstMatch":[{"platformName":"Android","appium:platformVersion":"6.0.1","appium:deviceName":"emulator-5554","appium:appPackage":"com.xiaomi.shop","appium:appActivity":"com.xiaomi.shop2.activity.MainActivity"}]},"desiredCapabilities":{"platformName":"Android","platformVersion":"6.0.1","deviceName":"emulator-5554","appPackage":"com.xiaomi.shop","appActivity":"com.xiaomi.shop2.activity.MainActivity"}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"6.0.1","deviceName":"emulator-5554","appPackage":"com.xiaomi.shop","appActivity":"com.xiaomi.shop2.activity.MainActivity"},null,{"firstMatch":[{"platformName":"Android","appium:platformVersion":"6.0.1","appium:deviceName":"emulator-5554","appium:appPackage":"com.xiaomi.shop","appium:appActivity":"com.xiaomi.shop2.activity.MainActivity"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1605679299535 (14:01:39 GMT+0800 (中国标准时间))
# 未指定automationName警告
[warn] [Appium]
[warn] [Appium] ======================================================================
[warn] [Appium] DEPRECATION WARNING:
[warn] [Appium]
[warn] [Appium] The 'automationName' capability was not provided in the desired
[warn] [Appium] capabilities for this Android session
[warn] [Appium]
[warn] [Appium] Setting 'automationName=UiAutomator2' by default and using the
[warn] [Appium] UiAutomator2 Driver
[warn] [Appium]
[warn] [Appium] The next major version of Appium (2.x) will **require** the
[warn] [Appium] 'automationName' capability to be set for all sessions on all
[warn] [Appium] platforms
[warn] [Appium]
[warn] [Appium] In previous versions (Appium <= 1.13.x), the default was
[warn] [Appium] 'automationName=UiAutomator1'
[warn] [Appium]
[warn] [Appium] If you wish to use that automation instead of UiAutomator2, please
[warn] [Appium] add 'automationName=UiAutomator1' to your desired capabilities
[warn] [Appium]
[warn] [Appium] For more information about drivers, please visit
[warn] [Appium] http://appium.io/docs/en/about-appium/intro/ and explore the
[warn] [Appium] 'Drivers' menu
[warn] [Appium]
[warn] [Appium] ======================================================================
[warn] [Appium]
[info] [Appium] Appium v1.18.3 creating new AndroidUiautomator2Driver (v1.56.1) session
[info] [Appium] Applying relaxed security to 'AndroidUiautomator2Driver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver] "alwaysMatch": {
[debug] [BaseDriver] "platformName": "Android",
[debug] [BaseDriver] "appium:platformVersion": "6.0.1",
[debug] [BaseDriver] "appium:deviceName": "emulator-5554",
[debug] [BaseDriver] "appium:appPackage": "com.xiaomi.shop",
[debug] [BaseDriver] "appium:appActivity": "com.xiaomi.shop2.activity.MainActivity"
[debug] [BaseDriver] },
[debug] [BaseDriver] "firstMatch": [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[info] [BaseDriver] Session created with session id: a6c26b39-d69c-4e61-b194-b00deced0a5f
[info] [UiAutomator2] Starting 'com.xiaomi.shop' directly on the device
[info] [ADB] Found 1 'build-tools' folders under '/usr/local/android-sdk-macosx' (newest first):
[info] [ADB] /usr/local/android-sdk-macosx/build-tools/28.0.3
# 查找并启动adb服务 -----------
[info] [ADB] Using 'adb' from '/usr/local/android-sdk-macosx/platform-tools/adb'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 start-server'
# 查找并连接设备 -----------
[info] [AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices
[debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}]
[info] [AndroidDriver] Looking for a device with Android '6.0.1'
[debug] [ADB] Setting device id to emulator-5554
[info] [ADB] Getting device platform version
# 确认设备版本
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 6.0.1
[info] [AndroidDriver] Using device: emulator-5554
# 启动adb服务
[info] [ADB] Using 'adb' from '/usr/local/android-sdk-macosx/platform-tools/adb'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 start-server'
[debug] [ADB] Setting device id to emulator-5554
# 获取sdk版本
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 23
[debug] [ADB] Device API level: 23
[warn] [AndroidDriver] No app sent in, not parsing package/activity
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 wait-for-device'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell echo ping'
# 安装appium settings
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is installed
# 检查appium settings版本
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.2.0' >= '3.2.0')
[debug] [ADB] There is no need to install/upgrade '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f io\.appium\.settings'
# 授权appium settings
[info] [AndroidDriver] Granting permissions SET_ANIMATION_SCALE,CHANGE_CONFIGURATION,ACCESS_FINE_LOCATION to 'io.appium.settings'
[debug] [ADB] Granting permissions ["android.permission.SET_ANIMATION_SCALE","android.permission.CHANGE_CONFIGURATION","android.permission.ACCESS_FINE_LOCATION"] to 'io.appium.settings'
[debug] [ADB] 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] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 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] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f io\.appium\.settings'
# 启动appium settings
[debug] [ADB] Starting Appium Settings app
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am start -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f io\.appium\.settings'
# 启动logcat捕获日志
[debug] [Logcat] Starting logs capture with command: /usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 logcat -v threadtime
# 端口转发
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 forward tcp:8200 tcp:6790'
# 检查uiautomator2.server是否安装
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] 'io.appium.uiautomator2.server' is installed
[debug] [ADB] Getting package info for 'io.appium.uiautomator2.server'
# 检查uiautomator2.server版本
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] The installed 'io.appium.uiautomator2.server' package is older than '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.12.2.apk' (64 < 67 or '4.11.0' < '4.12.2')'
[debug] [UiAutomator2] io.appium.uiautomator2.server installation state: olderVersionInstalled
# 重新安装uiautomator2.server
# 检查uiautomator2.server签名
[debug] [ADB] Checking app cert for /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.12.2.apk
# 重新签名uiautomator2.server
[info] [ADB] Using 'apksigner.jar' from '/usr/local/android-sdk-macosx/build-tools/28.0.3/lib/apksigner.jar'
[debug] [ADB] Starting apksigner: /Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/bin/java -Xmx1024M -Xss1m -jar /usr/local/android-sdk-macosx/build-tools/28.0.3/lib/apksigner.jar verify --print-certs /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.12.2.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB]
[debug] [ADB] '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.12.2.apk' is signed with the default certificate
# 检查uiautomator2.server.test版本
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
[debug] [ADB] 'io.appium.uiautomator2.server.test' is installed
[debug] [ADB] Checking app cert for /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] Starting apksigner: /Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/bin/java -Xmx1024M -Xss1m -jar /usr/local/android-sdk-macosx/build-tools/28.0.3/lib/apksigner.jar verify --print-certs /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB]
[debug] [ADB] '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' is signed with the default certificate
# 卸载重新安装uiautomator2.server
[info] [UiAutomator2] Server packages are going to be (re)installed
[info] [UiAutomator2] Full packages reinstall is going to be performed
[debug] [ADB] Uninstalling io.appium.uiautomator2.server
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] 'io.appium.uiautomator2.server' is installed
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 uninstall io.appium.uiautomator2.server'
[debug] [ADB] 'adb uninstall io.appium.uiautomator2.server' command output: Success
[info] [ADB] io.appium.uiautomator2.server was successfully uninstalled
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 version'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 help'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 features'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo _ERROR_''
[debug] [ADB] The current Android API does not support extended ls options. Defaulting to no-options call
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell 'ls /data/local/tmp/appium_cache 2>&1 || echo _ERROR_''
[debug] [ADB] The count of applications in the cache: 3
[info] [ADB] Caching the application at '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.12.2.apk' to '/data/local/tmp/appium_cache/388973316d02e14f5a6498f4f0e3ce1ed4e965c0.apk'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell mkdir -p /data/local/tmp/appium_cache'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 push /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.12.2.apk /data/local/tmp/appium_cache/388973316d02e14f5a6498f4f0e3ce1ed4e965c0.apk'
[info] [ADB] The upload of 'appium-uiautomator2-server-v4.12.2.apk' (1.93 MB) took 185ms
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/388973316d02e14f5a6498f4f0e3ce1ed4e965c0.apk'
[info] [ADB] The installation of 'appium-uiautomator2-server-v4.12.2.apk' took 488ms
[debug] [ADB] Install command stdout: pkg: /data/local/tmp/appium_cache/388973316d02e14f5a6498f4f0e3ce1ed4e965c0.apk
[debug] [ADB] Success
# 卸载重新安装uiautomator2.server.test
[debug] [ADB] Uninstalling io.appium.uiautomator2.server.test
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
[debug] [ADB] 'io.appium.uiautomator2.server.test' is installed
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 uninstall io.appium.uiautomator2.server.test'
[debug] [ADB] 'adb uninstall io.appium.uiautomator2.server.test' command output: Success
[info] [ADB] io.appium.uiautomator2.server.test was successfully uninstalled
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell 'ls /data/local/tmp/appium_cache 2>&1 || echo _ERROR_''
[debug] [ADB] The count of applications in the cache: 4
[info] [ADB] Caching the application at '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' to '/data/local/tmp/appium_cache/68dbd0ff0bb1b8cbe42b09fa241b1152f818c672.apk'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell mkdir -p /data/local/tmp/appium_cache'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 push /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk /data/local/tmp/appium_cache/68dbd0ff0bb1b8cbe42b09fa241b1152f818c672.apk'
[info] [ADB] The upload of 'appium-uiautomator2-server-debug-androidTest.apk' (755.10 KB) took 134ms
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/68dbd0ff0bb1b8cbe42b09fa241b1152f818c672.apk'
[info] [ADB] The installation of 'appium-uiautomator2-server-debug-androidTest.apk' took 342ms
[debug] [ADB] Install command stdout: pkg: /data/local/tmp/appium_cache/68dbd0ff0bb1b8cbe42b09fa241b1152f818c672.apk
[debug] [ADB] Success
# 启动AndroidJUnitRunner
[debug] [UiAutomator2] Waiting up to 30000ms for services to be available
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm list instrumentation'
[debug] [UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available
# 检查小米商城应用是否安装
[debug] [UiAutomator2] No app capability. Assuming it is already on the device
[debug] [ADB] Getting install status for com.xiaomi.shop
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package com.xiaomi.shop'
[debug] [ADB] 'com.xiaomi.shop' is installed
# 强制停止小米商城应用
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.xiaomi.shop'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm clear com.xiaomi.shop'
# 重置应用数据
[debug] [AndroidDriver] Performed fast reset on the installed 'com.xiaomi.shop' application (stop and clear)
[debug] [UiAutomator2] Performing shallow cleanup of automation leftovers
[debug] [UiAutomator2] No obsolete sessions have been detected (socket hang up)
# 启动uiautomator2服务
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test'
[info] [UiAutomator2] Starting UIAutomator2 server 4.12.2
[info] [UiAutomator2] Using UIAutomator2 server from '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.12.2.apk' and test from '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk'
[info] [UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online...
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","emulator-5554","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[debug] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
# 获取状态
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[info] [WD Proxy] socket hang up[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"33e9509f-462f-47aa-a651-699c7944c097","value":{"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"6.0.1","deviceName":"emulator-5554","appPackage":"com.xiaomi.shop","appActivity":"com.xiaomi.shop2.activity.MainActivity"},"platformName":"Android","platformVersion":"6.0.1","deviceName":"emulator-5554","appPackage":"com.xiaomi.shop","appActivity":"com.xiaomi.shop2.activity.MainActivity","deviceUDID":"emulator-5554"}],"alwaysMatch":{}},"sessionId":"33e9509f-462f-47aa-a651-699c7944c097"}}
# 获取设备信息
[info] [WD Proxy] Determined the downstream protocol as 'W3C'
[debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8200/wd/hub/session/33e9509f-462f-47aa-a651-699c7944c097/appium/device/info] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"33e9509f-462f-47aa-a651-699c7944c097","value":{"androidId":"85f16a6fe33973a1","apiVersion":"23","bluetooth":{"state":"OFF"},"brand":"Android","carrierName":"","displayDensity":416,"locale":"zh_CN","manufacturer":"Netease","model":"MuMu","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":1048576,"linkUpstreamBandwidthKbps":1048576,"networkCapabilities":"NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_INTERNET,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_VALIDATED","signalStrength":-55,"transportTypes":"TRANSPORT_WIFI"},"detailedState":"CONNECTED","extraInfo":""aWhHkpRxZ"","isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":0,"subtypeName":"","type":1,"typeName":"WIFI"}],"platformVersion":"6.0.1","realDisplaySize":"1170x1872","timeZone":"Asia/Shanghai"}}
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window'
[info] [AndroidDriver] Screen already unlocked, doing nothing
# 启动app
[info] [UiAutomator2] Starting 'com.xiaomi.shop/com.xiaomi.shop2.activity.MainActivity and waiting for 'com.xiaomi.shop/com.xiaomi.shop2.activity.MainActivity'
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am start -W -n com.xiaomi.shop/com.xiaomi.shop2.activity.MainActivity -S'
[debug] [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8200/wd/hub/session/33e9509f-462f-47aa-a651-699c7944c097/appium/device/pixel_ratio] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"33e9509f-462f-47aa-a651-699c7944c097","value":2.6000001}
[debug] [WD Proxy] Matched '/appium/device/system_bars' to command name 'getSystemBars'
[debug] [WD Proxy] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8200/wd/hub/session/33e9509f-462f-47aa-a651-699c7944c097/appium/device/system_bars] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"33e9509f-462f-47aa-a651-699c7944c097","value":{"statusBar":62}}
# 获取窗口尺寸
[debug] [WD Proxy] Matched '/window/current/size' to command name 'getWindowSize'
[debug] [WD Proxy] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8200/wd/hub/session/33e9509f-462f-47aa-a651-699c7944c097/window/current/size] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"33e9509f-462f-47aa-a651-699c7944c097","value":{"height":1872,"width":1170}}
# 创建会话
[info] [Appium] New AndroidUiautomator2Driver session created successfully, session a6c26b39-d69c-4e61-b194-b00deced0a5f added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1605679310308 (14:01:50 GMT+0800 (中国标准时间))
[debug] [W3C (a6c26b39)] Cached the protocol value 'W3C' for the new session a6c26b39-d69c-4e61-b194-b00deced0a5f
[debug] [W3C (a6c26b39)] 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":"6.0.1","deviceName":"emulator-5554","appPackage":"com.xiaomi.shop","appActivity":"com.xiaomi.shop2.activity.MainActivity"},"platformName":"Android","platformVersion":"6.0.1","deviceName":"emulator-5554","appPackage":"com.xiaomi.shop","appActivity":"com.xiaomi.shop2.activity.MainActivity","deviceUDID":"emulator-5554","deviceApiLevel":23,"deviceScreenSize":"1170x1872","deviceScreenDensity":416,"deviceModel":"MuMu","deviceManufacturer":"Netease","pixelRatio":2.6000001,"statBarHeight":62,"viewportRect":{"left":0,"top":62,"width":1170,"height":1810}}}
[info] [HTTP] <-- POST /wd/hub/session 200 10778 ms - 879
# 关闭会话
[info] [HTTP] [warn] [BaseDriver] Shutting down because we waited 60 seconds for a command
[warn] [Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'
[info] [Appium] Removing session 'a6c26b39-d69c-4e61-b194-b00deced0a5f' from our master session list
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched '/' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8200/wd/hub/session/33e9509f-462f-47aa-a651-699c7944c097] with no body
[info] [WD Proxy] socket hang up
[warn] [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.xiaomi.shop'
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
# 移除端口监听
[debug] [ADB] Running '/usr/local/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp:8200'