How to Resolve Missing Optional Dependencies in Appium on macOS

How to Resolve Missing Optional Dependencies in Appium on macOS

10 November 2024 Stephan Petzl Leave a comment Tech-Help

Setting up Appium on macOS can sometimes present challenges, particularly when optional dependencies like opencv4nodejs and bundletool.jar are missing. This guide will walk you through the steps to successfully install these dependencies, ensuring that your Appium setup is complete and functional.

Installing opencv4nodejs

The installation of opencv4nodejs can be straightforward using npm. Follow these steps:

  1. Open your terminal and run the following command:
    npm -g install opencv4nodejs
  2. If you encounter issues related to dependencies, you may need to install make using Homebrew:
    brew install make

For macOS Catalina (10.15.1) users, if you face issues due to C++ 11 features, pre-install OpenCV using Homebrew:

brew install opencv@4

Then, disable OpenCV autobuild before installing opencv4nodejs:

export OPENCV4NODEJS_DISABLE_AUTOBUILD=1

Setting Up bundletool.jar

To set up bundletool.jar, follow these steps:

  1. Download bundletool-all-0.8.0.jar from the official GitHub releases page.
  2. Rename the downloaded file to bundletool.jar and place it in your Android SDK folder under a new sub-folder named bundle-tool. The path should be:
    /Users/{USER}/Library/Developer/Android/sdk/bundle-tool
  3. Make the bundletool.jar executable by running:
    chmod +x bundletool.jar
  4. Add the bundle-tool folder to your system PATH by editing your ~/.bashrc file:
    PATH="$PATH:$ANDROID_HOME/bundle-tool"

Verification

After completing these steps, you can verify that the dependencies are correctly installed by running:

appium-doctor

This command should no longer report any missing dependencies, confirming that your setup is complete.

Enhancing Your Testing Experience

While Appium is a powerful tool for mobile automation testing, it can sometimes be slow and the tests unstable. If you’re looking for a faster and more stable testing solution, consider using Repeato. Repeato is a no-code test automation tool for iOS and Android that leverages computer vision and AI to create and run tests quickly. Unlike Appium, Repeato allows you to edit and execute tests at blazing speeds, significantly improving your testing workflow.

Like this article? there’s more where that came from!