Swiftpack.co - Package - mackoj/SimulatorControl

Bitrise Support

Being able to lift platform information in bitrise in order to simplify maintenance.

  • PLATFORM_LOOKUP_DEVICE_MODEL : Device model like iPad Air (3rd generation)
  • PLATFORM_LOOKUP_OS_VERSION : Runtime os version 13.3
  • PLATFORM_LOOKUP_DEVICE_UDID : Simulator device UDID 97FF12DC-7204-4066-A95E-A2B0E6FF4F62
  • PLATFORM_LOOKUP_PLATFORM : Platform parameter for xcodebuild iOS Simulator,name=iPad Air (3rd generation),OS=13.3
  • PLATFORM_LOOKUP_SIMULATOR_NAME : Simulator name iOS Simulator

It can use the same parameter as Cli.

swift sh <(curl https://raw.githubusercontent.com/mackoj/SimulatorControl/master/bitrisePlatformLookup.swift) iPhone

Cli 📟

You can use the cli to find the platform you need by passing the device name or juste the device family you can optionnaly set the os version you are looking for.

./cli iphone
iOS Simulator,name=iPhone 11 Pro Max,OS=13.3
./cli "iPad Air (3rd generation)"
iOS Simulator,name=iPad Air (3rd generation),OS=13.3
./cli watch
watchOS Simulator,name=Apple Watch Series 5 - 44mm,OS=6.1.1
./cli tv -v 13.3
tvOS Simulator,name=Apple TV 4K (at 1080p),OS=13.3

PlatformLookup 🔎

This package help to find/filter/sort all devices and runtimes available in xcrun simctl.

#!/usr/bin/swift sh

import Foundation
import PlatformLookup  // mackoj/SimulatorControl

func findDevicePlatform(_ args: [String]) throws {
  let platform = try PlatformLookup.findADeviceForLastOSVersion(.iPhone)
  let platformString = try PlatformLookup.format(
    platform,
    deviceFamily: .iPhone
  )
  print(platformString)
  exit(EXIT_SUCCESS)
}

do { try findDevicePlatform(CommandLine.arguments) }
catch {
  print(error.localizedDescription)
  exit(EXIT_FAILURE)
}

Shell 🐚

A Simple help to perform a shell command and pipe it's output.

shell("xcrun simctl list -j")

SimulatorControl 📲

This package is a representation of xcrun simctl devices and runtimes it act as a model here.

xcrun simctl list -j > simctl_device_list.json
let simctl = try JSONDecoder().decode(SimulatorControl.self, from: SimulatorControlJSONData)

Github

link
Stars: 0

Used By

Total: 0

Releases

0.9.3 - 2019-12-18 11:18:41

0.9.2 - 2019-12-18 10:57:05

0.9.1 - 2019-12-18 10:42:14

0.9.0 - 2019-12-17 15:52:05

Cli is now ready

0.8.1 - 2019-12-17 12:01:04

0.8.0 - 2019-12-14 18:00:21

0.3.0 - 2019-11-26 21:17:03

Add support for getting all platform info

0.2.1 - 2019-11-04 17:23:05

Fix visibility issue

0.2.0 - 2019-11-04 17:14:42

- 2019-11-04 16:38:46