“adb devices” detect my device but not Appium server, why? - appium

Environment:
Windows 10
Python 3.7.9
Appium 1.22.3
Node v12.15.0
Android Debug Bridge version 1.0.41
Version 33.0.2-8557947
Sdkmanager 4.0.1
Appium-Python-Client==2.4.0
Problem:
Appium doesn't detect my device:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Device E531XE1ZM11302266 was not in the list of connected devices
at getResponseForW3CError (C:\Users\gauth\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\gauth\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
So I run the command "adb devices" which shows correctly my device.
Is there any process to fix this kind of issue please? How could I fix that?

Related

Futter Driver Automation Testing not working due upgrade in version of Flutter Driver

Can some one help where our app is not showing in Appium inspector and even not working for Automation code in intellij after upgrade to Flutter driver version 3.0
getting error: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Cannot read property 'match' of undefined
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
To fix this, Upgrade to appium-flutter-driver v1.7.0 with Appium 2 (2.0.0-beta.43 is the latest when I'm posting this)
Start Appium server using the command appium -p 4726 --base-path /wd/hub as sometimes starting server with default port was not working fine!
If you are not on Appium 2 already, check this guide for migration, I found it helpful
https://www.headspin.io/blog/migrating-to-appium-2-0-part-1-capability-prefixes
https://www.headspin.io/blog/installing-appium-2-0-and-the-driver-and-plugins-cli

How to fix Failure “INSTALL PARSE FAILED NO CERTIFICATES” for Appium & Python?

I am making an automation script to automate a Real SMartphone Android 8.1:
Environment
Python 3.7
Windows 10 64Bits
Build-tools 29.0.3
java version "1.8.0_241"
Appium 1.17.1
Node v12.15.0
sdkmanager 4.0.1
ADB (Android Debug Bridge) version 1.0.41
Version 30.0.3-6597393
When I run my script, I get these error message:
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
--> We can't open Instagram. Please check if device is connected. Let's try again!
Message: An unknown server-side error occurred while processing the command. Original error: Performing Push Install
C:\Users\Nino\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk: 1 file pushed, 0 skipped. 87.8 MB/s (470052 bytes in 0.005s)
Appium log file:
https://github.com/gauthierbuttez/public/blob/master/appium_issue04082020.log
What I've tried:
I added this desired capability:
desired_caps['remoteAppsCacheLimit'] = 0
It didn't help.
I reset factory my Android device but it didn't help.
Does anyone already faced this issue?
Try to add noSign: true to capabilities. It might help.
I also suggest manually removing Appium Settings and Instagram apps before starting a new session.

Android Studio Emulator Error Using AVD

I've been running Studio 3.0.1 for a few weeks. My project was working fine with the emulator and AVD. The next day, the first time I re-tried the emulator I got:
Emulator: emulator: ERROR: can't find the emulator executable
Emulator: Process finished with exit code -1
I have deleted and rebuilt a couple of different AVD devices, I checked that HAXM is running and my environment/system PATH variables are:
c:\Users\***\AppData\Local\Android\sdk\emulator
c:\Users\***\AppData\Local\Android\sdk\platform-tools
c:\Users\***\AppData\Local\Android\sdk\tools
I then connected a Galaxy S7 running Nougat and the emulator runs fine!
Further investigation shows that when I run the emulator from the terminal:
C:\Users\***\AppData\Local\Android\sdk\tools>emulator -avd Samsung_Galaxy_S7_API_24
I get:
Could not launch 'C:\Users\DHJ\AppData\Local\Android\sdk\tools..\emulator\qemu\windows-x86_64\qemu-system-i386.exe': No such file or directory
And when I run it from a different folder (why are there 2 locations for the emulator?):
C:\Users\***\AppData\Local\Android\sdk\emulator>emulator -avd Samsung_Galaxy_S7_API_24
I get:
emulator: ERROR: can't find the emulator executable.
Any ideas on how I can AVD working again?
I solved this by downgrading the emulator using the reply from:
How to downgrade Android Emulator

Failed to execute adb.exe when trying to run Xamarin.UITest

I'm trying to setup a Xamarin UITest without any luck.
When I try to run 'all tests', I get the following error:
execute: C:\Users\Brandon\AppData\Local\Android\android-sdk\platform-tools\adb.exe devices - exit code: 1
error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
List of devices attached
adb server version (39) doesn't match this client (36); killing...
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
ADB seems to be started just fine and the weird thing is that it seems to be using an adb version from another user, even though..
1) Tools > Options > Xamarin > Android is set to different path than the above-mentioned, for the Android SDK.
2) There is no system environment path variable that I can find for the above-referenced adb.exe path!
Am I missing something?
In my case it was Android Emulator version mismatch. Somehow Emulator got updated to the newer version:
After uninstalling Emulator, switching Feed to Microsoft instead of google and re-installing Emulator - error was gone and everything worked just fine.

Jenkins Android Emulator Plugin not running

I am trying to explore and use the Jenkins Android Emulator plugin in order to run my emulator within a CI environment. I have so far tried 3 different methods but none of them is able to run the emulator
Method 1:Using an existing emulator
Screenshot of the first method
In the job's configuration , Select Run an Android emulator during build, then Run existing emulator. In the AVD name I insert Nexus5X_6_8664 then Jenkins is able to find it.
When i run the job it gives me the following error :
Started by user Amine
Building in workspace D:\jenkins\workspace\Emulator
[android] Using Android SDK: D:\Tools\Dev\sdk\
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe start-server
* daemon not running. starting it now at tcp:5857 *
* daemon started successfully *
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe start-server
[android] Starting Android emulator
$ D:\Tools\Dev\sdk\/tools/emulator.exe -engine classic -ports 5768,5769 -report-console tcp:5833,max=60 -avd Nexus5X_6_8664 -no-snapshot-load -no-snapshot-save
init: Could not find wglGetExtensionsStringARB!
getGLES2ExtensionString: Could not find GLES 2.x config!
Failed to obtain GLES 2.x extensions string!
Could not initialize emulated framebuffer
emulator: device fd:964
HAXM is working and emulator runs in fast virt mode
emulator: WARNING: Requested adb port (5769) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details.
[android] Emulator reported that the console is available on port 5 768
[android] Waiting for emulator to finish booting...
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe -s emulator-5768 wait-for-device shell getprop init.svc.bootanim
emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.
ERROR: Timeout after 45000 milliseconds
$ D:\Tools\Dev\sdk\/platform-tools/adb.exe kill-server
Finished: NOT_BUILT
More details :
I have increased VMHeap, changed graphics to automatic, Hardware GLES 2.0 or Software GLES 2.0 (as in Android emulator: could not get wglGetExtensionsStringARB error or could not find wglGetExtensionsStringARB)
I have Tried many screen resolutions
I have added window.x = 0 window.y = 0 to #Nexus5X_6_8664.ini
Method 2:Creating a new emulator
Screenshot of the second method
In the job's configuration , Select "Run an Android emulator during build", then "Run emulator with properties" :
Android OS version : android-23
Screen density : hdpi
Screen resolutions : 480x800
Device locale : en_US
SD card size : 64M
Target ABI : x86_64
Emulator name suffix
When i run the job it gives me the following error :
Started by user Amine
Building in workspace D:\jenkins\workspace\Emulator
[android] Using Android SDK: D:\Tools\Dev\sdk\
[android] Creating Android AVD: C:\Users\Amine\.android\avd\hudson_en-US_240_WVGA_android-23_x86_64_mySuffix.avd
[android] D:\Tools\Dev\sdk\/tools/android.bat create avd -f -a -c 64M -s WVGA800 -n hudson_en-US_240_WVGA_android-23_x86_64_mySuffix -t android-23 --abi x86_64
[android] Could not create Android emulator: Failed to parse AVD config file
Finished: NOT_BUILT
When i run the same command above on my command line manually to investigate te errors it gives the following error :
Error: Flag '-s' is not valid for 'create avd'.
I try to remove -s and then -t then it requests :
Error: Package path (-k) not specified. Valid system image paths are:
system-images;android-23;default;armeabi-v7a
system-images;android-23;google_apis;x86
system-images;android-23;default;x86_64
system-images;android-23;google_apis;x86_64
system-images;android-23;default;x86
system-images;android-23;google_apis;armeabi-v7a
Method 3: Using command lines instead of Android Emulator Plugin
[Screenshot of the third method][3]
I have then decided to drop the Android emulator plugin and start using a regular Windows batch command from jenkins with the following lines :
D:
cd D:\Tools\Dev\sdk\tools\
D:\Tools\Dev\sdk\tools\emulator.exe #Nexus5X_6_8664
When i Run "adb devices" on separated command line I am able to view my emulator finally running; However the emulator's window is not displayed and it keeps displaying the following error :
D:\Tools\Dev\sdk\tools>D:\Tools\Dev\sdk\tools\emulator.exe #Nexus5X_6_8664
Hax is enabled
Hax ram_size 0x60000000
HAX is working and emulator runs in fast virt mode.
init: Could not find wglGetExtensionsStringARB!
OpenGL backend 'angle' without OpenGL ES 1.x library detected. Using GLESv2 only.
eglMakeCurrent failed
eglMakeCurrent failed
eglMakeCurrent failed
eglMakeCurrent failed
Please note if i run D:\Tools\Dev\sdk\tools\emulator.exe #Nexus5X_6_8664 from my command line manually I'm not having any problem as the errors above.
More details :
Jenkins services are running with my Login/Password access rights as an administrator. (I have followed cloudbees tutorial and it works fine)
I have added window.x = 0 window.y = 0 to #Nexus5X_6_8664.ini
On the issue with Method 1:
Can you try updating to the latest version of SDK tools. We had similar issue and it got fixed after latest updates.
Update the below and try again :
Android Emulator [27.2.9 (May 2018)]
Android SDK Platform Tools
Android SDK Tools
Intel x86 Emulator Accelerator (HAXM installer)
follow the below thread on how to update:
Emulator: ERROR :detected a hanging thread 'Qt event loop'

Resources