appium / appium-doctor

[Deprecated] Please use https://github.com/appium/appium/tree/master/packages/doctor
Apache License 2.0
128 stars 34 forks source link

fix railing error in checking Xcode CLI installation for macOS 10.11+ #44

Closed KazuCocoa closed 5 years ago

KazuCocoa commented 5 years ago

AS below, I faced Xcode Command Line Tools are NOT installed! error evern I had it. It had never succeeded even I selected yes and re-ran the doctor.

According to https://stackoverflow.com/questions/15371925/how-to-check-if-command-line-tools-is-installed and my local check, current logic no longer works for recent macOS. Instead, we must call xcode-select -p, simply. If the command exists error status, we should install xcode CLI.

$ appium-doctor
info AppiumDoctor Appium Doctor v.1.6.0
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor  ✔ The Node.js binary was found at: /Users/kazuaki/.nodebrew/current/bin/node
info AppiumDoctor  ✔ Node version is 10.11.0
info AppiumDoctor  ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
WARN AppiumDoctor  ✖ Xcode Command Line Tools are NOT installed!
info AppiumDoctor  ✔ DevToolsSecurity is enabled.
info AppiumDoctor  ✔ The Authorization DB is set up properly.
info AppiumDoctor  ✔ Carthage was found at: /usr/local/bin/carthage
info AppiumDoctor  ✔ HOME is set to: /Users/kazuaki
info AppiumDoctor  ✔ ANDROID_HOME is set to: /Users/kazuaki/Library/Android/sdk
info AppiumDoctor  ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
info AppiumDoctor  ✔ adb exists at: /Users/kazuaki/Library/Android/sdk/platform-tools/adb
info AppiumDoctor  ✔ android exists at: /Users/kazuaki/Library/Android/sdk/tools/android
info AppiumDoctor  ✔ emulator exists at: /Users/kazuaki/Library/Android/sdk/tools/emulator
info AppiumDoctor  ✔ Bin directory of $JAVA_HOME is set
info AppiumDoctor ### Diagnostic completed, one fix needed. ###
info AppiumDoctor
info AppiumDoctor ### Fixing:  ✖ Xcode Command Line Tools are NOT installed! ###
info AppiumDoctor The following command need be executed: xcode-select --install
? Fix it: yes

We can remove macOS version check since even Xcode8, it was deprecated, requires 10.11.4.