appium/appium-inspector

Appium inspector not creating a session on emulator.

Sankeert123 opened this issue · 6 comments

Screenshot 2023-11-20 191939 I am Trying to launch with Appium inspector with desired capabilities, it is not launching and giving error to me. I have tried with multiple versions still getting same error. Please do help me on this. now Am using 2022.8.1 version of Appium inspector.

Error
Failed to create session. An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk' exited with code 1'; Command output: adb: failed to stat C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk: No such file or directory

@jlipps Please do help me on this.

Below mentioned server logs.

C:\Windows\System32>appium
[Appium] Welcome to Appium v2.0.1
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at C:\Windows\System32\node_modules\appium-uiautomator2-driver
[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:
[Appium] http://192.168.1.100:4723/
[Appium] http://127.0.0.1:4723/ (only accessible from the same host)
[Appium] Available drivers:
[Appium] - uiautomator2@2.7.0 (automationName 'UiAutomator2')
[Appium] Available plugins:
[Appium] - element-wait@2.0.3
[Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate
[HTTP] --> POST /session
[HTTP] {"capabilities":{"alwaysMatch":{"appium:deviceName":"emulator-5554","appium:platformName":"Android","appium:automationName":"UiAutomator2","appium:app":"C:\Users\sankeert_eloelo\eclipse-workspace\EloeloAutomation\src\test\java\resources\Latest.apk","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]},"desiredCapabilities":{"appium:deviceName":"emulator-5554","appium:platformName":"Android","appium:automationName":"UiAutomator2","appium:app":"C:\Users\sankeert_eloelo\eclipse-workspace\EloeloAutomation\src\test\java\resources\Latest.apk","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true}}
[debug] [AppiumDriver@7224] Calling AppiumDriver.createSession() with args: [{"appium:deviceName":"emulator-5554","appium:platformName":"Android","appium:automationName":"UiAutomator2","appium:app":"C:\Users\sankeert_eloelo\eclipse-workspace\EloeloAutomation\src\test\java\resources\Latest.apk","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},null,{"alwaysMatch":{"appium:deviceName":"emulator-5554","appium:platformName":"Android","appium:automationName":"UiAutomator2","appium:app":"C:\Users\sankeert_eloelo\eclipse-workspace\EloeloAutomation\src\test\java\resources\Latest.apk","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]}]
[debug] [AppiumDriver@7224] Event 'newSessionRequested' logged at 1700488151873 (19:19:11 GMT+0530 (India Standard Time))
[BaseDriver] The capabilities ["platformName"] are standard capabilities and do not require "appium:" prefix
[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 C:\Windows\System32\node_modules\appium-uiautomator2-driver
[debug] [Appium] Requiring driver at C:\Windows\System32\node_modules\appium-uiautomator2-driver
[AppiumDriver@7224] Appium v2.0.1 creating new AndroidUiautomator2Driver (v2.7.0) session
[AppiumDriver@7224] Checking BaseDriver versions for Appium and AndroidUiautomator2Driver
[AppiumDriver@7224] Appium's BaseDriver version is 9.3.20
[AppiumDriver@7224] AndroidUiautomator2Driver's BaseDriver version is 9.3.20
[debug] [AndroidUiautomator2Driver@4f82] Creating session with W3C capabilities: {
[debug] [AndroidUiautomator2Driver@4f82] "alwaysMatch": {
[debug] [AndroidUiautomator2Driver@4f82] "appium:deviceName": "emulator-5554",
[debug] [AndroidUiautomator2Driver@4f82] "platformName": "Android",
[debug] [AndroidUiautomator2Driver@4f82] "appium:automationName": "UiAutomator2",
[debug] [AndroidUiautomator2Driver@4f82] "appium:app": "C:\Users\sankeert_eloelo\eclipse-workspace\EloeloAutomation\src\test\java\resources\Latest.apk",
[debug] [AndroidUiautomator2Driver@4f82] "appium:newCommandTimeout": 3600,
[debug] [AndroidUiautomator2Driver@4f82] "appium:connectHardwareKeyboard": true
[debug] [AndroidUiautomator2Driver@4f82] },
[debug] [AndroidUiautomator2Driver@4f82] "firstMatch": [
[debug] [AndroidUiautomator2Driver@4f82] {}
[debug] [AndroidUiautomator2Driver@4f82] ]
[debug] [AndroidUiautomator2Driver@4f82] }
[AndroidUiautomator2Driver@4f82] The following capabilities were provided, but are not recognized by Appium:
[AndroidUiautomator2Driver@4f82] deviceName
[AndroidUiautomator2Driver@4f82] connectHardwareKeyboard
[AndroidUiautomator2Driver@4f82 (fb9e4e60)] Session created with session id: fb9e4e60-c27a-4e68-b7ac-9b2bf908b618
[BaseDriver] Using local app 'C:\Users\sankeert_eloelo\eclipse-workspace\EloeloAutomation\src\test\java\resources\Latest.apk'
[debug] [AndroidUiautomator2Driver@4f82 (fb9e4e60)] Checking whether app is actually present
[ADB] Found 3 'build-tools' folders under 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk' (newest first):
[ADB] C:/Users/sankeert_eloelo/AppData/Local/Android/Sdk/build-tools/34.0.0
[ADB] C:/Users/sankeert_eloelo/AppData/Local/Android/Sdk/build-tools/33.0.1
[ADB] C:/Users/sankeert_eloelo/AppData/Local/Android/Sdk/build-tools/30.0.3
[ADB] Using 'adb.exe' from 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[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"}]
[AndroidDriver] Using device: emulator-5554
[ADB] Using 'adb.exe' from 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[debug] [ADB] Setting device id to emulator-5554
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 30
[ADB] Getting device platform version
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 11
[debug] [ADB] Device API level: 30
[AndroidUiautomator2Driver@4f82 (fb9e4e60)] Relaxing hidden api policy
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 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''
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Package name: 'com.eloelo'
[ADB] Main activity name: 'com.eloelo.splash.view.SplashActivityNew'
[debug] [AndroidDriver] Parsed package and activity are: com.eloelo/com.eloelo.splash.view.SplashActivityNew
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device'
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is not installed
[debug] [ADB] App 'C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk' is not installed
[debug] [ADB] Installing 'C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 help'
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 features'
[ADB] The application at 'C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk' will not be cached, because the device under test has confirmed the support of streamed installs
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is not installed
[debug] [ADB] App 'C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk' is not installed
[debug] [ADB] Installing 'C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[ADB] The application at 'C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk' will not be cached, because the device under test has confirmed the support of streamed installs
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[debug] [AndroidUiautomator2Driver@4f82 (fb9e4e60)] Deleting UiAutomator2 session
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys activity services io.appium.settings/.recorder.RecorderService'
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.eloelo'
[AndroidUiautomator2Driver@4f82 (fb9e4e60)] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''
[debug] [AppiumDriver@7224] Event 'newSessionStarted' logged at 1700488154353 (19:19:14 GMT+0530 (India Standard Time))
[debug] [AppiumDriver@7224] Encountered internal error running command: Error executing adbExec. Original error: 'Command 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk' exited with code 1'; Command output: adb: failed to stat C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk: No such file or directory
[debug] [AppiumDriver@7224]
[debug] [AppiumDriver@7224] Error: Command 'C:\Users\sankeert_eloelo\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk' exited with code 1
[debug] [AppiumDriver@7224] at ChildProcess. (C:\Windows\System32\node_modules\appium-uiautomator2-driver\node_modules\teen_process\lib\exec.js:129:19)
[debug] [AppiumDriver@7224] at ChildProcess.emit (node:events:517:28)
[debug] [AppiumDriver@7224] at maybeClose (node:internal/child_process:1098:16)
[debug] [AppiumDriver@7224] at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5)
[HTTP] <-- POST /session 500 2513 ms - 1676
[HTTP]

Closing as duplicate of appium/appium#17516
I would suggest to first update your Appium and appium-uiautomator2-driver versions (and maybe Appium Inspector as well), then trying again.

Closing as duplicate of appium/appium#17516 I would suggest to first update your Appium and appium-uiautomator2-driver versions (and maybe Appium Inspector as well), then trying again.

I have Updated Appium server 2.2.2, UiAutomator2 to v 2.34.1 and Appium Inspector v 2023.11.1 But no luck. Still getting same error. @eglitise @hugs @notjosh
Uploading Screenshot 2023-11-21 195155.png…

I dont use inspector. I run .net test
my output when i start appium

 C:\Users\user>appium
[Appium] Welcome to Appium v2.0.1
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at C:\Users\user\.appium\node_modules\appium-uiautomator2-driver
[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:
[Appium]        http://192.168.0.103:4723/
[Appium]        http://127.0.0.1:4723/ (only accessible from the same host)
[Appium]        http://172.23.240.1:4723/
[Appium]        http://172.18.96.1:4723/
[Appium] Available drivers:
[Appium]   - uiautomator2@2.29.5 (automationName 'UiAutomator2')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.

Are you able to see emulator?

Maybe missing enviroment variables. Whats in that direcory which is not found

@Sankeert123 please try the solutions in the linked issue. This is not a problem with the Inspector, so please leave further comments under that issue.