Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

run-ios-sim

1.3.0 • Public • Published

run-ios-sim

build dependencies devDependencies

license npm version npm downloads Code Climate

Easy way to run the ios simulator.

Features

  • normalizeName(nameAndVersion, dontResolveLatest = false): Return a simulator name and version normalized
    • The nameAndVersion is name[@version] where @version is optional
      • If no @version is given @latest is assumed
      • @latest will be resolved via getLatestSdk
        • Use dontResolveLatest=true to disable this lookup
    • Example 1: normalizeName('ipadAIR') == { name: 'iPad Air', version: '9.2' }
    • Example 2: normalizeName('ipadAIR@latest') == normalizeName('ipadAIR')
    • Example 3: normalizeName('ipad@8') == { name: 'iPad', version: '8.0' }
  • getLatestSdk(): Returns the latest installed SDK version
  • getExistingSimulator(nameAndVersion): Check if there is a matching simulator
    • nameAndVersion will be resolved via normalizeName
  • run(appPath, nameAndVersion, opts = {}): Run your app on a simulator
    • Note: The returned promise will resolve once the simulator is stopped
    • appPath should be the full path to your .app folder
    • nameAndVersion will be resolved via normalizeName
    • Use opts to access more details:
      • onSimStart callback called with: udid
      • onSimStop callback called with: udid
      • onAppInstall callback called with: udid, appPath
      • onAppStart callback called with: udid, appPath, sku
      • onLogLine callback called with: line
  • getAppSku(appPath): Returns the sku/CFBundleIdentifier from a given appPath
  • ensureDevice(nameAndVersion): Ensures a matching simulator exists
  • getFirstSimulator(): Returns the first found simulator
    • Result is a object with name and version, similar to normalizeName

Run as binary

This package also contains a binary called run-ios-sim that calls the exposed run method. Here is a short example:

$ run-ios-sim ~/myAwsome.app iphone4s

Not that the second argument, nameAndVersion, will be resolved via normalizeName. So you can use iphone4s, iphone4s@latest, iphone6@8.1 or anything else.

Installation

npm install --save run-ios-sim

License

The MIT License (MIT)

Copyright (c) 2016 Michael Contento

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

none

install

npm i run-ios-sim

Downloadsweekly downloads

0

version

1.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability