1.3.0 • Published 10 years ago
run-ios-sim v1.3.0
run-ios-sim
Easy way to run the ios simulator.
Features
normalizeName(nameAndVersion, dontResolveLatest = false): Return a simulator name and version normalized- The
nameAndVersionisname[@version]where@versionis optional- If no
@versionis given@latestis assumed @latestwill be resolved viagetLatestSdk- Use
dontResolveLatest=trueto disable this lookup
- Use
- If no
- 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' }
- The
getLatestSdk(): Returns the latest installed SDK versiongetExistingSimulator(nameAndVersion): Check if there is a matching simulatornameAndVersionwill be resolved vianormalizeName
run(appPath, nameAndVersion, opts = {}): Run your app on a simulator- Note: The returned promise will resolve once the simulator is stopped
appPathshould be the full path to your.appfoldernameAndVersionwill be resolved vianormalizeName- Use
optsto access more details:onSimStartcallback called with:udidonSimStopcallback called with:udidonAppInstallcallback called with:udid, appPathonAppStartcallback called with:udid, appPath, skuonLogLinecallback called with:line
getAppSku(appPath): Returns the sku/CFBundleIdentifier from a givenappPathensureDevice(nameAndVersion): Ensures a matching simulator existsgetFirstSimulator(): Returns the first found simulator- Result is a object with
nameandversion, similar tonormalizeName
- Result is a object with
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 iphone4sNot 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-simLicense
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.