badoo / ios-device-server

A server to manage remote iOS simulators and devices for parallel testing
MIT License
44 stars 11 forks source link
ios test-automation

iOS Remote Device Server Build Status

A server for managing, booting, and controlling simulators and devices on remote host machines.

Features

Requirements

Java

Dependencies

Device Server uses fbsimctl, libimobiledevice and other tools under the hood.

To install dependencies run:

brew update
brew bundle

Simulators

It might take some time to build dependencies used for physical devices. You can skip it by running following instead:

brew update
brew bundle --file="homebrew/Brewfile"

Devices

Some of the dependencies needed for physical devices have outdated stable releases and have to be installed from the latest head.

After installing Brewfile you might still need to run

brew upgrade usbmuxd libimobiledevice --fetch-HEAD

Usage

Build and run Device Server

./bootstrap.sh
cd device-server
./run_device_server.sh

Allocate Device

curl -X POST -d '{"model":"iPhone 6", "headless":false}' http://localhost:4567/devices

Query Device Server

curl http://localhost:4567/status
curl http://localhost:4567/devices

Release device by reference

curl -X DELETE http://localhost:4567/devices/${DEVICE_REF}

Ruby sample

require 'ios-device-server-client/remote_device'

server_url = 'http://localhost:4567'

provider = IosDeviceServerClient::DeviceProvider.new(server_url)

rv = provider.create(model: 'iPhone 6', os: 'iOS 11.4', headless: false)
remote_device = IosDeviceServerClient::RemoteDevice.new(server_url, rv['ref'])

begin
  remote_device.await(timeout: 30)
  remote_device.open_url('https://github.com/badoo/ios-device-server')
  readline
ensure
  remote_device.release
end