Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appium-ios-simulator

Package Overview
Dependencies
Maintainers
7
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appium-ios-simulator

Description goes here.

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
163K
decreased by-10.64%
Maintainers
7
Weekly downloads
 
Created
Source

appium-ios-simulator

NPM version Downloads Dependency Status devDependency Status

Build Status Coverage Status

Appium API for dealing with iOS simulators. Allows the user to find locations of directories and applications, gives access to settings in order to read from and write to simualtor plists, and allows control over starting and stopping simulators.

Usage

The appium-ios-simulator exports four utility functions: getSimulator, getDeviceString, killAllSimulators, and endAllSimulatorDaemons. All of these are async functions, returning promises.

async getSimulator(udid)

This is the main entry of this module. This function returns a simulator object (see below) associated with the udid passed in. If an iOS simulator with the given udid does not exist already on this machine, it will throw an error.

If you want to create a new simulator, you can use the createDevice() method of node-simctl.

import { getSimulator } from 'appium-ios-simulator';

let sim = await getSimulator('DAE95172-0788-4A85-8D0D-5C85509109E1');

async getDeviceString()

Takes a set of options and finds the correct device string in order for Instruments to identify the correct simulator. The options available are:

  • deviceName - a name for the device. If the given device name starts with =, the name, less the equals sign, is returned.
  • platformVersion - the version of iOS to use. Defaults to the current Xcode's maximum SDK version.
  • forceIphone - force the configuration of the device string to iPhone. Defaults to false.
  • forceIpad - force the configuration of the device string to iPad. Defaults to false. If both forceIphone and forceIpad are true, the device will be forced to iPhone.
import { getDeviceString } from 'appium-ios-simulator';

let deviceString = await getDeviceString({
  deviceName: 'iPhone 5',
  platformVersion: '8.4'
});
// 'iPhone 5 (8.4)' with Xcode 7+
// 'iPhone 5 (8.4 Simulator)' with Xcode 6+

async killAllSimulators()

Kills all running simulator processes.

import { killAllSimulators } from 'appium-ios-simulator';

await killAllSimulators();

async endAllSimulatorDaemons()

Kills all running simulator daemon processes.

import { endAllSimulatorDaemons } from 'appium-ios-simulator';

await endAllSimulatorDaemons();

async simExists(udid)

Returns true if a simulator with UDID exists on the host system. False otherwise.

import { simExists } from 'appium-ios-simulator';

await simExists('D94E4CD7-D412-4198-BCD4-26799672975E');
Simulator object

The simulator object encapsulates the differences between simulators on Xcode 6 and 7, the two versions Appium currently supports (see below for details). All settings updates require the simulator to not be "fresh", so that the directories and setting preference files are all created, and the simulator must not be running (or the changes will not take effect until the simulator is restarted).

constructor (udid, xcodeVersion)

Constructs the object with the udid and version of Xcode. Use the exported getSimulator(udid) method instead.

async getPlatformVersion ()

Retrieve the platform version for the particular simulator.

getRootDir ()

Retrieve the base directory for the simulator.

getLogDir ()

Retrieve the directory in which logs are stored for the simulator.

async getAppDir (id, subDir)

Retrieve the directory for a particular application's data.

  • id - the bundle id (for iOS 8+) or application name minus ".app" (for iOS 7.1).
  • subDir - the sub-directory we expect to be within the application directory. Defaults to "Data".

async cleanCustomApp (appFile, appBundleId)

Retrieve the directory for a particular application's data.

  • appFile - application name minus ".app" (for iOS 7.1).
  • appBudleId - the bundle id (for iOS 8+).

async stat ()

Retrieve state information about the simulator. Returns an object:

{ name: 'iPhone 4s',
  udid: 'C09B34E5-7DCB-442E-B79C-AB6BC0357417',
  state: 'Shutdown',
  sdk: '8.3'
}

async isFresh ()

Query whether the simulator has been run before.

async run ()

Starts the simulator without any Instruments involvement, or application running.

async clean ()

Stops and releases the simulator.

async launchAndQuit (safari)

Launches the simualator and runs a blank Instruments test on a test app, waits for the file system to be updated, and then shuts down.

  • safari - whether or not to launch the Safari simulator. Defaults to false.

async endSimulatorDaemon ()

Ends the process for the simulator daemon.

async shutdown ()

Shutdown the simulator.

async delete ()

Delete the simulator's directories.

async updateSettings (plist, updates)

Update the particular preference file with the given key/value pairs.

  • plist - the preferences file to update.
  • updates - the key/value pairs to update.

async updateLocationSettings (bundleId, authorized)

Authorize/de-authorize location settings for a particular application.

  • bundleId - the application to update.
  • authorized - whether or not to authorize.

async updateSafariSettings (updates)

Update the setting for Safari.

  • updates - a hash of key/value pairs to update for Safari.

async updateLocale (language, locale, calendarFormat)

Update the locale for the simulator.

  • language - the language for the simulator. E.g., "fr_US".
  • locale - the locale to set for the simulator. E.g., "en".
  • calendarFormat - the format of the calendar.

async deleteSafari ()

Delete the Safari application.

async cleanSafari (keepPrefs = true)

Clean up the directories for Safari.

static async getDeviceString (opts)

Static (class) method to get the particular device name string for Instruments to identify the device. Use exported getDeviceString method instead of this.

Xcode and iOS versions

See wikipedia for details of builds for Xcode versions.

iOSXcode 7.1 beta 3Xcode 7.0.1Xcode 6.4Xcode 6.3.2Xcode 6.2Xcode 6.1.1Xcode 6.0.1
7.111D167n/a11D16711D16711D16711D16711D167
8.0n/an/an/an/an/an/a12A365
8.112B41112B41112B41112B41112B41112B41112B411
8.212D50812D50812D50812D50812D508n/an/a
8.312F7012F7012F7012F6912F70n/an/a
8.412H14112H14112H14112H14112H141n/an/a
9.013A34413A340n/an/an/an/an/a
9.113B134n/an/an/an/an/an/a
file locations

iOS 9.1, 9.0, 8.4, 8.3

  • base
    • ~/Library/Developer/CoreSimulator/Devices/[identifier]/data/
  • safari plists
    • [base]/Containers/Data/Application/[identifier]/<.com.apple.mobile_container_manager.metadata.plist, com.apple.mobilesafari>
  • locationd cache plists
    • [base]/Library/Caches/locationd/cache.plist
    • [base]/Library/Preferences/com.apple.locationd.plist
  • locationd clients plists
    • [base]/Library/Caches/locationd/clients.plist
  • user settings plists
    • [base]/Library/ConfigurationProfiles/UserSettings.plist
    • [base]/Library/ConfigurationProfiles/EffectiveUserSettings.plist
    • [base]/Library/ConfigurationProfiles/PublicInfo/PublicEffectiveUserSettings.plist
  • other plists
    • [base]/Library/Preferences
  • logs
    • ~/Library/Logs/CoreSimulator/[identifier]/
    • sym linked to [base]/Library/Logs

iOS 7.1

  • base
    • ~/Library/Developer/CoreSimulator/Devices/[identifier]/data/
  • safari
    • [base]/Applications/[identifier]/Library/Preferences/com.apple.mobilesafari.plist
  • locationCache
    • [base]/Library/Caches/locationd/cache.plist
    • [base]/Library/Preferences/com.apple.locationd.plist
  • locationClients
    • [base]/Library/Caches/locationd/clients.plist
  • userSettings
    • [base]/Library/ConfigurationProfiles/UserSettings.plist
    • [base]/Library/ConfigurationProfiles/EffectiveUserSettings.plist
    • [base]/Library/ConfigurationProfiles/PublicInfo/PublicEffectiveUserSettings.plist
  • other plists
    • [base]/Library/Preferences
  • logs
    • ~/Library/Logs/CoreSimulator/[identifier]/
    • sym linked to [base]/Library/Logs

Keywords

FAQs

Package last updated on 24 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc