Skip to content

Control a real USB-connected iPhone from Linux (no Mac, no paid developer account) and expose it to AI agents as MCP tools

fix(cli): `status` shows native control instead of asking for WDA (#127)

Qinghe Lifa2ecad04d7b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a4633d7..015ebf0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,7 @@ What changed in each release, one line per change. Versions follow [Semantic Ver
### Fixes
+- `iphone-control status` on a phone under native control shows "native" instead of asking you to install WDA (#127).
- `service stop` and `service uninstall` also end a WDA launched in the background, and each phone keeps its own (#124).
- Text pasted on the phone no longer reaches your Mac through Universal Clipboard (#122).
- With a notification banner up, elements are read from the app instead of the banner (#121).
diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md
index 2ed50ca..294940b 100644
--- a/CHANGELOG.zh-CN.md
+++ b/CHANGELOG.zh-CN.md
@@ -23,6 +23,7 @@
### 修复
+- 原生控制的手机上,`iphone-control status` 显示「原生」,不再提示去装 WDA(#127)。
- `service stop`、`service uninstall` 也会结束后台启动的 WDA,每台手机各用各的(#124)。
- 粘贴到手机上的文字不再经「通用剪贴板」传到 Mac(#122)。
- 弹着通知横幅时,读到的是 App 的元素,不再是横幅的(#121)。
diff --git a/apps/iphone-control/src/main.rs b/apps/iphone-control/src/main.rs
index b4206ab..793d95e 100644
--- a/apps/iphone-control/src/main.rs
+++ b/apps/iphone-control/src/main.rs
@@ -815,37 +815,48 @@ async fn status(socket: &Path) -> anyhow::Result<()> {
(None, _) => {}
}
let p = &s.persisted;
- println!("WDA {}", p.wda_bundle.as_deref().unwrap_or(ictl_l10n::tr!("未签名", "not signed")));
- match &s.device_profile {
- ictl_daemon::core::DeviceProfile::Missing => {
- println!(
- "{}",
- ictl_l10n::tr!(
- "描述文件 这台手机上没有装当前 Apple ID 签的 WDA(iphone-control setup)",
- "Profile no WDA signed by the current Apple ID on this phone (iphone-control setup)"
- )
+ if s.native {
+ // 原生控制用不到 WDA 和签名:不提示装 WDA(签名详情见 doctor)
+ println!(
+ "{}",
+ ictl_l10n::tr!(
+ "控制方式 原生(iOS 27 起不用 WDA;要改回 WDA,在 ~/.config/iphone-control/env 里设 ICTL_IOS_BACKEND=wda)",
+ "Control native (no WDA from iOS 27; to go back to WDA, set ICTL_IOS_BACKEND=wda in ~/.config/iphone-control/env)"
)
- }
- dp => {
- if let Some(left) = dp.left(p) {
- let whose = if matches!(dp, ictl_daemon::core::DeviceProfile::Expires(_)) {
- ictl_l10n::tr!("手机上的", "on the phone, ")
- } else {
- ictl_l10n::tr!("上次签的", "last signed, ")
- };
+ );
+ } else {
+ println!("WDA {}", p.wda_bundle.as_deref().unwrap_or(ictl_l10n::tr!("未签名", "not signed")));
+ match &s.device_profile {
+ ictl_daemon::core::DeviceProfile::Missing => {
println!(
"{}",
- ictl_l10n::trf!(
- "描述文件 {whose}还剩 {} 小时",
- "Profile {whose}{} hours left",
- left.as_secs() / 3600
+ ictl_l10n::tr!(
+ "描述文件 这台手机上没有装当前 Apple ID 签的 WDA(iphone-control setup)",
+ "Profile no WDA signed by the current Apple ID on this phone (iphone-control setup)"
)
- );
+ )
+ }
+ dp => {
+ if let Some(left) = dp.left(p) {
+ let whose = if matches!(dp, ictl_daemon::core::DeviceProfile::Expires(_)) {
+ ictl_l10n::tr!("手机上的", "on the phone, ")
+ } else {
+ ictl_l10n::tr!("上次签的", "last signed, ")
+ };
+ println!(
+ "{}",
+ ictl_l10n::trf!(
+ "描述文件 {whose}还剩 {} 小时",
+ "Profile {whose}{} hours left",
+ left.as_secs() / 3600
+ )
+ );
+ }
}
}
- }
- if let Some(r) = p.last_resign_text() {
- println!("{}", ictl_l10n::trf!("上次重签 {r}", "Re-signed {r}"));
+ if let Some(r) = p.last_resign_text() {
+ println!("{}", ictl_l10n::trf!("上次重签 {r}", "Re-signed {r}"));
+ }
}
let unlock = match (s.auto_unlock, s.unlock_disabled) {
(_, true) => ictl_l10n::tr!(
diff --git a/crates/ictl-daemon/src/core.rs b/crates/ictl-daemon/src/core.rs
index 7d97516..dc40c7d 100644
--- a/crates/ictl-daemon/src/core.rs
+++ b/crates/ictl-daemon/src/core.rs
@@ -396,6 +396,9 @@ pub struct Snapshot {
/// 当前这台手机上的 WDA 描述文件
#[serde(default)]
pub device_profile: DeviceProfile,
+ /// 当前这台手机原生控制(iOS 27 起默认,不用 WDA)。旧的守护进程不报,当作 false
+ #[serde(default)]
+ pub native: bool,
pub auto_unlock: bool,
pub unlock_disabled: bool,
pub notify_configured: bool,
@@ -649,6 +652,7 @@ impl Daemon {
pinned_by_env: cfg.udid.is_some(),
persisted: inner.persisted.clone(),
device_profile: DeviceProfile::NotChecked,
+ native: false,
auto_unlock: false,
unlock_disabled: cfg.unlock_disabled_flag().exists(),
notify_configured: cfg.notify.any(),
@@ -871,6 +875,7 @@ impl Daemon {
pinned_by_env: self.cfg.udid.is_some(),
persisted: g.persisted.clone(),
device_profile: g.dev.device_profile.clone(),
+ native: self.native(g),
auto_unlock: unlock.enabled(),
unlock_disabled: unlock.disabled_by_failure(),
notify_configured: self.cfg.notify.any(),