npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-isimulator

v1.1.0

Published

use node.js to control iOS simulator

Downloads

8

Readme

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.