1.1.0 • Published 8 years ago

node-isimulator v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

node-isimulator

Greenkeeper badge

NPM version Build Status Coverage Status NPM downloads Dependency Status

Use node.js to control iOS simulator


Install

$ npm install node-isimulator --S

Usage

import start, { simUtil } from 'node-isimulator';

start - async function - return udid

await start(options);

Configuration - default of start option

{
  prefix: 'ns',
  sdk: '',
  device: 'iPhone 6',
  application: 'mobilesafari',
  bundleId: '',
  downloadURL: '',
  scheme: '',
}

prefix: prefix of simulator name, e.g. ${prefix}sim--${device}-${sdk} => nssim--iPhone-6--9-2

sdk: runtime version, defualt latest

device: device type, defualt iPhone 6. e.g. iPhone 5s / iPhone 6s Plus

application: device should open which application, defualt mobilesafari. e.g. yourAppName

bundleId: application bundleId

downloadURL: application's path, it could be a url or relative/absolute path.

scheme: application's scheme. e.g. http://domain.com / taobao://xxxx / alipay://xxxx

simUtil - simulator util object

simUtil.chalkError: eroor log util. e.g. console.log(simUtil.chalkError('error'));

simUtil.chalkInfo: info log util. e.g. console.log(simUtil.chalkInfo('info'));

simUtil.chalkWarning: warning log util. e.g. console.log(simUtil.chalkWarning('warning'));

simUtil.chalkProcessing: processing log util. e.g. console.log(simUtil.chalkProcessing('process'));


simUtil.isExistedADir(string): is existed a dir named ${name}. e.g. simUtil.isExistedADir('xx'), return true or false.

simUtil.isURL(string): is url or not. return true or false. e.g. http://m.x.com

simUtil.isScheme(string): is scheme or not. return true or false. tb://xxxx/xxxx

simUtil.downAppFromUrl(url): async func download zip file from internet then decompress in local tmp path and return the local tmp path.

simUtil.getBootedDeviceString(): async func get booted devicestring. e.g.

{
  'C09B34E5-7DCB-442E-B79C-AB6BC0357417': {
    name: 'iPhone 4s',
    sdk: '9.2'
    state: 'Booted',
  },
}

simUtil.isInstalledAppNamed(udid, bundleId): async func check the device which udid is ${udid} is installed an application which bundleId is ${bundleId}, return true or false.

simUtil.getLatestSDK(): async func get the latest sdk. e.g. 9.3

simUtil.getUdidBySimName(string): async func get device udid named ${string}


from appium-ios-simulator

simUtil.getSimulator(udid): async func read

simUtil.killAllSimulators(): async func read

simUtil.endAllSimulatorDaemons(): async func read

from node-simctl

simUtil.removeApp(udid, bundleId): async func read

simUtil.createDevice(name, deviceType, runtime): async func read

simUtil.deleteDevice(udid): async func read

simUtil.getDevices(): async func read

simUtil.openUrl(udid, url): async func read

simUtil.launch(udid, bundleId): async func read

simUtil.installApp(udid, appPath): async func read

LISENCE

Copyright (c) 2016-2114 pigcan. Licensed under the MIT license.

1.1.0

8 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago