Coder Social home page Coder Social logo

ios-device-server's Introduction

iOS Remote Device Server Build Status

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

Features

  • Enables control of simulators and devices connected to remote host machines
  • Enables tests to run using remote simulators and devices
  • Enables custom actions on simulators like clearing safari cookies or fast reset of a simulator
  • Hides away satisfying desired capabilities, i.e. based on requested model or os will choose an appropriate host to create a simulator

Requirements

Java

  • Download and install Java SDK 10
  • set environment variable JAVA_HOME
export JAVA_HOME=$(/usr/libexec/java_home -v 10 -F)

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
  • command line utility will be published soon

ios-device-server's People

Contributors

dependabot[bot] avatar fr0l avatar maxciv avatar nickab avatar sergey-plevako-badoo avatar sleekweasel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-device-server's Issues

error: SWIFT_VERSION '3.0' is unsupported when running ./bootstrap.sh

Hello!
After running

brew update 
brew bundle --file="homebrew/Brewfile" 
brew upgrade usbmuxd libimobiledevice --fetch-HEAD

I run
./bootstrap.sh
and get error about unsupported swift version.
How I can fix it?

Ilyas-MacBook-Pro:ios-device-server-master ilyamakarevich$ ./bootstrap.sh
Building fbsimctl...
/var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/tmp.aUygFi2R ~/ios-device-server-master
Checking out https://github.com/facebook/FBSimulatorControl.git#ec54965 at /var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/tmp.aUygFi2R
Cloning into '/var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/tmp.aUygFi2R'...
remote: Enumerating objects: 1065, done.
remote: Counting objects: 100% (1065/1065), done.
remote: Compressing objects: 100% (947/947), done.
remote: Total 39394 (delta 224), reused 378 (delta 110), pack-reused 38329
Receiving objects: 100% (39394/39394), 88.24 MiB | 8.57 MiB/s, done.
Resolving deltas: 100% (29739/29739), done.
Note: checking out 'ec54965'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at ec54965b remove deprecated .characters
Building fbsimctl to /var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/tmp.aUygFi2R/build
using target fbsimctl
using command build
using output directory /var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/tmp.aUygFi2R/build
/usr/local/bin/carthage
/var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/tmp.aUygFi2R/fbsimctl /var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/tmp.aUygFi2R
Please update to the latest Carthage version: 0.34.0. You currently are on 0.33.0
*** Checking out GCDWebServer at "3.3.3"
*** xcodebuild output can be found in /var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/carthage-xcodebuild.qflx6s.log
*** Building scheme "GCDWebServers (Mac)" in GCDWebServer.xcodeproj
/var/folders/t7/typpx7mn1lxdt8kd5p2pr9zc0000gn/T/tmp.aUygFi2R

โŒ  error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'FBSimulatorControlKit' from project 'fbsimctl')


** BUILD FAILED **

Ilyas-MacBook-Pro:ios-device-server-master ilyamakarevich$ 

Thanks!

Adapt ios-device-server for use with native Swift XCUI tests

Hi!
I am currently working on running iOS UI tests in parallel on multiple computers and I found your ios-device-server, but I do not need to use WebDriverAgent or even fbsimctl. My tests are written in Swift and kif-framework is used, I just need to build-for-test my app, upload it and file.xctestrun to host with simulators and run the tests like this:
xcodebuild test-without-building -xctestrun ./ui-tests-scheme_iphonesimulator12.1-x86_64.xctestrun -destination "platform=iOS Simulator,id=C701D686-219A-475B-AB98-0BC4A9451CDF,OS=12.1" -only-testing:ui-tests/SomeTest1

This command boots the simulator if it's shutdown, installs the app, runs test in headless mode and shutdown the simulator. It remains only to erase the simulator's data (xcrun simctl erase C701D686-219A-475B-AB98-0BC4A9451CDF) and the simulator ready to run next test.

I can modify your ios-device-server to fit my needs, but how easy will it be to get rid of WebDriverAgent and fbsimctl in programm logic and what's the best way to do that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.