I'm generally a tech noob and this is my first post here, so feel free to bash me for everything wrong about my post, so I better myself^^
I'm googling and searching stack overflow a while know for this issue, but most of the related topics revolve around simulators or have clearly different causes.
I'm running tests on Android and iOS Devices using Jenkins on a Mac mini with Appium Desktop. In the beginning of the Android tests I need to reboot the devices. I do so via adb reboot and unlock the devices via adb too. This all works fine and results in an unlocked Android device with active screen.
My Issue is, that when there are multiple physical devices connected to the Mac mini, I seemingly random run into the error, that Appium won't find the device I'm targeting via the udid, even though adb already unlocked the phone, so there definitely is a physical connection.
The devices also all show up when i run adb devices.
I can solve the issue by disconnecting some of the devices that are not the target of the current job. I want to use two iOS and two Android-devices in total. Sometimes it works, but only until it doesn't.
It happens on different Macs too, but I don't know if this maybe even is a physical thing with the Macs, since I don't have the possibility to test it on Windows machines.
Here is the part of my Appium logs:
[info] [35m[AndroidDriver][39m Retrieving device list
[debug] [35m[ADB][39m Trying to find a connected android device
[debug] [35m[ADB][39m Getting connected devices
[debug] [35m[ADB][39m Connected devices: [{"udid":"97RAY11PXB","state":"device"}]
[error] [35m[AndroidDriver][39m Device 03JAYV27BX was not in the list of connected devices
Here is some of my jenkins console output:
org.openqa.selenium.SessionNotCreatedException: 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: Device 03JAYV27BX was not in the list of connected devices Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Users-Mac-mini.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '13.0.2' Driver info: driver.version: AndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Device 03JAYV27BX was not in the list of connected devices at getResponseForW3CError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/errors.js:804:9) at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/protocol.js:380:37) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Users-Mac-mini.local', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '13.0.2' Driver info: driver.version: AndroidDriver at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208) at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:336) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:37) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:88) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:98) at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:94) at