Appium Doctor returns "Could not detect Mac OS X Version" using OSX 10.10

Tried using Appium Doctor to help troubleshoot a coworkers setup.

/Appium.app/Contents/Resources/node_modules/appium/bin/appium-doctor.js’
Running iOS Checks
:heavy_multiplication_x: Could not detect Mac OS X Version
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.
➜ ~

I’m guessing this is an issue with 10.10?

Thanks,

Jonathon Ramey

1 Like

Got the same problem today.

Because Appium 1.3.1 not support MAC OS 10.10 yet, but you can modify default script solve this issue.

default path: /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/doctor/ios.js

IOSChecker.prototype.getMacOSXVersion = function (cb) {
  exec("sw_vers -productVersion", function (err, stdout) {
    if (err === null) {
      if (stdout.match('10.8') !== null) {
        this.osVersion = '10.8';
        cb(null, "Mac OS X 10.8 is installed.");
      } else if (stdout.match('10.9') !== null) {
        this.osVersion = '10.9';
        cb(null, "Mac OS X 10.9 is installed.");
      } else if (stdout.match('10.10') !== null) {
        this.osVersion = '10.10';
        cb(null, "Mac OS X 10.10 is installed.");
      } else {
        this.log.fail("Could not detect Mac OS X Version", cb);
      }
    } else {
      this.log.fail("Unknown SW Version Command: " + err, cb);
    }
  }.bind(this));
};

PinLiang, Chen

2 Likes

Hi All,

i am also facing the same issue for ios app:

ADMIN$ appium-doctor
Running iOS Checks
:heavy_check_mark: Xcode is installed at /Applications/Xcode.app/Contents/Developer
:heavy_check_mark: Xcode Command Line Tools are installed.
:heavy_check_mark: DevToolsSecurity is enabled.
:heavy_check_mark: The Authorization DB is set up properly.
:heavy_check_mark: Node binary found at /usr/local/bin/node
:heavy_check_mark: iOS Checks were successful.

Running Android Checks
:heavy_multiplication_x: ANDROID_HOME is not set
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.

what is the error and how can i fix it, urgent help required on this.

      Hi All,

i am also facing the same issue for ios app:

ADMIN$ appium-doctor
Running iOS Checks
:heavy_check_mark: Xcode is installed at /Applications/Xcode.app/Contents/Developer
:heavy_check_mark: Xcode Command Line Tools are installed.
:heavy_check_mark: DevToolsSecurity is enabled.
:heavy_check_mark: The Authorization DB is set up properly.
:heavy_check_mark: Node binary found at /usr/local/bin/node
:heavy_check_mark: iOS Checks were successful.

Running Android Checks
:heavy_multiplication_x: ANDROID_HOME is not set
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.

what is the error and how can i fix it, urgent help required on this.

U need to set the Android SDK path in Environment Variable.

i dont think its reqd as i am testing for ios app.

So you shouldn’t have any issue running Appium on iOS as i see all ur iOS checks are successful

wonderful, it worked, Thanks PinLiang.

I have the same issue but with OS X 10.11

what is the change i need to make in ios.js to make it work?

This works for iOS 10.11 El Capitan

IOSChecker.prototype.getMacOSXVersion = function (cb) {
exec(“sw_vers -productVersion”, function (err, stdout) {
if (err === null) {
if (stdout.match(‘10.8’) !== null) {
this.osVersion = ‘10.8’;
cb(null, “Mac OS X 10.8 is installed.”);
} else if (stdout.match(‘10.9’) !== null) {
this.osVersion = ‘10.9’;
cb(null, “Mac OS X 10.9 is installed.”);
} else if (stdout.match(‘10.10’) !== null) {
this.osVersion = ‘10.10’;
cb(null, “Mac OS X 10.10 is installed.”);
} else if (stdout.match(‘10.11’) !== null) {
this.osVersion = ‘10.11’;
cb(null, “Mac OS X 10.11 is installed.”);
} else {
this.log.fail(“Could not detect Mac OS X Version”, cb);
}
} else {
this.log.fail("Unknown SW Version Command: " + err, cb);
}
}.bind(this));
};

1 Like

I am also facing the same issue . Mention below the appium logs
Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --address “127.0.0.1” --command-timeout “7200” --session-override --debug-log-spacing --log-timestamp --log-level “debug” --local-timezone --platform-version “8.1” --platform-name “iOS” --app “com.dishnetwork.DANY-Mobile” --udid “4ca70f0f56ce9dac8fce493904ca597a32421b9c” --show-ios-log --device-name “iPhone 6” --launch-timeout “90000” --native-instruments-lib

2015-12-09 00:53:33:383 - info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)

2015-12-09 00:53:33:386 - info: Appium REST http interface listener started on 127.0.0.1:4723

2015-12-09 00:53:33:391 - info: [debug] Non-default server args: {“app”:“com.dishnetwork.DANY-Mobile”,“udid”:“4ca70f0f56ce9dac8fce493904ca597a32421b9c”,“address”:“127.0.0.1”,“sessionOverride”:true,“launchTimeout”:“90000”,“logTimestamp”:true,“localTimezone”:true,“nativeInstrumentsLib”:true,“deviceName”:“iPhone 6”,“platformName”:“iOS”,“platformVersion”:“8.1”,“showIOSLog”:true,“defaultCommandTimeout”:7200,“debugLogSpacing”:true}

2015-12-09 00:53:33:391 - info: Console LogLevel: debug

2015-12-09 00:53:33:799 - info: --> GET /wd/hub/status {}

2015-12-09 00:53:33:801 - info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

2015-12-09 00:53:33:808 - info: <-- GET /wd/hub/status 200 9.428 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

2015-12-09 00:53:35:001 - info: --> GET /wd/hub/status {}

2015-12-09 00:53:35:001 - info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

2015-12-09 00:53:35:004 - info: <-- GET /wd/hub/status 200 3.536 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
2015-12-09 00:53:35:006 - info: --> GET /wd/hub/sessions {}
2015-12-09 00:53:35:006 - info: [debug] Responding to client with success: {“status”:0,“value”:[]}
2015-12-09 00:53:35:007 - info: <-- GET /wd/hub/sessions 200 1.128 ms - 23 {“status”:0,“value”:[]}

2015-12-09 00:53:35:024 - info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformName”:“iOS”,“platformVersion”:“8.1”,“newCommandTimeout”:“999999”,“automationName”:“Appium”,“deviceName”:“iPhone 6”}}

2015-12-09 00:53:35:025 - info: Client User-Agent string: Appium (unknown version) CFNetwork/760.0.5 Darwin/15.0.0 (x86_64)
2015-12-09 00:53:35:025 - info: *************************************
2015-12-09 00:53:35:025 - info: *************************************
2015-12-09 00:53:35:025 - info: *************************************

2015-12-09 00:53:35:025 - info: *************************************
2015-12-09 00:53:35:026 - info: *************************************
2015-12-09 00:53:35:027 - info: *************************************
2015-12-09 00:53:35:027 - info: *************************************
2015-12-09 00:53:35:027 - info: *************************************
2015-12-09 00:53:35:027 - info: **** NEW SESSION ***
2015-12-09 00:53:35:028 - info: **** NEW SESSION ***
2015-12-09 00:53:35:028 - info: **** NEW SESSION ***
2015-12-09 00:53:35:028 - info: **** NEW SESSION ***
2015-12-09 00:53:35:028 - info: **** NEW SESSION ***
2015-12-09 00:53:35:028 - info: **** NEW SESSION ***
2015-12-09 00:53:35:028 - info: **** NEW SESSION ***
2015-12-09 00:53:35:028 - info: **** NEW SESSION ***
2015-12-09 00:53:35:029 - info: *************************************
2015-12-09 00:53:35:029 - info: *************************************
2015-12-09 00:53:35:029 - info: *************************************
2015-12-09 00:53:35:029 - info: *************************************
2015-12-09 00:53:35:029 - info: *************************************
2015-12-09 00:53:35:029 - info: *************************************
2015-12-09 00:53:35:029 - info: *************************************
2015-12-09 00:53:35:029 - info: *************************************
2015-12-09 00:53:35:034 - info: [debug] App is an iOS bundle, will attempt to run as pre-existing

2015-12-09 00:53:35:035 - info: [debug] Creating new appium session 21b7557f-c537-4043-afde-7b09a3707f8b
2015-12-09 00:53:35:037 - info: [debug] Removing any remaining instruments sockets
2015-12-09 00:53:35:039 - info: [debug] Cleaned up instruments socket /tmp/instruments_sock
2015-12-09 00:53:35:039 - info: [debug] Auto-detecting iOS udid…
2015-12-09 00:53:35:039 - info: [debug] Not auto-detecting udid, running on sim
2015-12-09 00:53:35:040 - info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.dishnetwork.DANY-Mobile/en.lproj/Localizable.strings
2015-12-09 00:53:35:040 - info: Will try to parse the plist file as XML
2015-12-09 00:53:35:041 - info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.dishnetwork.DANY-Mobile/en.lproj/Localizable.strings
2015-12-09 00:53:35:041 - warn: Could not parse app Localizable.strings assuming it doesn’t exist
2015-12-09 00:53:35:041 - info: [debug] Creating instruments
2015-12-09 00:53:35:042 - info: [debug] Preparing uiauto bootstrap
2015-12-09 00:53:35:042 - info: [debug] Dynamic bootstrap dir: /Users/slinger/Library/Application Support/appium/bootstrap
2015-12-09 00:53:35:043 - info: [debug] Dynamic env: {“nodePath”:"/Applications/Appium.app/Contents/Resources/node/bin/node",“commandProxyClientPath”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js",“instrumentsSock”:"/tmp/instruments_sock",“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“autoDismissAlerts”:false,“sendKeyStrategy”:“grouped”}

2015-12-09 00:53:35:049 - info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

2015-12-09 00:53:35:049 - info: [debug] Dynamic bootstrap path: /Users/slinger/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
2015-12-09 00:53:35:054 - info: [debug] Reusing dynamic bootstrap: /Users/slinger/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
2015-12-09 00:53:35:056 - info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

2015-12-09 00:53:35:248 - info: [debug] Creating iDevice object with udid 4ca70f0f56ce9dac8fce493904ca597a32421b9c

2015-12-09 00:53:36:808 - info: [debug] App is installed.

2015-12-09 00:53:36:808 - info: [debug] fullReset not requested. No need to install.
2015-12-09 00:53:36:808 - info: [debug] Starting command proxy.

2015-12-09 00:53:36:809 - info: [debug] Instruments socket server started at /tmp/instruments_sock
2015-12-09 00:53:36:810 - info: [debug] Starting instruments

WARN
Finding XcodePath by symlink because Error: Command failed: /bin/sh -c xcode-select --print-path
/bin/sh: xcode-select: command not found

2015-12-09 00:53:36:836 - info: [debug] Stopping iOS log capture

2015-12-09 00:53:36:836 - error: undefined is not a function

2015-12-09 00:53:36:837 - info: [debug] Running ios sim reset flow
2015-12-09 00:53:36:838 - info: [debug] Killing the simulator process
2015-12-09 00:53:36:838 - info: [debug] Killing any other simulator daemons

2015-12-09 00:53:36:859 - error: Failed to start an Appium session, err was: TypeError: undefined is not a function

2015-12-09 00:53:36:858 - info: [debug] On a real device; cannot clean device state
2015-12-09 00:53:36:859 - info: [debug] Cleaning up appium session

2015-12-09 00:53:36:871 - info: [debug] TypeError: undefined is not a function
at getPathFromSymlink$ (lib/xcode.js:63:22)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/node_modules/appium-xcode/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/node_modules/appium-xcode/node_modules/babel-runtime/regenerator/runtime.js:294:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/node_modules/appium-xcode/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/node_modules/appium-xcode/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at bound (domain.js:254:14)
at GeneratorFunctionPrototype.runBound (domain.js:267:12)
at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/node_modules/appium-xcode/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/node_modules/appium-xcode/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:100:28
at process._tickDomainCallback (node.js:381:11)
2015-12-09 00:53:36:872 - info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: undefined is not a function)”,“origValue”:“undefined is not a function”},“sessionId”:null}
2015-12-09 00:53:36:874 - info: <-- POST /wd/hub/session 500 1850.126 ms - 176

2015-12-09 00:53:44:953 - info: --> GET /wd/hub/status {}

2015-12-09 00:53:44:953 - info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
2015-12-09 00:53:44:954 - info: <-- GET /wd/hub/status 200 0.984 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

Please help me out on this matter.

Regards
Jitu

Thank you for the help Milan, My Question is - Where do I paste this? In the termnial? - I’m a noob at this and appreciate your feedback

@PinLiang Thanks :slight_smile: works for me

Using local .zip from command line: /Applications/Appium 2.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip

Hello,

Actually I set up Android sdk and all that is required to test android app. But I click on the Doctor button following error is showing up, even though I select android panel.
I want to test my android app.

Running iOS Checks
:heavy_multiplication_x: Could not detect Mac OS X Version
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.