Appium

WARN AppiumDoctor ✖ adb, android, emulator could NOT be found in C:\work\Android\sdk!:

インストール

  • JDK
  • Android Studio
  • Xcode
  • brew
  • npm
  • Carthage
  • Appium
  • Appium Driver

JDK

ARM64 DMG Installerのインストール:

1
2
# .zshrc
export JAVA_HOME=JAVA_HOME=$(/usr/libexec/java_home)
1
2
3
4
% java -version
java version "22.0.1" 2024-04-16
Java(TM) SE Runtime Environment (build 22.0.1+8-16)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)

Android Studio

  • Mac with Apple Chip でインストール

  • Settings…: Language & Framework > Android SDK:

      /Users/{user}/Library/Android/sdk
    
1
2
3
#.zshrc:
export ANDROID_HOME=/Users/hdknr/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools

XCode

1
2
3
% xcode-select --install

xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates

brew

1
2
/opt/homebrew/bin/brew update
/opt/homebrew/bin/brew upgrade

nodebrew

1
2
3
4
/opt/hmebrew/bin/bew install nodebeww
/opt/hommbrew/bin/unistall --force --ignore-dependancies node
mkdir -p ~/.nodebrew/src
/opt/homebrew/bin/nodebrew install v22.0.0

Carthage

1
/opt/homebrew/bin/brew install carthage
1
  /opt/homebrew/share/zsh/site-functions

Appium

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
npm i --location=global appium

added 447 packages in 19s

58 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New patch version of npm available! 10.5.1 -> 10.5.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.5.2
npm notice Run
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
npm install appium-doctor -g

npm WARN deprecated phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated authorize-ios@1.2.1: Moved into appium

added 267 packages in 16s

27 packages are looking for funding
  run `npm fund` for details

appium inspector

1
xattr -cr "/Applications/Appium Inspector.app"

appium-docter

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
WARN AppiumDoctor [Deprecated] Please use appium-doctor installed with "npm install @appium/doctor --location=global"
info AppiumDoctor Appium Doctor v.1.16.2
info AppiumDoctor ### Diagnostic for necessary dependencies starting ###
(node:50764) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info AppiumDoctor  ✔ The Node.js binary was found at: /Users/hdknr/.nodebrew/current/bin/node
info AppiumDoctor  ✔ Node version is 22.0.0
info AppiumDoctor  ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor  ✔ Xcode Command Line Tools are installed in: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor  ✔ DevToolsSecurity is enabled.
info AppiumDoctor  ✔ The Authorization DB is set up properly.
info AppiumDoctor  ✔ Carthage was found at: /usr/local/bin/carthage. Installed version is: 0.39.1
info AppiumDoctor  ✔ HOME is set to: /Users/hdknr
info AppiumDoctor  ✔ ANDROID_HOME is set to: /Users/hdknr/Library/Android/sdk
WARN AppiumDoctor  ✖ JAVA_HOME is set to 'JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-22.jdk/Contents/Home' but this is NOT a valid path!
info AppiumDoctor    Checking adb, android, emulator, apkanalyzer
info AppiumDoctor      'adb' is in /Users/hdknr/Library/Android/sdk/platform-tools/adb
info AppiumDoctor      'emulator' is in /Users/hdknr/Library/Android/sdk/emulator/emulator
WARN AppiumDoctor  ✖ android, apkanalyzer could NOT be found in /Users/hdknr/Library/Android/sdk!
WARN AppiumDoctor  ✖ 'bin' subfolder does not exist under 'JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-22.jdk/Contents/Home'. Is $JAVA_HOME set to a proper value?
info AppiumDoctor ### Diagnostic for necessary dependencies completed, 3 fixes needed. ###
info AppiumDoctor
info AppiumDoctor ### Diagnostic for optional dependencies starting ###
WARN AppiumDoctor  ✖ opencv4nodejs cannot be found.
info AppiumDoctor  ✔ ffmpeg is installed at: /usr/local/bin/ffmpeg. ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
WARN AppiumDoctor  ✖ mjpeg-consumer cannot be found.
WARN AppiumDoctor  ✖ set-simulator-location is not installed
WARN AppiumDoctor  ✖ idb and idb_companion are not installed
WARN AppiumDoctor  ✖ applesimutils cannot be found
WARN AppiumDoctor  ✖ ios-deploy cannot be found
WARN AppiumDoctor  ✖ bundletool.jar cannot be found
WARN AppiumDoctor  ✖ gst-launch-1.0 and/or gst-inspect-1.0 cannot be found
info AppiumDoctor ### Diagnostic for optional dependencies completed, 8 fixes possible. ###
info AppiumDoctor
info AppiumDoctor ### Manual Fixes Needed ###
info AppiumDoctor The configuration cannot be automatically fixed, please do the following first:
WARN AppiumDoctor  ➜ Make sure the environment variable JAVA_HOME is properly configured for the Appium process. Refer https://github.com/appium/java-client/blob/master/docs/environment.md for more details.
WARN AppiumDoctor  ➜ Manually install android, apkanalyzer and add it to PATH. https://developer.android.com/studio#cmdline-tools and https://developer.android.com/studio/intro/update#sdk-manager may help to setup.
WARN AppiumDoctor  ➜ Set $JAVA_HOME environment variable to the root folder path of your local JDK installation
info AppiumDoctor
info AppiumDoctor ### Optional Manual Fixes ###
info AppiumDoctor The configuration can install optionally. Please do the following manually:
WARN AppiumDoctor  ➜ Why opencv4nodejs is needed and how to install it: http://appium.io/docs/en/writing-running-appium/image-comparison/
WARN AppiumDoctor  ➜ mjpeg-consumer module is required to use MJPEG-over-HTTP features. Please install it with 'npm i -g mjpeg-consumer'.
WARN AppiumDoctor  ➜ set-simulator-location is needed to set location for Simulator. Please read https://github.com/lyft/set-simulator-location to install it
WARN AppiumDoctor  ➜ Why idb is needed and how to install it: https://github.com/appium/appium-idb
WARN AppiumDoctor  ➜ Why applesimutils is needed and how to install it: http://appium.io/docs/en/drivers/ios-xcuitest/
WARN AppiumDoctor  ➜ ios-deploy is used as a fallback command to install iOS applications to real device. Please read https://github.com/ios-control/ios-deploy/ to install it
WARN AppiumDoctor  ➜ bundletool.jar is used to handle Android App Bundle. Please read http://appium.io/docs/en/writing-running-appium/android/android-appbundle/ to install it
WARN AppiumDoctor  ➜ gst-launch-1.0 and gst-inspect-1.0 are used to stream the screen of the device under test. Please read https://appium.io/docs/en/writing-running-appium/android/android-screen-streaming/ to install them and for more details
info AppiumDoctor
info AppiumDoctor ###
info AppiumDoctor
info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!
info AppiumDoctor

opencv4nodejs

1
/opt/homebrew/bin/brew install opencv@4
1
2
3
4
5
6
# .zshrc
export OPENCV4NODEJS_DISABLE_AUTOBUILD=1
export OPENCV_HOME=/opt/homebrew/Cellar/opencv/4.7.0_7/
export OPENCV_LIB_DIR=${OPENCV_HOME}/lib
export OPENCV_BIN_DIR=${OPENCV_HOME}/bin
export OPENCV_INCLUDE_DIR=${OPENCV_HOME}/include/opencv4
1
npm install -g opencv4nodejs

mjpeg-consumer

1
npm install -g mjpeg-consumer

set-simulator-location

1
brew install lyft/formulae/set-simulator-location

idb & idb-client

1
2
3
4
/opt/homebrew/bin/brew tap facebook/fb
/opt/homebrew/bin/brew  install idb-companion

/opt/homebrew/bin/pip3.11 install fb-idb

applesimutils

1
2
/opt/homebrew/bin/brew tap wix/brew
/opt/homebrew/bin/brew install applesimutils

ios-deploy

1
/opt/homebrew/bin/brew install ios-deploy

bundletool.jar

1
2
3
mkdir ~/Library/Android/sdk/bundle-tool
cp ~/Downloads/bundletool-all-1.16.0.jar ~/Library/Android/sdk/bundle-tool/bundletool.jar
chmod +x ~/Library/Android/sdk/bundle-tool/bundletool.jar
1
2
# .zshrc
export PATH=${PATH}:${ANDROID_HOME}/bundle-tool

Appium Driver

uiautomator2

1
appium driver install uiautomator2

chromium

1
appium driver install chromium

xcuitest

1
appium driver install xcuitest

gstreamer

1
brew install gstreamer
All gst-* GStreamer plugins are now bundled in this formula.
For GStreamer to find your own plugins, add their paths to `GST_PLUGIN_PATH`.
For example, if you have plugins in `~/.local/lib/gstreamer-1.0`:
  export GST_PLUGIN_PATH="~/.local/lib/gstreamer-1.0"

Do not install plugins into GStreamer's prefix. They will be deleted
by `brew upgrade`.
==> Summary
🍺  /opt/homebrew/Cellar/gstreamer/1.24.2: 1,321 files, 136.8MB
==> Running `brew cleanup gstreamer`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> gstreamer
All gst-* GStreamer plugins are now bundled in this formula.
For GStreamer to find your own plugins, add their paths to `GST_PLUGIN_PATH`.
For example, if you have plugins in `~/.local/lib/gstreamer-1.0`:
  export GST_PLUGIN_PATH="~/.local/lib/gstreamer-1.0"

Do not install plugins into GStreamer's prefix. They will be deleted
by `brew upgrade`.