5 April 2024 Leave a comment Tech-Help
When working with Appium on macOS, you might encounter a situation where certain optional dependencies are missing. These dependencies are crucial for a seamless Appium experience. Today, we’ll walk through the steps to install two of these: opencv4nodejs
and bundletool.jar
.
Installing opencv4nodejs
To install the opencv4nodejs
package, you can use the following command:
npm -g install opencv4nodejs
This installation might require additional dependencies. If you encounter any issues, ensure you have ‘make’ installed on your system. You can install ‘make’ using Homebrew:
brew install make
In some cases, particularly on MacOS Catalina (10.15.1), you may face issues with building opencv4nodejs
due to C++ 11 features compatibility. To address this, install OpenCV using Homebrew with the following command:
brew install opencv@4
Then, set an environment variable to prevent auto-building of OpenCV:
export OPENCV4NODEJS_DISABLE_AUTOBUILD=1
After setting the variable, proceed to install opencv4nodejs
using the npm command mentioned earlier.
Setting up bundletool.jar
The bundletool.jar
is a tool provided by Google to work with Android App Bundles. Follow these steps to set it up:
- Download
bundletool-all-0.8.0.jar
from the official Bundletool releases page. - Rename the downloaded file to
bundletool.jar
and place it in a dedicated sub-folder within your Android SDK directory, like so:/Users/{USER}/Library/Developer/Android/sdk/bundle-tool
. - Make the
bundletool.jar
file executable by running the following command in your terminal: - Add the
bundle-tool
folder to your system’s PATH variable. Edit your~/.bashrc
file and append the following line:
chmod +x bundletool.jar
PATH="$PATH:$ANDROID_HOME/bundle-tool"
After completing these steps, verify the setup by running which bundletool.jar
in your terminal. If correctly set up, it should point to the folder you created.
Finalizing the Setup
With both opencv4nodejs
and bundletool.jar
installed and set up, running appium-doctor
should now show that all dependencies are satisfied, ensuring a fully functional Appium environment.
By following these instructions, you can resolve common issues related to the optional dependencies for Appium on macOS. This will help you maintain an optimally functioning development environment for your mobile application testing and development.