node-simctl
ES6/7 Node wrapper around Apple's simctl
binary, the "Command line utility to control the iOS Simulator". simctl
is run as a sub-command of xcrun
Installation
Install through npm.
npm install node-simctl
Api
Exported methods:
installApp(udid, appPath)
udid
- the unique identifier of the simulator to which to install the applicationappPath
- the path to the application to be installed
removeApp(udid, bundleId)
udid
- the unique identifier of the simulator from which to remove the applicationbundleId
- the bundle identifier of the application (e.g.,com.corp.app
)
launch(udid, bundleId)
udid
- the unique identifier of the simulator on which to launch the appbundleId
- the bundle identifier of the application (e.g.,com.corp.app
)
openUrl(udid, url)
udid
- the unique identifier of the simulator on which to open the url (in safari)url
- the url to navigate to
shutdown(udid)
udid
- the unique identifier of the simulator to be stopped
createDevice(name, deviceType, runtime)
name
- any name you choose for this simulatordeviceType
- e.g.,"iPhone 6"
or"iPad Air"
, see more possibilities from the output ofgetDevices
runtime
- iOS sdk version. eg"8.3"
returns: udid
of the created simulator.
deleteDevice(udid)
udid
- the unique identifier of the simulator to be deleted
eraseDevice(udid)
udid
- the unique identifier of the simulator to be erased
getDevices()
output looks like:
spawn(udid, executablePath, env)
- spawns a process on the simulator specified by
udid
with given environment variable inenv
spawnSubProcess(udid, executablePath, env)
- spawns a process on the simulator specified by
udid
with given environment variable inenv
- returns a (SubProcess)[https://github.com/appium/node-teen_process#teen_processsubprocess] object.
getScreenshot(udid)
- returns a base64 png screenshot of device specified by
udid
Usage
See specs for examples of usage.