Appium appium-doctor 有人试用过没?

恒温 · 2013年11月29日 · 816 次阅读

bin/appium-doctor.js


#!/usr/bin/env node
"use strict";
var ios = require('../lib/doctor/ios.js')
  , android = require('../lib/doctor/android.js')
  , common = require("../lib/doctor/common.js")
  , log = require('../lib/doctor/common.js').log
  , eol = require('os').EOL
  , async = require('async');

var argv = process.argv
  , doAndroid = argv.indexOf('--android') > -1
  , doIOS = argv.indexOf('--ios') > -1
  , verbose = argv.indexOf('--verbose') > -1;

if (!doIOS && !doAndroid) {
  doIOS = true;
  doAndroid = true;
}

var runiOSChecks = function(cb) {
  if (doIOS) {
    log.comment("Running iOS Checks");
    ios.runAllChecks(function(err) {
      if (!err) {
        log.pass("iOS Checks were successful." + eol);
        cb();
      } else {
        common.exitDoctor();
      }
    });
  }
};

var runAndroidChecks = function(cb) {
  if (doAndroid) {
    log.comment("Running Android Checks");
    android.runAllChecks(function(err) {
      if (!err) {
        log.pass("Android Checks were successful." + eol);
        cb();
      } else {
        common.exitDoctor();
      }
    });
  }
};

if (require.main === module) {
  async.series([
    runiOSChecks,
    runAndroidChecks
  ], function(err) {
    if (!err) {
      log.pass("All Checks were successful");
    } else {
      common.exitDoctor();
    }
  });
}

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册