ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

appium server日志分析

2021-02-15 13:01:43  阅读:159  来源: 互联网

标签:appium settings server ADB android 日志 sdk


The server is running
[Appium] Welcome to Appium v1.15.1

appium版本号

[Appium] Non-default server args:
[Appium]   allowInsecure: {
[Appium]   }
[Appium]   denyInsecure: {
[Appium]   }
[Appium] Appium REST http interface listener started on 0.0.0.0:4723

开通了本地4723端口监听客户端发来的请求,如果server在别的服务器上,这里就是对应的server地址

[HTTP] --> POST /wd/hub/session

HTTP向appiumserver发起post请求,携带capabilities

[HTTP] {"capabilities":{"firstMatch":[{"platformName":"Android","appium:platformVersion":"6.0","appium:deviceName":"127.0.0.1:7555","appium:appPackage":"com.android.settings","appium:appActivity":"com.android.settings.Settings"}]},"desiredCapabilities":{"platformName":"Android","platformVersion":"6.0","deviceName":"127.0.0.1:7555","appPackage":"com.android.settings","appActivity":"com.android.settings.Settings"}}

为了创建session对象

[W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"6.0","deviceName":"127.0.0.1:7555","appPackage":"com.android.settings","appActivity":"com.android.settings.Settings"},null,{"firstMatch":[{"platformName":"Android","appium:platformVersion":"6.0","appium:deviceName":"127.0.0.1:7555","appium:appPackage":"com.android.settings","appium:appActivity":"com.android.settings.Settings"}]}]
[BaseDriver] Event 'newSessionRequested' logged at 1613358360840 (11:06:00 GMT+0800 (中国标准时间))
[Appium] 
[Appium] ======================================================================
[Appium]   DEPRECATION WARNING:
[Appium] 
[Appium]   The 'automationName' capability was not provided in the desired 
[Appium]   capabilities for this Android session
[Appium] 
[Appium]   Setting 'automationName=UiAutomator2' by default and using the 
[Appium]   UiAutomator2 Driver
[Appium] 
[Appium]   The next major version of Appium (2.x) will **require** the 
[Appium]   'automationName' capability to be set for all sessions on all 
[Appium]   platforms
[Appium] 
[Appium]   In previous versions (Appium <= 1.13.x), the default was 
[Appium]   'automationName=UiAutomator1'
[Appium] 
[Appium]   If you wish to use that automation instead of UiAutomator2, please 
[Appium]   add 'automationName=UiAutomator1' to your desired capabilities
[Appium] 
[Appium]   For more information about drivers, please visit 
[Appium]   http://appium.io/docs/en/about-appium/intro/ and explore the 
[Appium]   'Drivers' menu
[Appium] 
[Appium] ======================================================================
[Appium] 

Appium v1.15.1 创建了 new AndroidUiautomator2Driver session,带了以下这些参数

[Appium] Appium v1.15.1 creating new AndroidUiautomator2Driver (v1.37.2) session
[BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver]   "alwaysMatch": {
[BaseDriver]     "platformName": "Android",
[BaseDriver]     "appium:platformVersion": "6.0",
[BaseDriver]     "appium:deviceName": "127.0.0.1:7555",
[BaseDriver]     "appium:appPackage": "com.android.settings",
[BaseDriver]     "appium:appActivity": "com.android.settings.Settings"
[BaseDriver]   },
[BaseDriver]   "firstMatch": [
[BaseDriver]     {}
[BaseDriver]   ]
[BaseDriver] }
[BaseDriver] Session created with session id: 2310235d-6518-4803-b9fd-9b2bbb44f4a8

返回了session id,后面发送请求都会带session id

[UiAutomator2] Starting 'com.android.settings' directly on the device
[ADB] Found 1 'build-tools' folders under 'D:\soft\android-sdk-windows' (newest first):

build-tools配置的环境变量

[ADB]     D:/soft/android-sdk-windows/build-tools/30.0.0-preview
[ADB] Using 'adb.exe' from 'D:\soft\android-sdk-windows\platform-tools\adb.exe'

adb配置的环境变量

[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices...
[ADB] Connected devices: [{"udid":"127.0.0.1:7555","state":"device"}]
[AndroidDriver] Looking for a device with Android '6.0'
[ADB] Setting device id to 127.0.0.1:7555
[ADB] Getting device platform version
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell getprop ro.build.version.release'
[ADB] Current device property 'ro.build.version.release': 6.0.1
[ADB] Setting device id to 127.0.0.1:7555
[AndroidDriver] Using device: 127.0.0.1:7555
[ADB] Using 'adb.exe' from 'D:\soft\android-sdk-windows\platform-tools\adb.exe'
[ADB] Setting device id to 127.0.0.1:7555

找到手机端设备的版本

[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell getprop ro.build.version.sdk'

找到设备,通过adb -s指定设备,发送了adb shell getprop ro.build.version.sdk

[ADB] Current device property 'ro.build.version.sdk': 23
[ADB] Device API level: 23

返回了版本号,使用cmd,查看是一样的结果
在这里插入图片描述

[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 wait-for-device'
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell echo ping'

能不能ping通

[AndroidDriver] Pushing settings apk to device...
[ADB] Getting install status for io.appium.settings

io.appium.settings是给手机端设置一些基本设置

[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell dumpsys package io.appium.settings'
[ADB] 'io.appium.settings' is installed
[ADB] Getting package info for 'io.appium.settings'
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell dumpsys package io.appium.settings'
[ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["D:\\soft\\android-sdk-windows\\platform-tools\\apkanalyzer.bat","D:\\soft\\android-sdk-windows\\emulator\\apkanalyzer.bat","D:\\soft\\android-sdk-windows\\tools\\apkanalyzer.bat","D:\\soft\\android-sdk-windows\\tools\\bin\\apkanalyzer.bat","D:\\soft\\android-sdk-windows\\build-tools\\30.0.0-preview\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'D:\soft\android-sdk-windows'?
[ADB] Using 'aapt.exe' from 'D:\soft\android-sdk-windows\build-tools\30.0.0-preview\aapt.exe'
[ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('2.14.2' >= '2.14.2')
[ADB] 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'
[ADB] Getting IDs of all 'io.appium.settings' processes
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell 'pgrep --help; echo $?''
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell pgrep -f io\\.appium\\.settings'

将.SET_ANIMATION_SCALE, CHANGE_CONFIGURATION, ACCESS_FINE_LOCATION 授权给io.appium.settings,执行系统的操作

[AndroidDriver] Granting android.permission.SET_ANIMATION_SCALE, CHANGE_CONFIGURATION, ACCESS_FINE_LOCATION by pm grant
[ADB] Granting permissions ["android.permission.SET_ANIMATION_SCALE","android.permission.CHANGE_CONFIGURATION","android.permission.ACCESS_FINE_LOCATION"] to 'io.appium.settings'
[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",";"]]
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 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 \;'
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell am start -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER'
[ADB] Getting IDs of all 'io.appium.settings' processes
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell pgrep -f io\\.appium\\.settings'
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell appops set io.appium.settings android\:mock_location allow'
[Logcat] Starting logcat capture

安装 io.appium.uiautomator2.server

[ADB] Getting install status for io.appium.uiautomator2.server
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell dumpsys package io.appium.uiautomator2.server'
[ADB] 'io.appium.uiautomator2.server' is installed
[ADB] Getting package info for 'io.appium.uiautomator2.server'
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell dumpsys package io.appium.uiautomator2.server'
[ADB] Cannot extract apk info using apkanalyzer. Falling back to aapt. Original error: Could not find 'apkanalyzer.bat' in ["D:\\soft\\android-sdk-windows\\platform-tools\\apkanalyzer.bat","D:\\soft\\android-sdk-windows\\emulator\\apkanalyzer.bat","D:\\soft\\android-sdk-windows\\tools\\apkanalyzer.bat","D:\\soft\\android-sdk-windows\\tools\\bin\\apkanalyzer.bat","D:\\soft\\android-sdk-windows\\build-tools\\30.0.0-preview\\apkanalyzer.bat"]. Do you have Android Build Tools installed at 'D:\soft\android-sdk-windows'?
[ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.3.0' >= '4.3.0')
[UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[ADB] Checking app cert for 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
[ADB] Using 'apksigner.bat' from 'D:\soft\android-sdk-windows\build-tools\30.0.0-preview\apksigner.bat'
[ADB] Starting 'D:\soft\android-sdk-windows\build-tools\30.0.0-preview\apksigner.bat' with args '["verify","--print-certs","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"]'
[ADB] Got an error during apksigner execution: Command 'apksigner.bat verify --print-certs 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' exited with code 1
[ADB] apksigner stderr: java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ADB] 	at java.lang.ClassLoader.defineClass1(Native Method)
[ADB] 	at java.lang.ClassLoader.defineClass(Unknown Source)
[ADB] 	at java.security.SecureClassLoader.defineClass(Unknown Source)
[ADB] 	at java.net.URLClassLoader.defineClass(Unknown Source)
[ADB] 	at java.net.URLClassLoader.access$100(Unknown Source)
[ADB] 	at java.net.URLClassLoader$1.run(Unknown Source)
[ADB] 	at java.net.URLClassLoader$1.run(Unknown Source)
[ADB] 	at java.security.AccessController.doPrivileged(Native Method)
[ADB] 	at java.net.URLClassLoader.findClass(Unknown Source)
[ADB] 	at java.lang.ClassLoader.loadClass(Unknown Source)
[ADB] 	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[ADB] 	at java.lang.ClassLoader.loadClass(Unknown Source)
[ADB] 	at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
[ADB] Error: A JNI error has occurred, please check your installation and try again
[ADB] Exception in thread "main" 
[ADB] Cannot use apksigner tool for signature verification. Original error: Command 'apksigner.bat verify --print-certs 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' exited with code 1
[ADB] Defaulting to verify.jar
[ADB] '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' is already signed.
[ADB] Getting install status for io.appium.uiautomator2.server.test
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell dumpsys package io.appium.uiautomator2.server.test'
[ADB] 'io.appium.uiautomator2.server.test' is installed
[ADB] Checking app cert for C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
[ADB] Starting 'D:\soft\android-sdk-windows\build-tools\30.0.0-preview\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk"]'
[ADB] Got an error during apksigner execution: Command 'apksigner.bat verify --print-certs C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk' exited with code 1
[ADB] apksigner stderr: java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ADB] 	at java.lang.ClassLoader.defineClass1(Native Method)
[ADB] 	at java.lang.ClassLoader.defineClass(Unknown Source)
[ADB] 	at java.security.SecureClassLoader.defineClass(Unknown Source)
[ADB] 	at java.net.URLClassLoader.defineClass(Unknown Source)
[ADB] 	at java.net.URLClassLoader.access$100(Unknown Source)
[ADB] 	at java.net.URLClassLoader$1.run(Unknown Source)
[ADB] 	at java.net.URLClassLoader$1.run(Unknown Source)
[ADB] 	at java.security.AccessController.doPrivileged(Native Method)
[ADB] 	at java.net.URLClassLoader.findClass(Unknown Source)
[ADB] 	at java.lang.ClassLoader.loadClass(Unknown Source)
[ADB] 	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[ADB] 	at java.lang.ClassLoader.loadClass(Unknown Source)
[ADB] 	at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
[ADB] Error: A JNI error has occurred, please check your installation and try again
[ADB] Exception in thread "main" 
[ADB] Cannot use apksigner tool for signature verification. Original error: Command 'apksigner.bat verify --print-certs C:\\Users\\Administrator\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk' exited with code 1
[ADB] Defaulting to verify.jar
[ADB] 'C:\Users\Administrator\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is already signed.
[UiAutomator2] Server packages are not going to be (re)installed
[UiAutomator2] Waiting up to 30000ms for services to be available
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell pm list instrumentation'
[UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available
[UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
[ADB] Forwarding system: 8200 to device: 6790
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 forward tcp\:8200 tcp\:6790'

将pc端的8200端口映射到手机端的6790端口,可以进行进程通信,下面进行UIAutomator2 server初始化设置

[UiAutomator2] No app capability. Assuming it is already on the device
[ADB] Getting install status for com.android.settings
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell dumpsys package com.android.settings'
[ADB] 'com.android.settings' is installed
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell am force-stop com.android.settings'
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell pm clear com.android.settings'
[AndroidDriver] Performed fast reset on the installed 'com.android.settings' 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:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell am force-stop io.appium.uiautomator2.server.test'

启动 UIAutomator2 server

[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","127.0.0.1:7555","shell","am","instrument","-w","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]

通过adb shell am instrument完成启动

[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"}
[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 response with status 200: {"sessionId":"None","value":{"ready":true,"message":"UiAutomator2 Server is ready to accept commands"}}

UiAutomator2 Server已经准备好

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

UiAutomator2 Server初始化完成,用时3.099s,以下是创建session

[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","platformVersion":"6.0","deviceName":"127.0.0.1:7555","appPackage":"com.android.settings","appActivity":"com.android.settings.Settings"},"platformName":"Android","platformVersion":"6.0","deviceName":"127.0.0.1:7555","appPackage":"com.android.settings","appActivity":"com.android.settings.Settings","deviceUDID":"127.0.0.1:7555"}],"alwaysMatch":{}}}

发送post请求,带着capabilities设置代理到http://localhost:8200这个端口,请求session

[WD Proxy] Got response with status 200: {"sessionId":"44e61b8a-8ad1-4c4c-a36a-468658f98987","value":{"sessionId":"44e61b8a-8ad1-4c4c-a36a-468658f98987","capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"6.0","deviceName":"127.0.0.1:7555","appPackage":"com.android.settings","appActivity":"com.android.settings.Settings"},"platformName":"Android","platformVersion":"6.0","deviceName":"127.0.0.1:7555","appPackage":"com.android.settings","appActivity":"com.android.settings.Settings","deviceUDID":"127.0.0.1:7555"}],"alwaysMatch":{}}}}

返回了200,带着sessionId

[WD Proxy] Determined the downstream protocol as 'W3C'
[WD Proxy] Proxying [GET /appium/device/info] to [GET http://localhost:8200/wd/hub/session/44e61b8a-8ad1-4c4c-a36a-468658f98987/appium/device/info] with no body
[WD Proxy] Got response with status 200: {"sessionId":"44e61b8a-8ad1-4c4c-a36a-468658f98987","value":{"androidId":"db1dd5d30ad7e7d0","manufacturer":"Netease","model":"MuMu","brand":"Android","apiVersion":"23","platformVersion":"6.0.1","carrierName":"","realDisplaySize":"1080x1920","displayDensity":360,"networks":[{"type":1,"typeName":"WIFI","subtype":0,"subtypeName":"","isConnected":true,"detailedState":"CONNECTED","state":"CONNECTED","extraInfo":"\"5W3CQx\"","isAvailable":true,"isFailover":false,"isRoaming":false,"capabilities":{"transportTypes":"NET_CAPABILITY_SUPL","networkCapabilities":"","linkUpstreamBandwidthKbps":1048576,"linkDownBandwidthKbps":1048576,"signalStrength":-55,"networkSpecifier":null,"SSID":null}}],"locale":"zh_CN","timeZone":"Asia\/Shanghai"}}
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing

打开指定包的指定页

[UiAutomator2] Starting 'com.android.settings/com.android.settings.Settings and waiting for 'com.android.settings/com.android.settings.Settings'
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell am start -W -n com.android.settings/com.android.settings.Settings -S'
[WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://localhost:8200/wd/hub/session/44e61b8a-8ad1-4c4c-a36a-468658f98987/appium/device/pixel_ratio] with body: {}
[WD Proxy] Got response with status 200: {"sessionId":"44e61b8a-8ad1-4c4c-a36a-468658f98987","value":2.25}
[WD Proxy] Matched '/appium/device/system_bars' to command name 'getSystemBars'
[WD Proxy] Proxying [GET /appium/device/system_bars] to [GET http://localhost:8200/wd/hub/session/44e61b8a-8ad1-4c4c-a36a-468658f98987/appium/device/system_bars] with body: {}
[WD Proxy] Got response with status 200: {"sessionId":"44e61b8a-8ad1-4c4c-a36a-468658f98987","value":{"statusBar":54}}
[WD Proxy] Matched '/window/current/size' to command name 'getWindowSize'
[WD Proxy] Proxying [GET /window/current/size] to [GET http://localhost:8200/wd/hub/session/44e61b8a-8ad1-4c4c-a36a-468658f98987/window/current/size] with body: {}
[WD Proxy] Got response with status 200: {"sessionId":"44e61b8a-8ad1-4c4c-a36a-468658f98987","value":{"height":1920,"width":1080}}
[Appium] New AndroidUiautomator2Driver session created successfully, session 2310235d-6518-4803-b9fd-9b2bbb44f4a8 added to master session list
[BaseDriver] Event 'newSessionStarted' logged at 1613358385423 (11:06:25 GMT+0800 (中国标准时间))
[W3C (2310235d)] Cached the protocol value 'W3C' for the new session 2310235d-6518-4803-b9fd-9b2bbb44f4a8
[W3C (2310235d)] 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","deviceName":"127.0.0.1:7555","appPackage":"com.android.settings","appActivity":"com.android.settings.Settings"},"platformName":"Android","platformVersion":"6.0.1","deviceName":"127.0.0.1:7555","appPackage":"com.android.settings","appActivity":"com.android.settings.Settings","deviceUDID":"127.0.0.1:7555","deviceApiLevel":23,"deviceScreenSize":"1080x1920","deviceScreenDensity":360,"deviceModel":"MuMu","deviceManufacturer":"Netease","pixelRatio":2.25,"statBarHeight":54,"viewportRect":{"left":0,"top":54,"width":1080,"height":1866}}}
[HTTP] <-- POST /wd/hub/session 200 24588 ms - 867

到现在脚本中dirver=webdriver.Remote(‘http://localhost:4723/wd/hub’,desired_caps)完成了,花费了24588 ms
带着sessionId通信

[HTTP] 
[HTTP] --> DELETE /wd/hub/session/2310235d-6518-4803-b9fd-9b2bbb44f4a8
[HTTP] {}
[W3C (2310235d)] Calling AppiumDriver.deleteSession() with args: ["2310235d-6518-4803-b9fd-9b2bbb44f4a8"]
[BaseDriver] Event 'quitSessionRequested' logged at 1613358385505 (11:06:25 GMT+0800 (中国标准时间))
[Appium] Removing session 2310235d-6518-4803-b9fd-9b2bbb44f4a8 from our master session list
[UiAutomator2] Deleting UiAutomator2 session
[UiAutomator2] Deleting UiAutomator2 server session
[WD Proxy] Matched '/' to command name 'deleteSession'
[WD Proxy] Proxying [DELETE /] to [DELETE http://localhost:8200/wd/hub/session/44e61b8a-8ad1-4c4c-a36a-468658f98987] with no body
[WD Proxy] Got response with status 200: {"sessionId":"44e61b8a-8ad1-4c4c-a36a-468658f98987","value":null}
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 shell am force-stop com.android.settings'
[Instrumentation] .
[Instrumentation] Time: 6.42

[Instrumentation] 

[Instrumentation] OK (1 test)
[Instrumentation] The process has exited with code 0
[Logcat] Stopping logcat capture
[ADB] Removing forwarded port socket connection: 8200 
[ADB] Running 'D:\soft\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 127.0.0.1\:7555 forward --remove tcp\:8200'
[BaseDriver] Event 'quitSessionFinished' logged at 1613358386918 (11:06:26 GMT+0800 (中国标准时间))
[W3C (2310235d)] Received response: null
[W3C (2310235d)] But deleting session, so not returning
[W3C (2310235d)] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/2310235d-6518-4803-b9fd-9b2bbb44f4a8 200 1415 ms - 14
[HTTP] 

标签:appium,settings,server,ADB,android,日志,sdk
来源: https://blog.csdn.net/weixin_46583017/article/details/113814571

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有