1 个不稳定版本
| 0.1.1 | 2021年1月5日 | 
|---|
#763 在 硬件支持
41 每月下载量
用于 5 个crates (2 直接)
63KB
 1.5K  SLoC
Simctl
此crate提供了一个安全包装,用于Xcode附带的功能 simctl。
🚨 重要:此库仅在Xcode已安装的情况下工作,并且目前仅与Xcode 12兼容。
示例
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()?;
操作
此crate目前支持以下操作。要获取原始CLI中所有可用操作的完整列表,请运行 xcrun simctl。
支持的操作
- boot
- get_app_container
- getenv
- install
- io screenshot
- keychain reset
- launch
- list
- openurl
- privacy
- push
- shutdown
- status_bar
- terminate
- ui
- uninstall
不支持的操作
- 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
依赖项
~0.7–1.4MB
~33K SLoC