Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
soda-x committed Jul 1, 2016
1 parent 51d42f9 commit 2021720
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 6 deletions.
10 changes: 8 additions & 2 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

---

## 0.1.7
## 1.0.0

- chore: fix can not open specify simulator because its status is creating, add method killAll
- refator
- more test cases
- remove bin and doctor

## 0.1.7

- chore: fix can not open specify simulator because its status is creating, add method killAll

## 0.1.6

Expand Down
93 changes: 91 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,98 @@ Use node.js to control iOS simulator
$ npm install node-isimulator --S
```

##
## Usage

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

### start - `async` function - return udid

```js
await start(options);
```

#### Configuration - default of start option

```js
{
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.

`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.
```js
{
'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](https://github.com/appium/appium-ios-simulator)

`simUtil.getSimulator(udid)`: `async func` [read](https://github.com/appium/appium-ios-simulator/blob/master/README.md)

`simUtil.killAllSimulators()`: `async func` [read](https://github.com/appium/appium-ios-simulator/blob/master/README.md)

`simUtil.endAllSimulatorDaemons()`: `async func` [read](https://github.com/appium/appium-ios-simulator/blob/master/README.md)

from [node-simctl](https://github.com/appium/node-simctl)

`simUtil.removeApp(udid, bundleId)`: `async func` [read](https://github.com/appium/node-simctl/blob/master/README.md)

`simUtil.createDevice(name, deviceType, runtime)`: `async func` [read](https://github.com/appium/node-simctl/blob/master/README.md)

`simUtil.deleteDevice(udid)`: `async func` [read](https://github.com/appium/node-simctl/blob/master/README.md)

`simUtil.getDevices()`: `async func` [read](https://github.com/appium/node-simctl/blob/master/README.md)

`simUtil.openUrl(udid, url)`: `async func` [read](https://github.com/appium/node-simctl/blob/master/README.md)

`simUtil.launch(udid, bundleId)`: `async func` [read](https://github.com/appium/node-simctl/blob/master/README.md)

`simUtil.installApp(udid, appPath)`: `async func` [read](https://github.com/appium/node-simctl/blob/master/README.md)

## LISENCE

Copyright (c) 2015-2114 pigcan. Licensed under the MIT license.
Copyright (c) 2016-2114 pigcan. Licensed under the MIT license.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-isimulator",
"version": "0.1.7",
"version": "1.0.0",
"description": "use node.js to control iOS simulator",
"main": "./lib/index.js",
"scripts": {
Expand Down Expand Up @@ -51,5 +51,10 @@
"mocha": "^2.5.3",
"rimraf": "^2.5.2",
"sample-apps": "^2.0.4"
}
},
"files": [
"lib",
"package.json",
"README.md"
]
}

0 comments on commit 2021720

Please sign in to comment.