(v2) appium install driver deletes previous installed driver(s) when installing multiple drivers.
See original GitHub issueThe problem
I installed appium 2.0.0-beta.27 via npm, first installed uiautomator2 driver - run test with uiautomator2 -> all ok then installed espresso driver - run test with uiautomator2 again -> error:
Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Could not find a driver for automationName 'UIAutomator2' and platformName android'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error: Cannot find module '/home/cmaganu/.appium/node_modules/appium-uiautomator2-driver
Environment
- Appium version (or git revision) that exhibits the issue: 2.0.0-beta.27
- Last Appium version that did not exhibit the issue (if applicable): -
- Desktop OS/version used to run Appium: Ubunntu 20.10
- Node.js version (unless using Appium.app|exe): v16.14.2
- Npm or Yarn package manager: npm 8.5.5
- Mobile platform/version under test: Android 10
- Real device or emulator/simulator: emulator
- Appium CLI or Appium.app|exe: cli
Details
- after
appium driver install uiautomator2
:
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ ls -Al ~/.appium/node_modules/
total 128
drwxrwxr-x 5 cmaganu cmaganu 4096 mar 28 16:45 appium-uiautomator2-driver
drwxrwxr-x 3 cmaganu cmaganu 4096 mar 28 16:45 .cache
-rw-rw-r-- 1 cmaganu cmaganu 121877 mar 28 16:45 .package-lock.json
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ cat ~/.appium/node_modules/.cache/appium/extensions.yaml
drivers:
uiautomator2:
automationName: UiAutomator2
platformNames:
- Android
mainClass: AndroidUiautomator2Driver
pkgName: appium-uiautomator2-driver
version: 2.0.5
installType: npm
installSpec: uiautomator2
plugins: {}
schemaRev: 2
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ appium driver list --installed
✔ Listing installed drivers
- uiautomator2@2.0.5 [installed (NPM)]
- after
appium driver install espresso
:
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ appium driver list --installed
✔ Listing installed drivers
- uiautomator2@2.0.5 [installed (NPM)]
- espresso@2.2.0 [installed (NPM)]
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ ls -Al ~/.appium/node_modules/
total 708
drwxrwxr-x 6 cmaganu cmaganu 4096 mar 28 16:49 appium-espresso-driver
drwxrwxr-x 3 cmaganu cmaganu 4096 mar 28 16:45 .cache
-rw-rw-r-- 1 cmaganu cmaganu 714864 mar 28 16:49 .package-lock.json
cmaganu@cma-x1:~/git/lt-appium-mobile-tests(main)$ cat ~/.appium/node_modules/.cache/appium/extensions.yaml
drivers:
uiautomator2:
automationName: UiAutomator2
platformNames:
- Android
mainClass: AndroidUiautomator2Driver
pkgName: appium-uiautomator2-driver
version: 2.0.5
installType: npm
installSpec: uiautomator2
espresso:
automationName: Espresso
platformNames:
- Android
mainClass: EspressoDriver
pkgName: appium-espresso-driver
version: 2.2.0
installType: npm
installSpec: espresso
plugins: {}
schemaRev: 2
.appium/package.json
is empty
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Installing Appium 2.0 and the Driver and Plugins CLI - HeadSpin
Use the "Appium driver" command to install the one(s) you want to use. ... That's because no drivers are included by default with...
Read more >Troubleshooting - Appium
When installing on Mac, make sure the user has write permissions for /usr/local/lib or install Appium ... After setting power state to off...
Read more >UIAutomator2 (Android) - Appium
Appium's flagship support for automating Android apps is via the UiAutomator2 driver. (New to Appium? Read our introduction to Appium drivers). This driver...
Read more >Getting Started - Appium
Appium can be installed in one of two ways: via NPM or by downloading Appium Desktop, which is a graphical, desktop-based way to...
Read more >Error installing driver with Appium 2.0 - Support
I'm trying the latest Appium 2.0 and I get this error when trying to install individual drivers. Anyone know what the problem is?...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As for a workaround I just backed up the folder for the first driver (say uiautomator2) and copied it back after the installation of the second driver. 😄
OK, I have a fix, will send a PR once I write a test for it.
you can workaround this by manually editing
~/.appium/package.json
like so: