appium-inspector
appium-inspector copied to clipboard
bug: Appium inspector not loading image in android with "appium:mjpegServerPort" from remote host ip
Is this an issue specifically with Appium Inspector?
- [x] I have verified that my issue does not occur with Appium, and should be investigated as an Appium Inspector issue
Is there an existing issue for this?
- [x] I have searched the existing issues
Current Behavior
when user uses capability - appium:mjpegServerPort, appium inspector is not loading image. Issue only happens when device is connected to remote machine in same network and server is not localhost
Working when server is localhost or 127.0.0.1, but not working with ip-address from same network
*only happening in android
Expected Behavior
appium should load image in appium inspector though user uses appium:mjpegServerPort. if mjpegServer is not working or video url not working it should fall back to default screenshot
Operating System
Mac
Appium Inspector Version
App Version: 2024.6.1 Electron: 13.6.9 Node.js: 14.16.0
Appium Version
2.17.1
Further Information
No response
Could you provide your full Appium server log?
*only happening in android
Do you mean that it works fine when using the XCUITest driver?
Could you provide your full Appium server log?
*only happening in android
Do you mean that it works fine when using the XCUITest driver?
`Last login: Sat Apr 5 13:06:34 on ttys015 robotactions@RA1 ~ % appium --allow-cors --relaxed-security --allow-insecure chromedriver_autodownload [Appium] Welcome to Appium v2.17.1 [Appium] Non-default server args: [Appium] { allowCors: true, allowInsecure: [ 'chromedriver_autodownload' ], relaxedSecurityEnabled: true } [Appium] The autodetected Appium home path: /Users/robotactions/.appium [Appium] Attempting to load driver uiautomator2... [Appium] Attempting to load driver xcuitest... [Appium] Attempting to load driver espresso... [Appium] Requiring driver at /Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/build/index.js [Appium] Requiring driver at /Users/robotactions/.appium/node_modules/appium-xcuitest-driver/build/index.js [Appium] Requiring driver at /Users/robotactions/.appium/node_modules/appium-espresso-driver/build/index.js [Appium] AndroidUiautomator2Driver has been successfully loaded in 0.180s [Appium] XCUITestDriver has been successfully loaded in 0.366s [Appium] EspressoDriver has been successfully loaded in 0.537s [Appium] You have enabled CORS requests from any host. Be careful not to visit sites which could maliciously try to start Appium sessions on your machine [Appium] Appium REST http interface listener started on http://0.0.0.0:4723 [Appium] You can provide the following URLs in your client code to connect to this server: http://127.0.0.1:4723/ (only accessible from the same host) http://192.168.0.87:4723/ http://169.254.45.79:4723/ http://169.254.104.121:4723/ [Appium] Available drivers: [Appium] - [email protected] (automationName 'UiAutomator2') [Appium] - [email protected] (automationName 'XCUITest') [Appium] - [email protected] (automationName 'Espresso') [Appium] Available plugins: [Appium] - [email protected] [Appium] - [email protected] [Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate [HTTP] --> POST /session {"capabilities":{"alwaysMatch":{"platformName":"Android","appium:automationName":"UiAutomator2","appium:appActivity":"com.android.settings.Settings","appium:appPackage":"com.android.settings","appium:mjpegServerPort":9100,"appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"Android","appium:automationName":"UiAutomator2","appium:appActivity":"com.android.settings.Settings","appium:appPackage":"com.android.settings","appium:mjpegServerPort":9100,"appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true}} [AppiumDriver@3d5e] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","appium:automationName":"UiAutomator2","appium:appActivity":"com.android.settings.Settings","appium:appPackage":"com.android.settings","appium:mjpegServerPort":9100,"appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},null,{"alwaysMatch":{"platformName":"Android","appium:automationName":"UiAutomator2","appium:appActivity":"com.android.settings.Settings","appium:appPackage":"com.android.settings","appium:mjpegServerPort":9100,"appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]}] [AppiumDriver@3d5e] Event 'newSessionRequested' logged at 1743888094935 (17:21:34 GMT-0400 (Eastern Daylight Saving Time)) [Appium] Attempting to find matching driver for automationName 'UiAutomator2' and platformName 'Android' [Appium] The 'uiautomator2' driver was installed and matched caps. [Appium] Will require it at /Users/robotactions/.appium/node_modules/appium-uiautomator2-driver [Appium] Requiring driver at /Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/build/index.js [AppiumDriver@3d5e] Appium v2.17.1 creating new AndroidUiautomator2Driver (v4.1.5) session [AppiumDriver@3d5e] Checking BaseDriver versions for Appium and AndroidUiautomator2Driver [AppiumDriver@3d5e] Appium's BaseDriver version is 9.16.4 [AppiumDriver@3d5e] AndroidUiautomator2Driver's BaseDriver version is 9.16.4 [AppiumDriver@3d5e] Applying relaxed security to 'AndroidUiautomator2Driver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [AppiumDriver@3d5e] Explicitly enabling use of insecure features: [AppiumDriver@3d5e] chromedriver_autodownload [AndroidUiautomator2Driver@0d20] [AndroidUiautomator2Driver@0d20] Creating session with W3C capabilities: { "alwaysMatch": { "platformName": "Android", "appium:automationName": "UiAutomator2", "appium:appActivity": "com.android.settings.Settings", "appium:appPackage": "com.android.settings", "appium:mjpegServerPort": 9100, "appium:ensureWebviewsHavePages": true, "appium:nativeWebScreenshot": true, "appium:newCommandTimeout": 3600, "appium:connectHardwareKeyboard": true }, "firstMatch": [ {} ] } [AndroidUiautomator2Driver@0d20] The following provided capabilities were not recognized by this driver: [AndroidUiautomator2Driver@0d20] connectHardwareKeyboard [026da137][AndroidUiautomator2Driver@0d20] Session created with session id: 026da137-eaa5-40ef-a945-1441f2f3ed43 [026da137][ADB] Found 1 'build-tools' folders under '/Users/robotactions/Library/Android/sdk' (newest first): [026da137][ADB] /Users/robotactions/Library/Android/sdk/build-tools/36.0.0 [026da137][ADB] Using 'adb' from '/Users/robotactions/Library/Android/sdk/platform-tools/adb' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 start-server' [026da137][AndroidUiautomator2Driver@0d20] Retrieving device list [026da137][ADB] Trying to find connected Android devices [026da137][ADB] Getting connected devices [026da137][ADB] Connected devices: [{"udid":"9B201FFBA002P5","state":"device"},{"udid":"R5CT121PWXE","state":"device"}] [026da137][AndroidUiautomator2Driver@0d20] Using device: 9B201FFBA002P5 [026da137][ADB] Using 'adb' from '/Users/robotactions/Library/Android/sdk/platform-tools/adb' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 start-server' [026da137][ADB] Setting device id to 9B201FFBA002P5 [026da137][AndroidUiautomator2Driver@0d20] Starting 'com.android.settings' directly on the device [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell getprop ro.build.version.sdk' [026da137][ADB] Current device property 'ro.build.version.sdk': 33 [026da137][ADB] Getting device platform version [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell getprop ro.build.version.release' [026da137][ADB] Current device property 'ro.build.version.release': 13 [026da137][ADB] Device API level: 33 [026da137][AndroidUiautomator2Driver@0d20] Relaxing hidden api policy [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 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'' [026da137][AndroidUiautomator2Driver@0d20] Pushing settings apk to the device... [026da137][ADB] Getting package info for 'io.appium.settings' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell dumpsys package io.appium.settings' [026da137][ADB] Using 'aapt2' from '/Users/robotactions/Library/Android/sdk/build-tools/36.0.0/aapt2' [026da137][ADB] Reading package manifest: '/Users/robotactions/Library/Android/sdk/build-tools/36.0.0/aapt2 dump badging /Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/node_modules/io.appium.settings/apks/settings_apk-debug.apk' [026da137][ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('5.14.4' >= '5.14.4') [026da137][ADB] There is no need to install/upgrade '/Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/node_modules/io.appium.settings/apks/settings_apk-debug.apk' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell dumpsys activity services io.appium.settings' [026da137][AndroidUiautomator2Driver@0d20] io.appium.settings is already running. There is no need to reset its permissions. [026da137][Logcat] Starting logs capture with command: /Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 logcat -v threadtime [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell appops set io.appium.settings android:mock_location allow' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell "[ -e '/data/local/tmp/mock_apps.json' ] && echo PASS"' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell cat /data/local/tmp/mock_apps.json' [026da137][AndroidUiautomator2Driver@0d20] MJPEG broadcasting requested, forwarding MJPEG server port 7810 to local port 9100 [026da137][ADB] Forwarding system: 9100 to device: 7810 [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 forward tcp:9100 tcp:7810' [026da137][AndroidUiautomator2Driver@0d20] Forwarding UiAutomator2 Server port 6790 to local port 8204 [026da137][ADB] Forwarding system: 8204 to device: 6790 [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 forward tcp:8204 tcp:6790' [026da137][AndroidUiautomator2Driver@0d20] UIA2Proxy options: {"server":"127.0.0.1","port":8204,"keepAlive":true,"scheme":"http","base":"","reqBasePath":"","sessionId":null,"timeout":240000} [026da137][ADB] Getting package info for 'io.appium.uiautomator2.server' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell dumpsys package io.appium.uiautomator2.server' [026da137][ADB] Getting install status for io.appium.uiautomator2.server.test [026da137][AndroidUiautomator2Driver@0d20] No app capability. Assuming it is already on the device [026da137][ADB] Getting install status for com.android.settings [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell cmd package list packages' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell cmd package list packages' [026da137][ADB] Reading package manifest: '/Users/robotactions/Library/Android/sdk/build-tools/36.0.0/aapt2 dump badging /Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v7.3.0.apk' [026da137][ADB] 'com.android.settings' is installed [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell am force-stop com.android.settings' [026da137][ADB] 'io.appium.uiautomator2.server.test' is installed [026da137][ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('7.3.0' >= '7.3.0') [026da137][AndroidUiautomator2Driver@0d20] Server packages status: [{"installState":"sameVersionInstalled","appPath":"/Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v7.3.0.apk","appId":"io.appium.uiautomator2.server"},{"installState":"sameVersionInstalled","appPath":"/Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk","appId":"io.appium.uiautomator2.server.test"}] [026da137][AndroidUiautomator2Driver@0d20] Server packages are not going to be (re)installed [026da137][AndroidUiautomator2Driver@0d20] Waiting up to 30000ms for services to be available [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell pm list instrumentation' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell pm clear com.android.settings' [026da137][AndroidUiautomator2Driver@0d20] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available [026da137][ADB] Adding packages ["io.appium.settings","io.appium.uiautomator2.server","io.appium.uiautomator2.server.test"] to Doze whitelist [026da137][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",";"]] [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;' [026da137][AndroidUiautomator2Driver@0d20] Performed fast reset on the installed 'com.android.settings' application (stop and clear) [026da137][AndroidUiautomator2Driver@0d20] Performing shallow cleanup of automation leftovers [026da137][AndroidUiautomator2Driver@0d20] No obsolete sessions have been detected (socket hang up) [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell am force-stop io.appium.uiautomator2.server' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell am force-stop io.appium.uiautomator2.server.test' [026da137][AndroidUiautomator2Driver@0d20] Starting UIAutomator2 server 7.3.0 [026da137][AndroidUiautomator2Driver@0d20] Using UIAutomator2 server from '/Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v7.3.0.apk' and test from '/Users/robotactions/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' [026da137][AndroidUiautomator2Driver@0d20] Waiting up to 30000ms for UiAutomator2 to be online... [026da137][ADB] Creating ADB subprocess with args: ["-P","5037","-s","9B201FFBA002P5","shell","am","instrument","-w","-e","disableAnalytics","true","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"] [026da137][AndroidUiautomator2Driver@0d20] Matched '/status' to command name 'getStatus' [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /status] to [GET http://127.0.0.1:8204/status] with no body [026da137][AndroidUiautomator2Driver@0d20] socket hang up [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] [026da137][AndroidUiautomator2Driver@0d20] Matched '/status' to command name 'getStatus' [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /status] to [GET http://127.0.0.1:8204/status] with no body [026da137][AndroidUiautomator2Driver@0d20] socket hang up [026da137][AndroidUiautomator2Driver@0d20] Matched '/status' to command name 'getStatus' [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /status] to [GET http://127.0.0.1:8204/status] with no body [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}} [026da137][AndroidUiautomator2Driver@0d20] The initialization of the instrumentation process took 2084ms [026da137][AndroidUiautomator2Driver@0d20] Matched '/session' to command name 'createSession' [026da137][AndroidUiautomator2Driver@0d20] Proxying [POST /session] to [POST http://127.0.0.1:8204/session] with body: {"capabilities":{"firstMatch":[{"platformName":"Android","automationName":"UiAutomator2","appActivity":"com.android.settings.Settings","appPackage":"com.android.settings","mjpegServerPort":9100,"ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true,"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","automationName":"UiAutomator2","appActivity":"com.android.settings.Settings","appPackage":"com.android.settings","mjpegServerPort":9100,"ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true},"deviceName":"9B201FFBA002P5","deviceUDID":"9B201FFBA002P5"}],"alwaysMatch":{}}} [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab","value":{"capabilities":{"firstMatch":[{"platformName":"Android","automationName":"UiAutomator2","appActivity":"com.android.settings.Settings","appPackage":"com.android.settings","mjpegServerPort":9100,"ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true,"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","automationName":"UiAutomator2","appActivity":"com.android.settings.Settings","appPackage":"com.android.settings","mjpegServerPort":9100,"ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true},"deviceName":"9B201FFBA002P5","deviceUDID":"9B201FFBA002P5"}],"alwaysMatch":{}},"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab"}} [026da137][AndroidUiautomator2Driver@0d20] Determined the downstream protocol as 'W3C' [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8204/session/b3f44e7f-262b-4753-be8a-bbc66ec645ab/appium/device/pixel_ratio] with no body [026da137][AndroidUiautomator2Driver@0d20] Matched '/appium/device/system_bars' to command name 'getSystemBars' [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8204/session/b3f44e7f-262b-4753-be8a-bbc66ec645ab/appium/device/system_bars] with no body [026da137][AndroidUiautomator2Driver@0d20] Matched '/window/current/size' to command name 'getWindowSize' [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8204/session/b3f44e7f-262b-4753-be8a-bbc66ec645ab/window/current/size] with no body [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8204/session/b3f44e7f-262b-4753-be8a-bbc66ec645ab/appium/device/info] with no body [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell dumpsys window' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell dumpsys power' [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab","value":3.5} [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab","value":{"height":3040,"width":1440}} [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab","value":{"statusBar":98}} [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab","value":{"androidId":"ff34aabb96a2d1bb","apiVersion":"33","bluetooth":{"state":"ON"},"brand":"google","carrierName":"","displayDensity":560,"locale":"en_US","manufacturer":"Google","model":"Pixel 4 XL","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":75960,"linkUpstreamBandwidthKbps":16115,"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":-74,"transportTypes":"TRANSPORT_WIFI"},"detailedState":"CONNECTED","extraInfo":"","isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":-1,"subtypeName":"","type":1,"typeName":"WIFI"}],"platformVersion":"13","realDisplaySize":"1440x3040","timeZone":"America/Toronto"}} [026da137][AndroidUiautomator2Driver@0d20] Screen already unlocked, doing nothing [026da137][AndroidUiautomator2Driver@0d20] Starting 'com.android.settings/com.android.settings.Settings' and waiting for 'com.android.settings/com.android.settings.Settings' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell am start-activity -W -n com.android.settings/com.android.settings.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' [026da137][AppiumDriver@3d5e] New AndroidUiautomator2Driver session created successfully, session 026da137-eaa5-40ef-a945-1441f2f3ed43 added to master session list [026da137][AppiumDriver@3d5e] Event 'newSessionStarted' logged at 1743888098230 (17:21:38 GMT-0400 (Eastern Daylight Saving Time)) [026da137][AndroidUiautomator2Driver@0d20] Cached the protocol value 'W3C' for the new session 026da137-eaa5-40ef-a945-1441f2f3ed43 [026da137][AndroidUiautomator2Driver@0d20] Responding to client with driver.createSession() result: {"capabilities":{"platformName":"Android","automationName":"UiAutomator2","appActivity":"com.android.settings.Settings","appPackage":"com.android.settings","mjpegServerPort":9100,"ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true,"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","automationName":"UiAutomator2","appActivity":"com.android.settings.Settings","appPackage":"com.android.settings","mjpegServerPort":9100,"ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true},"deviceName":"9B201FFBA002P5","deviceUDID":"9B201FFBA002P5","pixelRatio":"3.5","statBarHeight":98,"viewportRect":{"left":0,"top":98,"width":1440,"height":2942},"deviceApiLevel":33,"platformVersion":"13","deviceManufacturer":"Google","deviceModel"... [026da137][HTTP] <-- POST /session 200 3299 ms - 1154 [026da137][HTTP] --> GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/window/rect {} [026da137][AndroidUiautomator2Driver@0d20] Calling AppiumDriver.getWindowRect() with args: ["026da137-eaa5-40ef-a945-1441f2f3ed43"] [026da137][AndroidUiautomator2Driver@0d20] Matched '/window/current/size' to command name 'getWindowSize' [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8204/session/b3f44e7f-262b-4753-be8a-bbc66ec645ab/window/current/size] with no body [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab","value":{"height":3040,"width":1440}} [026da137][AndroidUiautomator2Driver@0d20] Responding to client with driver.getWindowRect() result: {"width":1440,"height":3040,"x":0,"y":0} [026da137][HTTP] <-- GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/window/rect 200 14 ms - 50 [026da137][HTTP] --> GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/source {} [026da137][AndroidUiautomator2Driver@0d20] Driver proxy active, passing request on via HTTP proxy [026da137][AndroidUiautomator2Driver@0d20] Matched '/session/026da137-eaa5-40ef-a945-1441f2f3ed43/source' to command name 'getPageSource' [026da137][AndroidUiautomator2Driver@0d20] Proxying [GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/source] to [GET http://127.0.0.1:8204/session/b3f44e7f-262b-4753-be8a-bbc66ec645ab/source] with no body [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab","value":"\r\n<hierarchy index="0" class="hierarchy" rotation="0" width="1440" height="2956">\r\n <android.widget.FrameLayout index="0" package="com.android.settings" class="android.widget.FrameLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1440,3040]" displayed="true" a11y-important="true" screen-reader-focusable="false" drawing-order="0" showing-hint="false" text-entry-key="false" dismissable="false" a11y-focused="false" heading="false" live-region="0" context-clickable="false" content-invalid="false">\r\n <android.widget.LinearLayout index="0" package="com.android.settings" class="android.widget.LinearLayout" text="" checkable="false" checked="false" clickable="... [026da137][AndroidUiautomator2Driver@0d20] Replacing sessionId b3f44e7f-262b-4753-be8a-bbc66ec645ab with 026da137-eaa5-40ef-a945-1441f2f3ed43 [026da137][HTTP] <-- GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/source 200 555 ms - 44688 [026da137][HTTP] --> GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/timeouts {} [026da137][AndroidUiautomator2Driver@0d20] Calling AppiumDriver.getTimeouts() with args: ["026da137-eaa5-40ef-a945-1441f2f3ed43"] [026da137][AndroidUiautomator2Driver@0d20] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0} [026da137][HTTP] <-- GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/timeouts 200 3 ms - 42 [HTTP] --> GET /dashboard/api/sessions {} [HTTP] No route found for /dashboard/api/sessions [HTTP] <-- GET /dashboard/api/sessions 404 9 ms - 211 [026da137][HTTP] --> GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/timeouts {} [026da137][AndroidUiautomator2Driver@0d20] Calling AppiumDriver.getTimeouts() with args: ["026da137-eaa5-40ef-a945-1441f2f3ed43"] [026da137][AndroidUiautomator2Driver@0d20] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0} [026da137][HTTP] <-- GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/timeouts 304 3 ms - - [026da137][HTTP] --> GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/timeouts {} [026da137][AndroidUiautomator2Driver@0d20] Calling AppiumDriver.getTimeouts() with args: ["026da137-eaa5-40ef-a945-1441f2f3ed43"] [026da137][AndroidUiautomator2Driver@0d20] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0} [026da137][HTTP] <-- GET /session/026da137-eaa5-40ef-a945-1441f2f3ed43/timeouts 304 3 ms - - [026da137][HTTP] --> DELETE /session/026da137-eaa5-40ef-a945-1441f2f3ed43 {} [026da137][AndroidUiautomator2Driver@0d20] Calling AppiumDriver.deleteSession() with args: ["026da137-eaa5-40ef-a945-1441f2f3ed43"] [026da137][AppiumDriver@3d5e] Event 'quitSessionRequested' logged at 1743888171310 (17:22:51 GMT-0400 (Eastern Daylight Saving Time)) [026da137][AppiumDriver@3d5e] Removing session 026da137-eaa5-40ef-a945-1441f2f3ed43 from our master session list [026da137][AndroidUiautomator2Driver@0d20] Deleting UiAutomator2 session [026da137][AndroidUiautomator2Driver@0d20] Deleting UiAutomator2 server session [026da137][AndroidUiautomator2Driver@0d20] Proxying [DELETE /] to [DELETE http://127.0.0.1:8204/session/b3f44e7f-262b-4753-be8a-bbc66ec645ab] with no body [026da137][AndroidUiautomator2Driver@0d20] Got response with status 200: {"sessionId":"b3f44e7f-262b-4753-be8a-bbc66ec645ab","value":null} [026da137][ADB] Getting IDs of all 'io.appium.uiautomator2.server' processes [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell 'pgrep --help; echo $?'' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell pgrep -f ([[:blank:]]|^)io.appium.uiautomator2.server(:[a-zA-Z0-9_-]+)?([[:blank:]]|$)' [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:. [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] Time: 75.285 [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] OK (1 test) [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] [026da137][AndroidUiautomator2Driver@0d20] [Instrumentation] The process has exited with code 0, signal null [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell am force-stop io.appium.uiautomator2.server' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell am force-stop io.appium.uiautomator2.server.test' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell dumpsys activity services io.appium.settings/.recorder.RecorderService' [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell am force-stop com.android.settings' [026da137][ADB] Removing forwarded port socket connection: 8204 [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 forward --remove tcp:8204' [026da137][ADB] Removing forwarded port socket connection: 9100 [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 forward --remove tcp:9100' [026da137][AndroidUiautomator2Driver@0d20] Restoring hidden api policy to the device default configuration [026da137][ADB] Running '/Users/robotactions/Library/Android/sdk/platform-tools/adb -P 5037 -s 9B201FFBA002P5 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy'' [026da137][Logcat] Stopping logcat capture [026da137][AppiumDriver@3d5e] Event 'quitSessionFinished' logged at 1743888171612 (17:22:51 GMT-0400 (Eastern Daylight Saving Time)) [026da137][AppiumDriver@3d5e] Received response: null [026da137][AppiumDriver@3d5e] But deleting session, so not returning [026da137][AppiumDriver@3d5e] Responding to client with driver.deleteSession() result: null [026da137][HTTP] <-- DELETE /session/026da137-eaa5-40ef-a945-1441f2f3ed43 200 303 ms - 14 [HTTP] --> GET /sessions {} [AppiumDriver@3d5e] Command 'getSessions' has been deprecated and will be removed in a future version of Appium or your driver/plugin. Please use a different method or contact the driver/plugin author to add explicit support for the command before it is removed [AppiumDriver@3d5e] Calling AppiumDriver.getSessions() with args: [] [AppiumDriver@3d5e] Responding to client with driver.getSessions() result: [] [HTTP] <-- GET /sessions 304 5 ms - -
`
Could you provide your full Appium server log?
*only happening in android
Do you mean that it works fine when using the XCUITest driver?
Yes works fine when using XCUITest driver.
when i execute additional command, it is working fine:
ncat -lk 0.0.0.0 9100 --sh-exec "ncat 127.0.0.1 9100"
I can reproduce this issue with just one machine. When starting the Appium server, for me it listed two URLs that could be used to connect to it (127.0.0.1 and 192.168.8.252), so I tried a few options:
127.0.0.1(default placeholder) - stream loads ✔localhost- stream loads ✔192.168.88.252- stream does not load ❌
@mykola-mokhnach could it be that UiA2 does not allow accessing the MJPEG stream using the machine's LAN IP?
I tried to change the assembled MJPEG URL to the default 127.0.0.1 and that fixed it, but naturally this won't work across different machines.
The behaviour is expected. By default adb forwards device ports to localhost only. This is also important from the security perspective.
In this case, is it possible to add a fall back to default screenshot in appium inspector instead of continuous loader
@mykola-mokhnach perhaps there is a capability/server flag that would enable forwarding to the LAN IP as well?
@mykola-mokhnach perhaps there is a capability/server flag that would enable forwarding to the LAN IP as well?
There is no such flag out of the box. It could be added as a feature though. The idea would be to duplex the stream currently sent to localhost only, similar to what @krishpavuluri mentioned before. Although, in order to make the solution cross-platform, it shouldn't use command line tools and rely on a pure node.js implementation
How is it done for apis? Apis are working from using host ip, may be implementation to proxy forward is already available and not applied to mjpeg port
fall back to screenshot should be added, similar to ios when mjpeg fails