Two parallel sessions on one device or attach to session


I have been using an older appium 1 version for a long time. With it, I could previously open two different sessions on the same Android device and use them in parallel without the first session being terminated. Now that I have updated all components to the latest appium 2 version, this no longer seems possible. As soon as I open a second session, the first one cannot be used anymore (message: cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed)).

How can I prevent the first UiAutomator2 session from being terminated or cleaned up?

The options noreset = true and fullreset = false do not help here.

Alternatively, I looked for the possibility to reuse an existing session. But neither in Python nor in C# I could find a way to specify an existing session id when creating the driver.

Windows 10 64-bit
Appium 2.0.0-beta.48
[email protected]
Python 3.10.9
selenium 4.7.2
Appium-Python-Client 2.7.1
C# project:
Appium.WebDriver 5.0.0-beta02
selenium 4.7.0