diff --git a/Cargo.toml b/Cargo.toml index 6ab2a59..07e0499 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,7 @@ idevice = { version = "=0.1.68", default-features = false, features = [ "core_device", "display_stream", "cryptexd", + "mobile_image_mounter", "tss", "installation_proxy", "springboardservices", diff --git a/apps/iphone-control/src/debug.rs b/apps/iphone-control/src/debug.rs index 4d93833..0f67328 100644 --- a/apps/iphone-control/src/debug.rs +++ b/apps/iphone-control/src/debug.rs @@ -103,13 +103,17 @@ fn check(step: &str, t0: Instant, ok: bool, detail: String) -> anyhow::Result<() } } -async fn e2e(device: &Device, bundle_id: &str, out: &std::path::Path) -> anyhow::Result<()> { +async fn e2e(device: &Device, legacy_ddi: bool, bundle_id: &str, out: &std::path::Path) -> anyhow::Result<()> { let t = Instant::now(); let mut tunnel = device.open_tunnel().await?; check(ictl_l10n::tr!("建隧道", "open tunnel"), t, true, String::new())?; let t = Instant::now(); - let ddi = tunnel.ddi_mounted().await?; + let ddi = if legacy_ddi { + device.legacy_ddi_mounted().await?.then(|| "personalized".to_owned()) + } else { + tunnel.ddi_mounted().await? + }; check( ictl_l10n::tr!("开发者镜像", "developer disk image"), t, @@ -219,8 +223,16 @@ pub async fn run(udid: Option<&str>, args: DebugArgs) -> anyhow::Result<()> { let screen = ScreenSize { width: args.width, height: args.height }; match args.check { Check::Ddi { restore_dir, url } => { + // iOS 17–18: the classic personalized image through mobile_image_mounter, in `/personalized` + let legacy = ictl_device::ddi::legacy(info.major_version()); + let files = ictl_device::ddi::files_for(legacy); let mut t = device.open_tunnel().await?; - match t.ddi_mounted().await? { + let mounted = if legacy { + device.legacy_ddi_mounted().await?.then(|| "personalized".to_owned()) + } else { + t.ddi_mounted().await? + }; + match mounted { Some(v) => println!( "{}", ictl_l10n::trf!( @@ -229,9 +241,20 @@ pub async fn run(udid: Option<&str>, args: DebugArgs) -> anyhow::Result<()> { ) ), None => { - let dir = ictl_device::ddi::ensure_cache(&restore_dir, &url).await?; let t0 = Instant::now(); - let v = t.mount_ddi(&dir).await?; + let v = if legacy { + let dir = ictl_device::ddi::ensure_cache( + &restore_dir.join("personalized"), + &ictl_device::ddi::personalized_url(&url), + files, + ) + .await?; + device.mount_legacy_ddi(&dir).await?; + "personalized".to_owned() + } else { + let dir = ictl_device::ddi::ensure_cache(&restore_dir, &url, files).await?; + t.mount_ddi(&dir).await? + }; println!( "{}", ictl_l10n::trf!( @@ -242,6 +265,7 @@ pub async fn run(udid: Option<&str>, args: DebugArgs) -> anyhow::Result<()> { ); } } + t.close().await; let t = device.open_tunnel().await?; println!("universalhidservice: {}", t.has_service("com.apple.coredevice.hid.universalhidservice")); } @@ -477,7 +501,7 @@ pub async fn run(udid: Option<&str>, args: DebugArgs) -> anyhow::Result<()> { } Check::E2e { bundle_id, out } => { let t0 = Instant::now(); - e2e(&device, &bundle_id, &out).await?; + e2e(&device, ictl_device::ddi::legacy(info.major_version()), &bundle_id, &out).await?; println!( "{}", ictl_l10n::trf!("全部通过,总耗时 {:.1}s", "All passed in {:.1}s", t0.elapsed().as_secs_f64()) diff --git a/crates/ictl-daemon/src/config.rs b/crates/ictl-daemon/src/config.rs index f4d90f0..dca4f38 100644 --- a/crates/ictl-daemon/src/config.rs +++ b/crates/ictl-daemon/src/config.rs @@ -151,6 +151,11 @@ impl Config { pub fn ddi_cache(&self) -> PathBuf { self.data_dir.join("ddi") } + /// The cache of the image a phone takes: `ddi/personalized/` for the classic personalized image (iOS 17–18), + /// `ddi/` for the cryptex one + pub fn ddi_cache_for(&self, legacy: bool) -> PathBuf { + if legacy { self.ddi_cache().join("personalized") } else { self.ddi_cache() } + } /// 旧版本的锁屏密码:只有一份,不知道是哪台设备的。USB 上只接着一台时归到那台名下(见 /// [`crate::core::Daemon::adopt_legacy_passcode`]),接着多台时不用,免得把一台的密码输进另一台 pub fn legacy_passcode_file(&self) -> PathBuf { diff --git a/crates/ictl-daemon/src/supervise.rs b/crates/ictl-daemon/src/supervise.rs index 1dc9a5b..6564cb2 100644 --- a/crates/ictl-daemon/src/supervise.rs +++ b/crates/ictl-daemon/src/supervise.rs @@ -446,7 +446,9 @@ impl Daemon { if !matches!(g.state, DeviceState::Preparing { .. }) { self.set_state(g, DeviceState::Preparing { last_error: None }); } - let (cache, url, user_dir) = (self.cfg.ddi_cache(), self.cfg.ddi_url.clone(), self.cfg.ddi_dir.clone()); + let legacy = ictl_device::ddi::legacy(g.info.as_ref().map_or(0, |i| i.major_version())); + let (cache, url, user_dir) = + (self.cfg.ddi_cache_for(legacy), self.cfg.ddi_url.clone(), self.cfg.ddi_dir.clone()); // a WDA launched in the background before (WDA control earlier): not wanted now, ended once the image is up // (AppService needs it) let known = g.persisted.detached_for(&device.udid); @@ -455,7 +457,7 @@ impl Daemon { g.preparing = Some(tokio::task::spawn_local(then_wake(wake, async move { let _lease = lease; let mut t = device.open_tunnel().await.map_err(|e| (e, false))?; - let r = ensure_ddi(&mut t, &cache, &url, user_dir.as_deref()).await; + let r = ensure_ddi(&device, &mut t, legacy, &cache, &url, user_dir.as_deref()).await; let stopped = match (&r, known) { (Ok(_), Some(pid)) => Some((device.udid.clone(), detached::stop(&mut t, pid).await)), _ => None, @@ -517,7 +519,9 @@ impl Daemon { g.dev.ddi_failures += 1; if g.dev.ddi_failures >= DDI_FAILURES_INVALIDATE { self.log.log(&ictl_l10n::log_trf!("开发者镜像连续 {} 次挂载失败,清掉缓存,下次重新下载", "Mounting the developer disk image failed {} times in a row, clearing the cache to download it again", g.dev.ddi_failures)); - ictl_device::ddi::invalidate(&self.cfg.ddi_cache()); + // the cache of the image this phone takes (the classic personalized one on iOS 17–18) + let legacy = ictl_device::ddi::legacy(g.info.as_ref().map_or(0, |i| i.major_version())); + ictl_device::ddi::invalidate(&self.cfg.ddi_cache_for(legacy), ictl_device::ddi::files_for(legacy)); g.dev.ddi_failures = 0; } } @@ -606,7 +610,9 @@ impl Daemon { "The background WDA on the phone (pid {pid}) was launched by an older version and listens on every interface of the phone: launching it again, listening on the phone's loopback only" )); } - let (cache, url, user_dir) = (self.cfg.ddi_cache(), self.cfg.ddi_url.clone(), self.cfg.ddi_dir.clone()); + let legacy = ictl_device::ddi::legacy(g.info.as_ref().map_or(0, |i| i.major_version())); + let (cache, url, user_dir) = + (self.cfg.ddi_cache_for(legacy), self.cfg.ddi_url.clone(), self.cfg.ddi_dir.clone()); let Ok(lease) = crate::maintenance::shared() else { return }; let wake = self.wake.clone(); g.starting = Some(tokio::task::spawn_local(then_wake(wake, async move { @@ -617,9 +623,15 @@ impl Daemon { type Ready = (Option, Result, Option); let ddi: Result = async { let mut t = device.open_tunnel().await.map_err(|e| (e, false))?; - let r = ensure_ddi(&mut t, &cache, &url, user_dir.as_deref()).await; + let r = ensure_ddi(&device, &mut t, legacy, &cache, &url, user_dir.as_deref()).await; let r = match r { Ok(m) => { + if m.is_some() { + // a tunnel opened before the image was mounted doesn't list its services + // (dtservicehub): a new one, so WDA starts on the first attempt + t.close().await; + t = device.open_tunnel().await.map_err(|e| (e, false))?; + } // 后台启动前先开系统日志流:认「Enable UI Automation」密码框靠它(见 WdaRunner::attach) let log = open_log(&device).await; Ok((m, prepare_detached(&mut t, known, &bundle).await, log)) @@ -1055,21 +1067,34 @@ fn now_secs() -> u64 { } /// 手机重启后开发者镜像可能掉了:没挂就挂上(返回挂上的版本),已挂载时只是一次查询。 -/// 错误带上「是不是挂载这一步」(才可能是缓存坏了) +/// 错误带上「是不是挂载这一步」(才可能是缓存坏了)。`legacy`: iOS 17–18 (see [`ictl_device::ddi::legacy`]), `cache` is that +/// image's cache; cryptexd isn't asked on that path async fn ensure_ddi( + device: &Device, t: &mut Tunnel, + legacy: bool, cache: &std::path::Path, url: &str, user_dir: Option<&std::path::Path>, ) -> Result, (DeviceError, bool)> { - if t.ddi_mounted().await.map_err(|e| (e, false))?.is_some() { + if legacy { + if device.legacy_ddi_mounted().await.map_err(|e| (e, false))? { + return Ok(None); + } + } else if t.ddi_mounted().await.map_err(|e| (e, false))?.is_some() { return Ok(None); } + let files = ictl_device::ddi::files_for(legacy); let dir = match user_dir { - Some(d) => ictl_device::ddi::require_complete(d), - None => ictl_device::ddi::ensure_cache(cache, url).await, + Some(d) => ictl_device::ddi::require_complete(d, files), + None if legacy => ictl_device::ddi::ensure_cache(cache, &ictl_device::ddi::personalized_url(url), files).await, + None => ictl_device::ddi::ensure_cache(cache, url, files).await, } .map_err(|e| (e, false))?; + if legacy { + device.mount_legacy_ddi(&dir).await.map_err(|e| (e, true))?; + return Ok(Some("personalized".to_owned())); + } Ok(Some(t.mount_ddi(&dir).await.map_err(|e| (e, true))?)) } diff --git a/crates/ictl-device/src/ddi.rs b/crates/ictl-device/src/ddi.rs index 50a57a7..a0def74 100644 --- a/crates/ictl-device/src/ddi.rs +++ b/crates/ictl-device/src/ddi.rs @@ -15,17 +15,42 @@ pub const DEFAULT_BASE_URL: &str = pub const FILES: [&str; 5] = ["BuildManifest.plist", "Image.dmg", "Image.dmg.trustcache", "Image.dmg.cryptex_info", "Image.dmg.root_hash"]; +/// iOS 17–18: the classic personalized image (mounted through `mobile_image_mounter`), next to the cryptex one +/// in the same upstream repository +pub const PERSONALIZED_FILES: [&str; 3] = ["BuildManifest.plist", "Image.dmg", "Image.dmg.trustcache"]; + +/// Whether a phone takes the classic personalized image through mobile_image_mounter: iOS 17–18 (Apple went from +/// 18 to 26; iOS 26 and later mount the cryptex image through cryptexd). 0 = version unreadable: cryptexd, as before +pub fn legacy(major: u32) -> bool { + (1..26).contains(&major) +} + +/// The files of the image the phone takes (see [`legacy`]) +pub fn files_for(legacy: bool) -> &'static [&'static str] { + if legacy { &PERSONALIZED_FILES } else { &FILES } +} + +/// Where the classic personalized image is downloaded from: the `Xcode_iOS_DDI_Personalized` directory next to +/// the cryptex one (`ICTL_DDI_URL` points at a mirror of the upstream layout) +pub fn personalized_url(base_url: &str) -> String { + let base = base_url.trim_end_matches('/'); + match base.rsplit_once('/') { + Some((parent, _)) if !parent.ends_with(":/") => format!("{parent}/Xcode_iOS_DDI_Personalized"), + _ => base.to_owned(), + } +} + /// 记录缓存来自哪个下载地址:换了地址就整套重新下载,免得新旧文件混在一起 const SOURCE_STAMP: &str = ".source"; /// 缓存是否完整 -pub fn cache_complete(dir: &Path) -> bool { - FILES.iter().all(|f| dir.join(f).is_file()) +pub fn cache_complete(dir: &Path, files: &[&str]) -> bool { + files.iter().all(|f| dir.join(f).is_file()) } /// 用户自己提供的目录(`ICTL_DDI_DIR`):不下载、不改动,只检查文件齐不齐 -pub fn require_complete(dir: &Path) -> Result { - let missing: Vec<&str> = FILES.iter().copied().filter(|f| !dir.join(f).is_file()).collect(); +pub fn require_complete(dir: &Path, files: &[&str]) -> Result { + let missing: Vec<&str> = files.iter().copied().filter(|f| !dir.join(f).is_file()).collect(); if missing.is_empty() { return Ok(dir.to_owned()); } @@ -41,15 +66,15 @@ pub fn require_complete(dir: &Path) -> Result { } /// 删掉缓存(挂载反复失败时调用,下次重新下载)。只用于守护进程自己下载的缓存目录 -pub fn invalidate(dir: &Path) { - for f in FILES.iter().chain([&SOURCE_STAMP]) { +pub fn invalidate(dir: &Path, files: &[&str]) { + for f in files.iter().chain([&SOURCE_STAMP]) { let _ = std::fs::remove_file(dir.join(f)); } } /// 确保 `dir` 里有完整的 DDI,缺的从 `base_url` 下载;返回该目录。 /// 下载先写临时文件再改名,中途失败不会留下半个文件。 -pub async fn ensure_cache(dir: &Path, base_url: &str) -> Result { +pub async fn ensure_cache(dir: &Path, base_url: &str, files: &[&str]) -> Result { let stamp = std::fs::read_to_string(dir.join(SOURCE_STAMP)).ok(); if stamp.as_deref().is_some_and(|s| s.trim() != base_url) { tracing::info!( @@ -59,9 +84,9 @@ pub async fn ensure_cache(dir: &Path, base_url: &str) -> Result { "The developer disk image download URL changed, downloading again" ) ); - invalidate(dir); + invalidate(dir, files); } - if cache_complete(dir) { + if cache_complete(dir, files) { if stamp.is_none() { // 早期版本下载的缓存没有记录来源:认作当前地址 let _ = std::fs::write(dir.join(SOURCE_STAMP), base_url); @@ -73,7 +98,7 @@ pub async fn ensure_cache(dir: &Path, base_url: &str) -> Result { .timeout(std::time::Duration::from_secs(600)) .build() .map_err(|e| DeviceError::Download(e.to_string()))?; - for name in FILES { + for &name in files { let dest = dir.join(name); if dest.is_file() { continue; @@ -106,14 +131,41 @@ mod tests { for f in &FILES[..4] { std::fs::write(dir.join(f), b"x").unwrap(); } - assert!(!cache_complete(&dir)); + assert!(!cache_complete(&dir, &FILES)); std::fs::write(dir.join(FILES[4]), b"x").unwrap(); - assert!(cache_complete(&dir)); - assert!(require_complete(&dir).is_ok()); - invalidate(&dir); - assert!(!cache_complete(&dir)); - let e = require_complete(&dir).unwrap_err().to_string(); + assert!(cache_complete(&dir, &FILES)); + assert!(require_complete(&dir, &FILES).is_ok()); + invalidate(&dir, &FILES); + assert!(!cache_complete(&dir, &FILES)); + let e = require_complete(&dir, &FILES).unwrap_err().to_string(); assert!(e.contains("BuildManifest.plist") && e.contains("Image.dmg.root_hash"), "{e}"); std::fs::remove_dir_all(&dir).unwrap(); } + + #[test] + fn only_ios_17_and_18_take_the_personalized_image_with_its_three_files_next_to_the_cryptex_one() { + let dir = std::env::temp_dir().join(format!("ictl-ddi-personalized-test-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + for f in &PERSONALIZED_FILES[..2] { + std::fs::write(dir.join(f), b"x").unwrap(); + } + let e = require_complete(&dir, &PERSONALIZED_FILES).unwrap_err().to_string(); + assert!(e.contains("Image.dmg.trustcache") && !e.contains("cryptex_info"), "{e}"); + std::fs::write(dir.join(PERSONALIZED_FILES[2]), b"x").unwrap(); + assert!(cache_complete(&dir, &PERSONALIZED_FILES) && !cache_complete(&dir, &FILES)); + std::fs::remove_dir_all(&dir).unwrap(); + assert_eq!( + personalized_url(DEFAULT_BASE_URL), + "https://raw.githubusercontent.com/doronz88/DeveloperDiskImage/main/PersonalizedImages/Xcode_iOS_DDI_Personalized" + ); + assert_eq!(personalized_url("https://mirror.example"), "https://mirror.example"); + assert!(legacy(17) && legacy(18)); + assert!(!legacy(26) && !legacy(27) && !legacy(0)); + assert_eq!(files_for(true), PERSONALIZED_FILES); + assert_eq!(files_for(false), FILES); + assert_eq!( + personalized_url("https://mirror.example/ddi/Xcode_iOS_DDI_Cryptex/"), + "https://mirror.example/ddi/Xcode_iOS_DDI_Personalized" + ); + } } diff --git a/crates/ictl-device/src/lib.rs b/crates/ictl-device/src/lib.rs index 8b3af1d..243b659 100644 --- a/crates/ictl-device/src/lib.rs +++ b/crates/ictl-device/src/lib.rs @@ -36,6 +36,7 @@ use idevice::{ installation_proxy::InstallationProxyClient, lockdown::LockdownClient, misagent::MisagentClient, + mobile_image_mounter::ImageMounter, provider::{IdeviceProvider, UsbmuxdProvider}, rsd::RsdHandshake, springboardservices::{InterfaceOrientation, SpringBoardServicesClient}, @@ -149,7 +150,8 @@ pub(crate) async fn limit(what: &str, d: Duration, f: impl Future for DeviceError { fn from(e: IdeviceError) -> Self { match e { - IdeviceError::PasswordProtected => Self::PasswordProtected, + // lockdown says PasswordProtected, mobile_image_mounter DeviceLocked + IdeviceError::PasswordProtected | IdeviceError::DeviceLocked => Self::PasswordProtected, IdeviceError::DeviceNotFound => Self::NotConnected, IdeviceError::InvalidHostID => Self::NotPaired, IdeviceError::PairingDialogResponsePending => Self::PairingPending, @@ -424,6 +426,49 @@ impl Device { .await } + /// iOS 17–18: whether the classic personalized image is mounted (by us, Xcode or `devicectl`). A locked phone + /// or a dropped connection is an error, not «not mounted» + pub async fn legacy_ddi_mounted(&self) -> Result { + limit(ictl_l10n::tr!("查询开发者镜像", "query the developer disk image"), QUERY, async { + let mut mounter = ImageMounter::connect(&*self.provider).await?; + match mounter.lookup_image("Personalized").await { + Ok(_) => Ok(true), + Err(IdeviceError::NotFound) => Ok(false), + Err(e) => Err(e.into()), + } + }) + .await + } + + /// iOS 17–18: mounts the classic personalized image from `dir` ([`ddi::PERSONALIZED_FILES`], checked by the + /// caller) through lockdown's `mobile_image_mounter` (cryptexd stalls there) + pub async fn mount_legacy_ddi(&self, dir: &std::path::Path) -> Result<()> { + let (image, trustcache, manifest) = ( + tokio::fs::read(dir.join("Image.dmg")).await?, + tokio::fs::read(dir.join("Image.dmg.trustcache")).await?, + tokio::fs::read(dir.join("BuildManifest.plist")).await?, + ); + limit(ictl_l10n::tr!("挂载开发者镜像", "mount the developer disk image"), Duration::from_secs(180), async { + // the chip id from a lockdown session closed before the mounter connects: idevice's ImageMounter note + // wants any lockdown session opened after the mounter (mount_personalized opens its own) + let ecid = { + let mut lockdown = LockdownClient::connect(&*self.provider).await?; + // asked without a session, lockdown may answer GetProhibited + let pairing = idevice::provider::IdeviceProvider::get_pairing_file(&*self.provider).await?; + lockdown.start_session(&pairing).await?; + lockdown + .get_value(Some("UniqueChipID"), None) + .await? + .as_unsigned_integer() + .ok_or_else(|| DeviceError::Idevice("the phone gave no UniqueChipID".into()))? + }; + let mut mounter = ImageMounter::connect(&*self.provider).await?; + mounter.mount_personalized(&*self.provider, image, trustcache, &manifest, None, ecid).await?; + Ok(()) + }) + .await + } + /// 名称、型号、iOS 版本(不需要配对) pub async fn info(&self) -> Result { limit(ictl_l10n::tr!("读设备信息", "read device info"), QUERY, self.info_inner()).await diff --git a/docs/dev/regression-cases.md b/docs/dev/regression-cases.md index 38823a2..023a4a4 100644 --- a/docs/dev/regression-cases.md +++ b/docs/dev/regression-cases.md @@ -174,3 +174,4 @@ | 168 | 后台启动 WDA 不带环境变量,WDA 不设 `USE_IP` 时在手机的所有网卡上监听:手机连着 Wi-Fi 时,局域网里谁都能经 8100(没有认证)操作手机、经 9100 看画面 | 后台启动和 XCTest 启动都带 `USE_IP=127.0.0.1`;`state.json` 的 `loopback_wdas` 记下这样启动的进程,旧版本启动的(不在里面)不再接上而是重新启动 | 单测 `the_launch_environment_is_a_dictionary_of_strings`、`only_a_loopback_only_background_wda_is_attached_to_again` + 真机(USB 上 WDA 就绪、工具和控制台 MJPEG 画面照常;手机连 Wi-Fi 时从局域网另一台机器 `curl http://<手机IP>:8100/status`、`:9100` 连不上;升级前已在运行的后台 WDA 被重新启动) | | 169 | 事件日志、「上次重签」、重签完成的到期时间按 UTC 显示又不标明,东八区的用户看到的时间差 8 小时 | 显示本地时间并带时区偏移(`2026-11-24 16:08:52 +08:00`);写给旧版本读的 `last_resign` 整句照旧是 UTC | 单测 `local_time_carries_its_offset`、`resign_result_is_shown_in_the_reader_language`(在 UTC、东八区、`America/St_Johns` 下都要过) | | 170 | 更新器、后台服务、自动更新任务的报错写死英文(约 120 条),中文界面下 `iphone-control update` 和控制台更新面板显示英文 | 全部中英成对(`tr!`/`trf!`),按运行时的语言输出;`outcome.json` 的 `status` 字段不变,控制台仍按它显示状态 | 手动:`IPHONE_CONTROL_LANG=zh` 和 `en` 下各运行一次 `iphone-control update apply`(没有脚本安装记录时),报错分别是中文、英文 | +| 171 | iOS 17–18(#185,iPhone XS,iOS 18.7.12):开发者镜像经 cryptexd 挂载卡住,WDA 起不来。这些版本要经典个性化镜像,走 lockdown 的 `mobile_image_mounter` | iOS 17–18 不问 cryptexd:先 `lookup_image("Personalized")`(已挂上就不读文件;锁屏等其他错误照常报出,不当成没挂),没挂才从 `ddi/personalized/` 缓存(上游 `Xcode_iOS_DDI_Personalized`,自动下载)或 `ICTL_DDI_DIR` 取三个文件再挂;iOS 26 及以后、版本读不出(0)照旧走 cryptexd;连续挂载失败只清掉这台手机用的那份缓存 | 单测 `only_ios_17_and_18_take_the_personalized_image_with_its_three_files_next_to_the_cryptex_one` + 真机(iPhone XS,iOS 18.7.12:补丁前一版挂上并起了 WDA;本版待重测) | diff --git a/packaging/env.example b/packaging/env.example index afe0236..09faebf 100644 --- a/packaging/env.example +++ b/packaging/env.example @@ -69,9 +69,9 @@ BARK_KEY= # 高级 # 自建 anisette 服务(默认用 Impactor 的第三方服务) ICTL_ANISETTE_URL= -# 开发者镜像下载地址(默认社区维护的 doronz88/DeveloperDiskImage) +# 开发者镜像下载地址(默认社区维护的 doronz88/DeveloperDiskImage 的 Xcode_iOS_DDI_Cryptex;iOS 17–18 用同级的 Xcode_iOS_DDI_Personalized) ICTL_DDI_URL= -# 自己从 Xcode 提取的开发者镜像目录。设了就不下载,也不会删里面的文件;缺文件时报错说明缺哪个 +# 自己从 Xcode 提取的开发者镜像目录。设了就不下载,也不会删里面的文件;缺文件时报错说明缺哪个。iOS 17–18 要经典个性化镜像(BuildManifest.plist、Image.dmg、Image.dmg.trustcache) ICTL_DDI_DIR= # 未签名 WDA 的路径。默认是数据目录的 wda/WDA-unsigned.ipa,首次签名前下载 # ICTL_WDA_UNSIGNED=/path/to/WDA-unsigned.ipa diff --git a/website/en/guide/configuration.md b/website/en/guide/configuration.md index 1b1d465..c248ced 100644 --- a/website/en/guide/configuration.md +++ b/website/en/guide/configuration.md @@ -52,8 +52,8 @@ Notification variables: see [Notifications](./notifications). | Variable | Meaning | |---|---| | `ICTL_ANISETTE_URL` | Your own anisette server (the default is a public third-party one; see [Security](./security)) | -| `ICTL_DDI_URL` | Developer Disk Image download URL; the default is a community-maintained mirror | -| `ICTL_DDI_DIR` | A Developer Disk Image directory you extracted from Xcode. The daemon doesn't download anything or delete its files, and the error names any missing file. When unset, the `ddi/` cache in the data directory is used, and it is deleted and downloaded again after 3 failed mounts in a row | +| `ICTL_DDI_URL` | Developer Disk Image download URL; the default is a community-maintained mirror. The classic personalized image for iOS 17–18 is downloaded from the sibling `Xcode_iOS_DDI_Personalized` directory | +| `ICTL_DDI_DIR` | A Developer Disk Image directory you extracted from Xcode. The daemon doesn't download anything or delete its files, and the error names any missing file. iOS 17–18 take the classic personalized image (`BuildManifest.plist`, `Image.dmg`, `Image.dmg.trustcache`). When unset, the `ddi/` cache in the data directory is used (`ddi/personalized/` for iOS 17–18), and it is deleted and downloaded again after 3 failed mounts in a row | | `ICTL_IOS_BACKEND` | How phones on iOS 27 and later are driven. `auto` (the default) and `native`: natively, without WDA: HID for touches, the accessibility service to read the screen, the pasteboard to type. `wda`: still through WDA. iOS 26 and earlier always use WDA | | `ICTL_WDA_UNSIGNED` | Path of the unsigned WDA. Default: `wda/WDA-unsigned.ipa` in the data directory, downloaded before the first signing. A path you set yourself is not downloaded | | `SCREEN_W` / `SCREEN_H` | Screen size in points for the HID fallback, used only while WDA is down and there is no record of this device's size: WDA has never connected, or you switched to a device without one. It applies to every device, so take care with several | diff --git a/website/guide/configuration.md b/website/guide/configuration.md index 093877c..74f4f77 100644 --- a/website/guide/configuration.md +++ b/website/guide/configuration.md @@ -52,8 +52,8 @@ MCP 服务由 AI 客户端拉起,注册时写进去的环境变量优先于设 | 变量 | 含义 | |---|---| | `ICTL_ANISETTE_URL` | 自建 anisette 服务地址(默认用公共的第三方服务,见[安全与隐私](./security)) | -| `ICTL_DDI_URL` | 开发者镜像的下载地址,默认社区维护的镜像仓库 | -| `ICTL_DDI_DIR` | 自己从 Xcode 提取的开发者镜像目录。设了就不下载,也不会删里面的文件;缺文件时报错说明缺哪个。不设时用数据目录下的 `ddi/` 缓存,连续 3 次挂载失败后清掉重新下载 | +| `ICTL_DDI_URL` | 开发者镜像的下载地址,默认社区维护的镜像仓库。iOS 17–18 的经典个性化镜像从同级的 `Xcode_iOS_DDI_Personalized` 下载 | +| `ICTL_DDI_DIR` | 自己从 Xcode 提取的开发者镜像目录。设了就不下载,也不会删里面的文件;缺文件时报错说明缺哪个。iOS 17–18 要经典个性化镜像(`BuildManifest.plist`、`Image.dmg`、`Image.dmg.trustcache`)。不设时用数据目录下的 `ddi/` 缓存(iOS 17–18 是 `ddi/personalized/`),连续 3 次挂载失败后清掉重新下载 | | `ICTL_IOS_BACKEND` | iOS 27 及以上的手机怎么控制。`auto`(默认)和 `native`:原生,不用 WDA,经 HID 点按、无障碍服务读界面、剪贴板输入;`wda`:仍用 WDA。iOS 26 及以下总是用 WDA | | `ICTL_WDA_UNSIGNED` | 未签名 WDA 的路径。默认是数据目录的 `wda/WDA-unsigned.ipa`,第一次签名前下载。自己指定的路径不会下载 | | `SCREEN_W` / `SCREEN_H` | HID 后备路线换算坐标用的屏幕尺寸(点):WDA 不可用、又没有这台设备的尺寸记录时才用,比如 WDA 从没连上过,或切到记录里没有尺寸的设备。不分设备,接多台时要小心 |