#xcode #wrapper #creator

creator-simctl

Rust wrapper around Xcode’s simctl

1 unstable release

0.1.1 Jan 5, 2021
Download history 13/week @ 2022-11-27 19/week @ 2022-12-04 28/week @ 2022-12-11 28/week @ 2022-12-18 16/week @ 2022-12-25 14/week @ 2023-01-01 20/week @ 2023-01-08 9/week @ 2023-01-15 27/week @ 2023-01-22 41/week @ 2023-01-29 14/week @ 2023-02-05 12/week @ 2023-02-12 59/week @ 2023-02-19 4/week @ 2023-02-26 27/week @ 2023-03-05 10/week @ 2023-03-12

104 downloads per month
Used in 3 crates (via creator-tools)

MIT license

63KB
1.5K SLoC

Simctl

Built Status crates.io Docs.rs

This crate provides a safe wrapper around the simctl utility that ships with Xcode.


🚨 Important: this library only works if Xcode is installed and currently only works with Xcode 12.


Example

use simctl::{Simctl, DeviceQuery};

let simctl = Simctl::new();
let device = simctl.list()?.devices().iter()
    .available()
    .by_name("iPhone SE (2nd generation)")
    .next().unwrap();
let _ = device.boot();
device.launch("com.apple.mobilesafari").exec()?;
let image = device.io().screenshot(
    simctl::io::ImageType::Png,
    simctl::io::Display::Internal,
    simctl::io::Mask::Ignored,
)?;
device.shutdown()?;

Operations

The following operations are currently supported by this crate. For a full list of operations that are available in the original CLI, run xcrun simctl.

Supported Operations

  • boot
  • get_app_container
  • getenv
  • install
  • io screenshot
  • keychain reset
  • launch
  • list
  • openurl
  • privacy
  • push
  • shutdown
  • status_bar
  • terminate
  • ui
  • uninstall

Unsupported Operations

  • addmedia
  • clone
  • create
  • delete
  • diagnose
  • erase
  • icloud_sync
  • install_app_data
  • io enumerate
  • io poll
  • io recordVideo
  • keychain add-cert
  • keychain add-root-cert
  • logverbose
  • pair
  • pair_activate
  • pbcopy
  • pbpaste
  • pbsync
  • rename
  • spawn
  • unpair
  • upgrade

Dependencies

~1–1.7MB
~41K SLoC