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: slow lock, home and taps on iPhone 18; clearer Web Inspector and log output (#39)

Qinghe Lide8ff8f68523
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b60545d..3446f95 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,15 @@ All notable changes to this project are documented here. The format is based on
## [Unreleased]
+### Fixed
+
+- `lock` no longer takes about 10 seconds on newer iPhones: the power key is pressed for 0.1 s instead of held for 0.5 s, which an iPhone 18 Pro Max (iOS 27.2.1) ignored, so every lock fell through to WebDriverAgent's slower lock and logged a timeout.
+- `home` takes about 1.3 seconds instead of 3.7 on devices that ignore the IOHID Home event (iPhone 18 Pro Max, iOS 27.2.1): when only the XCTest press works, the daemon remembers that for the device and uses it first. Devices where only the IOHID press works (iPhone 12 mini) keep their order.
+- Taps and long presses no longer take about 26 seconds while something on screen keeps animating (seen tapping a search result in Settings with the keyboard up, iPhone 18 Pro Max, iOS 27.2.1): like swipes, they no longer wait for WebDriverAgent's animation cool-off. The result came back in about 1.4 seconds.
+- `iphone_web_targets` and `iphone_web_eval` say to turn on Settings → Safari → Advanced → Web Inspector when the phone closes the connection, instead of only showing a TLS error.
+- `iphone_app_logs` no longer returns Info lines, matching its description (some processes still send them on a stream without debug messages).
+- English device descriptions have a space before the parenthesis and after the comma: `name (model iOS version, UDID)`.
+
## [0.1.5] - 2026-11-10
### Added
diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md
index 7b07ea9..f2f9d66 100644
--- a/CHANGELOG.zh-CN.md
+++ b/CHANGELOG.zh-CN.md
@@ -6,6 +6,15 @@
## [Unreleased]
+### 修复
+
+- 新款 iPhone 上 `lock` 不再要 10 秒左右:电源键改为按 0.1 秒,不再按住 0.5 秒。iPhone 18 Pro Max(iOS 27.2.1)不认按住,每次锁屏都退到 WebDriverAgent 较慢的锁屏,还在日志里记一次超时。
+- 不认 IOHID Home 事件的设备(iPhone 18 Pro Max,iOS 27.2.1)上 `home` 从约 3.7 秒变为约 1.3 秒:只有 XCTest 的按法有效时,守护进程按设备记住,之后先用它。只认 IOHID 按法的设备(iPhone 12 mini)顺序不变。
+- 界面上一直有动画时,点击和长按不再要 26 秒左右(iPhone 18 Pro Max、iOS 27.2.1 上,键盘弹着时在设置里点搜索结果每次都这样):和滑动一样,不再等 WebDriverAgent 的动画冷却。同一个点击现在约 1.4 秒。
+- 手机断开 Web Inspector 连接时,`iphone_web_targets`、`iphone_web_eval` 提示去打开 设置 → Safari → 高级 → 网页检查器,不再只给一句 TLS 错误。
+- `iphone_app_logs` 不再返回 Info 级别的行,和工具说明一致(不带调试消息的日志流里,有些进程仍会发 Info)。
+- 英文的设备说明在括号前、逗号后加了空格:`name (model iOS version, UDID)`。
+
## [0.1.5] - 2026-11-10
### 新增
diff --git a/crates/ictl-daemon/src/core.rs b/crates/ictl-daemon/src/core.rs
index 269e266..d143895 100644
--- a/crates/ictl-daemon/src/core.rs
+++ b/crates/ictl-daemon/src/core.rs
@@ -220,6 +220,9 @@ pub(crate) struct PerDevice {
pub ddi_failures: u32,
/// 最近一次经本进程锁屏的时间(自动解锁要等锁屏过渡走完,见 [`crate::tools::LOCK_SETTLE`])
pub last_lock: Option<Instant>,
+ /// 这台手机上 Home 先用 XCTest 的:上一次 IOHID 的没回到主屏、XCTest 的回到了(iPhone 18 Pro Max /
+ /// iOS 27.2.1 上 IOHID 的 Home 基本不起作用)。iPhone 12 mini 正相反,所以按设备记,见 `tools::press_home`
+ pub home_via_xctest: bool,
pub apps: HashMap<bool, Vec<AppInfo>>,
/// Log capture for `AppLogs` (developer tools), started by the first request
pub log_capture: Option<crate::devtools::Capture>,
@@ -290,12 +293,13 @@ pub(crate) async fn drop_tunnel(g: &mut Inner) {
}
}
-/// 一台设备的简短说明:`名字(型号 iOS 版本,UDID)`;读不到名字时只有 UDID
+/// 一台设备的简短说明:`名字(型号 iOS 版本,UDID)`,英文是 `name (model iOS version, UDID)`;读不到名字时只有 UDID
pub fn device_label(i: &DeviceInfo) -> String {
if i.name.is_empty() && i.product_type.is_empty() {
i.udid.clone()
} else {
- format!("{}({} iOS {},{})", i.name, i.product_type, i.product_version, i.udid)
+ let (name, model, version, udid) = (&i.name, &i.product_type, &i.product_version, &i.udid);
+ ictl_l10n::trf!("{name}({model} iOS {version},{udid})", "{name} ({model} iOS {version}, {udid})")
}
}
diff --git a/crates/ictl-daemon/src/devtools.rs b/crates/ictl-daemon/src/devtools.rs
index fd4e0cd..c8a0b2c 100644
--- a/crates/ictl-daemon/src/devtools.rs
+++ b/crates/ictl-daemon/src/devtools.rs
@@ -11,11 +11,11 @@
//! The reader task only ever awaits the next entry: an entry is several reads, and cancelling one half-way (as a
//! `select!` against a timer would) leaves the stream out of step.
//!
-//! The stream leaves out debug and info messages (see `ictl_device::Device::log_stream`: asking for them slows the
-//! phone). It is still every process, tens of lines a second, so the buffer is bounded by size as well as by count
-//! ([`MAX_BYTES`]): messages are cut to
-//! [`MAX_LINE_CHARS`] and processes kept by name only when they arrive. How far back it reaches depends on how busy
-//! the phone is, so every answer says so.
+//! The stream leaves out debug messages (see `ictl_device::Device::log_stream`: asking for them slows the phone), and
+//! the info ones that still arrive are dropped ([`kept`]). It is still every process, tens of lines a second, so the
+//! buffer is bounded by size as well as by count ([`MAX_BYTES`]): messages are cut to [`MAX_LINE_CHARS`] and processes
+//! kept by name only when they arrive. How far back it reaches depends on how busy the phone is, so every answer says
+//! so.
use std::collections::VecDeque;
use std::sync::{Arc, Mutex};
@@ -69,7 +69,9 @@ impl Daemon {
let task = tokio::spawn(async move {
// never cancelled mid-entry (see the module docs); stopped by aborting the task
while let Ok(e) = stream.next().await {
- b.lock().unwrap_or_else(|p| p.into_inner()).push(Instant::now(), compact(e));
+ if kept(&e) {
+ b.lock().unwrap_or_else(|p| p.into_inner()).push(Instant::now(), compact(e));
+ }
}
});
let now = Instant::now();
@@ -250,6 +252,13 @@ fn size(e: &LogEntry) -> usize {
e.process.len() + e.message.len() + e.subsystem.as_ref().map_or(0, String::len)
}
+/// Only the default (Notice), Error and Fault levels are kept. The stream is started without debug messages, but some
+/// processes still send Info ones (seen from MobileTimer on iOS 27.2.1); they are dropped here so the tool returns
+/// what it says, and they don't take room in the buffer
+fn kept(e: &LogEntry) -> bool {
+ !matches!(e.level, LogLevel::Debug | LogLevel::Info)
+}
+
/// What the buffer keeps of an entry: the process by name (the filter and the output only use the name) and the
/// message cut to [`MAX_LINE_CHARS`] (marked with `…`)
fn compact(mut e: LogEntry) -> LogEntry {
@@ -470,6 +479,13 @@ mod tests {
assert!(b.lines.front().unwrap().0 > t, "the oldest lines went first");
}
+ #[test]
+ fn info_and_debug_entries_are_not_kept() {
+ let level = |l| kept(&entry("/x/P", l, "m"));
+ assert!(!level(LogLevel::Debug) && !level(LogLevel::Info));
+ assert!(level(LogLevel::Notice) && level(LogLevel::Error) && level(LogLevel::Fault));
+ }
+
#[test]
fn crash_reports_newest_first() {
let names = vec![
diff --git a/crates/ictl-daemon/src/tools.rs b/crates/ictl-daemon/src/tools.rs
index 6cf10a9..c5d5209 100644
--- a/crates/ictl-daemon/src/tools.rs
+++ b/crates/ictl-daemon/src/tools.rs
@@ -665,6 +665,7 @@ impl Daemon {
Button::VolumeDown => "volumeDown",
};
self.ensure_unlocked(g).await?;
+ let xctest_first = g.dev.home_via_xctest;
if let Some(w) = self.wda(g) {
// Home 在系统弹窗(定位、通知权限等)挡着时不生效,WDA 却照样返回成功。弹窗属于 SpringBoard,
// 看前台 App 发现不了,要单独查;按之前查(App 静止时约 0.4 秒,按下后动画中查要好几秒)
@@ -677,11 +678,18 @@ impl Daemon {
blocking(&text)
));
}
+ let mut home_worked = None;
let r = if hid_button == Button::Home {
- press_home(w).await
+ press_home(w, xctest_first).await.map(|(text, worked)| {
+ home_worked = worked;
+ text
+ })
} else {
w.press_button(wda_name).await.map(|()| ictl_l10n::trf!("已按 {button}", "Pressed {button}"))
};
+ if let Some(via_xctest) = home_worked {
+ g.dev.home_via_xctest = via_xctest;
+ }
match r {
Ok(text) => return Ok(text),
Err(WdaError::Unavailable(_)) => {}
@@ -830,21 +838,29 @@ pub(crate) fn hid_rotation(w: u32, h: u32, known: Option<(Duration, Rotation)>)
}
/// 按 Home,等主屏真的到前台再说「已按」(紧接着查状态时前台不再是旧 App)。
-/// 先经 IOHID 按(XCTest 的 home 在 iPhone 12 mini / iOS 26.4.1 上不起作用却报成功),
-/// [`HOME_SETTLE`] 内没回到主屏再用 XCTest 的 home 补一次;IOHID 这一下报错也改用 XCTest 的
-async fn press_home(w: &mut WdaClient<DeviceTransport>) -> Result<String, WdaError> {
+/// 两种按法各有设备不认:XCTest 的 home 在 iPhone 12 mini / iOS 26.4.1 上不起作用却报成功;IOHID 的 AC Home
+/// 在 iPhone 18 Pro Max / iOS 27.2.1 上基本不起作用(按住 0.05~0.5 秒都一样)。所以默认先 IOHID,
+/// `xctest_first` 时先 XCTest;[`HOME_SETTLE`] 内没回到主屏(或这一下报错)再换另一种补一次。
+/// 同时返回回到主屏的是不是 XCTest 那一下(都没回到为 `None`),调用方记下来,这台设备下次先用它
+async fn press_home(
+ w: &mut WdaClient<DeviceTransport>,
+ xctest_first: bool,
+) -> Result<(String, Option<bool>), WdaError> {
let mut app = String::new();
- for via_hid in [true, false] {
+ let order = if xctest_first { [false, true] } else { [true, false] };
+ for (i, via_hid) in order.into_iter().enumerate() {
+ let last = i == 1;
let sent = if via_hid { w.press_home_hid().await } else { w.press_button("home").await };
+ let (way, other) = if via_hid { ("IOHID", "XCTest") } else { ("XCTest", "IOHID") };
match sent {
Ok(()) => {}
Err(e @ WdaError::Unavailable(_)) => return Err(e),
- Err(e) if via_hid => {
+ Err(e) if !last => {
tracing::info!(
"{}",
ictl_l10n::log_trf!(
- "经 IOHID 按 Home 报错,改用 XCTest:{e}",
- "Pressing Home via IOHID failed, using XCTest: {e}"
+ "经 {way} 按 Home 报错,改用 {other}:{e}",
+ "Pressing Home via {way} failed, using {other}: {e}"
)
);
continue;
@@ -855,26 +871,29 @@ async fn press_home(w: &mut WdaClient<DeviceTransport>) -> Result<String, WdaErr
loop {
app = w.active_app().await.unwrap_or_default();
if app == SPRINGBOARD {
- return Ok(ictl_l10n::tr!("已按 home", "Pressed home").into());
+ return Ok((ictl_l10n::tr!("已按 home", "Pressed home").into(), Some(!via_hid)));
}
if Instant::now() >= deadline {
break;
}
tokio::time::sleep(Duration::from_millis(150)).await;
}
- if via_hid {
+ if !last {
tracing::info!(
"{}",
ictl_l10n::log_trf!(
- "经 IOHID 按 Home 后前台还是 {app},改用 XCTest 再按一次",
- "After pressing Home via IOHID the foreground is still {app}, pressing again via XCTest"
+ "经 {way} 按 Home 后前台还是 {app},改用 {other} 再按一次",
+ "After pressing Home via {way} the foreground is still {app}, pressing again via {other}"
)
);
}
}
- Ok(ictl_l10n::trf!(
- "已按 home,但前台还是 {app},先截图看看",
- "Pressed home, but the foreground is still {app}; take a screenshot"
+ Ok((
+ ictl_l10n::trf!(
+ "已按 home,但前台还是 {app},先截图看看",
+ "Pressed home, but the foreground is still {app}; take a screenshot"
+ ),
+ None,
))
}
diff --git a/crates/ictl-daemon/src/web.rs b/crates/ictl-daemon/src/web.rs
index 892a6ef..6f6cfdf 100644
--- a/crates/ictl-daemon/src/web.rs
+++ b/crates/ictl-daemon/src/web.rs
@@ -112,7 +112,10 @@ async fn web_pages(slot: &mut Option<WebConn>, device: &Device) -> Result<(Vec<A
}
for attempt in 0..2 {
if slot.is_none() {
- let w = device.web_inspector().await.map_err(|e| e.to_string())?;
+ let w = device.web_inspector().await.map_err(|e| match e {
+ ictl_device::DeviceError::Io(e) => closed_by_phone(&e),
+ e => e.to_string(),
+ })?;
*slot = Some(WebConn { udid: device.udid.clone(), w, used: Instant::now() });
}
let conn = slot.as_mut().ok_or("Web Inspector")?;
@@ -138,10 +141,21 @@ fn page_error(e: &ictl_webinspector::Error) -> String {
ictl_webinspector::Error::Timeout(_) => {
ictl_l10n::tr!("等待页面回应超时", "timed out waiting for the page to answer").into()
}
+ ictl_webinspector::Error::Io(e) => closed_by_phone(e),
e => e.to_string(),
}
}
+/// The phone closes the Web Inspector connection right away when Settings → Safari → Advanced → Web Inspector is
+/// off (seen on iOS 27.2.1: `peer closed connection without sending TLS close_notify`); the raw I/O error doesn't
+/// say that
+fn closed_by_phone(e: &std::io::Error) -> String {
+ ictl_l10n::trf!(
+ "手机断开了 Web Inspector 连接({e})。多半是没打开 设置 → Safari → 高级 → 网页检查器,打开后重试",
+ "The phone closed the Web Inspector connection ({e}). Usually Settings → Safari → Advanced → Web Inspector is off; turn it on and retry"
+ )
+}
+
/// Errors after which the connection can't be trusted: everything except a page that didn't answer in time or
/// refused a command (reads are cancel-safe and late answers for a closed session are dropped). Reopening costs
/// about 8 seconds, and repeated reopening made the phone stop reporting Safari, so only reopen when needed
@@ -209,6 +223,16 @@ mod tests {
assert!(breaks_connection(&Error::Io(std::io::Error::other("closed"))));
}
+ #[test]
+ fn a_closed_connection_points_at_the_web_inspector_setting() {
+ use ictl_webinspector::Error;
+ let eof = || std::io::Error::new(std::io::ErrorKind::UnexpectedEof, "peer closed connection");
+ let msg = page_error(&Error::Io(eof()));
+ assert!(msg.contains("网页检查器") && msg.contains("peer closed connection"), "{msg}");
+ assert_eq!(closed_by_phone(&eof()), msg);
+ assert!(!page_error(&Error::Protocol("x".into())).contains("网页检查器"));
+ }
+
#[test]
fn picks_by_id_or_text() {
let pages =
diff --git a/crates/ictl-device/src/lib.rs b/crates/ictl-device/src/lib.rs
index 9ca44d7..16cd1eb 100644
--- a/crates/ictl-device/src/lib.rs
+++ b/crates/ictl-device/src/lib.rs
@@ -499,6 +499,8 @@ impl Device {
limit(ictl_l10n::tr!("打开 Web Inspector", "open the Web Inspector"), QUERY, async {
ictl_webinspector::WebInspector::open(&*self.provider).await.map_err(|e| match e {
ictl_webinspector::Error::Device(e) => e.into(),
+ // kept as I/O so the caller can tell the phone closed the connection (Web Inspector off)
+ ictl_webinspector::Error::Io(e) => DeviceError::Io(e),
e => DeviceError::Idevice(e.to_string()),
})
})
@@ -508,7 +510,8 @@ impl Device {
/// Starts the phone's unified log stream (os_trace_relay), every process, without debug messages.
/// Asking for debug messages (what idevice's `start_trace` does) makes every process on the phone produce them:
/// about 650 lines a second instead of about 80 on an idle iPhone 15 Pro Max (iOS 27.0.1), and gestures got
- /// slower and some failed while the stream ran. Info messages come along with debug, so they are left out too
+ /// slower and some failed while the stream ran. Most info messages go with them, but some processes still send
+ /// Info entries (MobileTimer on iOS 27.2.1); callers that promise default, Error and Fault only drop those
pub async fn log_stream(&self) -> Result<LogStream> {
let flags = oslog::flags::IDEVICE_DEFAULT & !oslog::flags::DEBUG;
let inner =
diff --git a/crates/ictl-wda/src/client.rs b/crates/ictl-wda/src/client.rs
index 7084181..4d44757 100644
--- a/crates/ictl-wda/src/client.rs
+++ b/crates/ictl-wda/src/client.rs
@@ -62,7 +62,7 @@ pub struct IdleSettings {
impl IdleSettings {
/// WDA 的默认值
pub const DEFAULT: Self = Self { wait_for_idle_timeout: 10.0, animation_cool_off_timeout: 2.0 };
- /// 临时调小的值(0 会导致锁屏唤醒失败,所以不是 0)
+ /// 锁屏解锁期间临时调小的值(0 会导致锁屏唤醒失败,所以不是 0)。点击、长按不用它,见 [`WdaClient::tap`]
pub const QUICK: Self = Self { wait_for_idle_timeout: 1.0, animation_cool_off_timeout: 0.2 };
/// 不等动画冷却:滑动、以及「等界面稳定」时轮询元素树用(由调用方比较前后两次判断稳定)。真机(iOS 27,设置列表):
/// - 上下滑 0.3 秒:冷却 0 约 1.0 秒;默认 2 秒约 3 秒;0.2~1.5 秒反而要 18~19 秒(惯性滚动期间一直等)
@@ -402,16 +402,19 @@ impl<T: Transport> WdaClient<T> {
/// - `/wda/tap` 先等界面空闲:主屏点图标约 1.7 秒(调小等待也没用),App 里约 0.6 秒,锁屏上约 2.9 秒
/// - actions 手势做完要等动画冷却(`animationCoolOffTimeout`,默认 2 秒):App 里切标签约 1.9 秒
/// - actions + 临时调小等待:App 里约 0.7 秒,主屏点图标约 0.9 秒
+ /// - 冷却不能是 0.2 秒([`IdleSettings::QUICK`]):界面上一直有动画时(键盘弹着、光标在闪)要等约 26 秒才返回,
+ /// iPhone 18 Pro Max(iOS 27.2.1)在设置里点搜索结果每次都这样;冷却 0 约 0.4 秒。和滑动一样用
+ /// [`IdleSettings::NO_COOL_OFF`]
///
/// 和 `/wda/tap` 一样不等点击引起的动画结束,调用方要看结果就再截图
pub async fn tap(&mut self, x: f64, y: f64) -> Result<()> {
- self.quick_gesture(&tap_steps(x, y, TAP_PRESS_MS), IdleSettings::QUICK).await
+ self.quick_gesture(&tap_steps(x, y, TAP_PRESS_MS), IdleSettings::NO_COOL_OFF).await
}
/// 长按:按下、停 `seconds` 秒、抬起,一个 actions 手势。`/wda/touchAndHold` 前后都等界面空闲,
- /// 真机上主屏长按图标 1.2 秒要约 12 秒才返回
+ /// 真机上主屏长按图标 1.2 秒要约 12 秒才返回。等待设置同 [`Self::tap`]
pub async fn touch_and_hold(&mut self, x: f64, y: f64, seconds: f64) -> Result<()> {
- self.quick_gesture(&tap_steps(x, y, (seconds * 1000.0) as u64), IdleSettings::QUICK).await
+ self.quick_gesture(&tap_steps(x, y, (seconds * 1000.0) as u64), IdleSettings::NO_COOL_OFF).await
}
/// 滑动:一个 actions 手势,期间用 [`IdleSettings::NO_COOL_OFF`]。做完时列表可能还在惯性滚动,
@@ -532,11 +535,12 @@ impl<T: Transport> WdaClient<T> {
self.hid_event(HID_PAGE_CONSUMER, HID_AC_HOME, 0.05).await
}
- /// 经 IOHID 按电源键(按住 0.5 秒)。WDA 自己的 `/wda/lock` 在 iOS 27 上也是这么做的,
- /// iOS 27 以下仍用 XCTest 的 `pressLockButton`,iPhone 12 mini(iOS 26.4.1)上锁不了屏。
+ /// 经 IOHID 短按电源键(0.1 秒,和手指按一下差不多)。WDA 自己的 `/wda/lock` 在 iOS 27 上按住 0.5 秒,
+ /// iOS 27 以下用 XCTest 的 `pressLockButton`,iPhone 12 mini(iOS 26.4.1)上锁不了屏。
+ /// 不能按住久:iPhone 18 Pro Max(iOS 27.2.1)上按住 0.5 秒完全没反应(当成了长按),0.05~0.15 秒约 0.7 秒锁屏。
/// 屏幕已熄灭时按它会把屏幕点亮,调用方要先确认没锁屏
pub async fn press_power_hid(&mut self) -> Result<()> {
- self.hid_event(HID_PAGE_CONSUMER, HID_POWER, 0.5).await
+ self.hid_event(HID_PAGE_CONSUMER, HID_POWER, 0.1).await
}
pub async fn lock(&mut self) -> Result<()> {
@@ -741,7 +745,7 @@ mod tests {
let body = |i: usize| serde_json::from_str::<Value>(seen[i].2.as_deref().unwrap()).unwrap();
assert_eq!((body(1)["page"].as_u64(), body(1)["usage"].as_u64()), (Some(0x0C), Some(0x223)));
assert_eq!((body(2)["page"].as_u64(), body(2)["usage"].as_u64()), (Some(0x0C), Some(0x30)));
- assert_eq!(body(2)["duration"], 0.5);
+ assert_eq!(body(2)["duration"], 0.1);
}
#[tokio::test]
@@ -777,7 +781,7 @@ mod tests {
]
);
let body = |i: usize| serde_json::from_str::<Value>(seen[i].2.as_deref().unwrap()).unwrap();
- assert_eq!(body(2)["settings"]["animationCoolOffTimeout"], 0.2);
+ assert_eq!(body(2)["settings"]["animationCoolOffTimeout"], 0.0);
assert_eq!(body(4)["settings"]["animationCoolOffTimeout"], 2.0);
let a = body(3);
let steps = a["actions"][0]["actions"].as_array().unwrap();
diff --git a/docs/dev/regression-cases.md b/docs/dev/regression-cases.md
index 60c39eb..db5f1e0 100644
--- a/docs/dev/regression-cases.md
+++ b/docs/dev/regression-cases.md
@@ -1,6 +1,6 @@
# 必须覆盖的回归用例
-#1~#34 来自 toolkit 和本项目早期实际踩过的坑,#35~#45 是多设备和 HID 横屏,#46 起是实时画面、开发者工具和英文界面。能单测的写单测,不能单测的进真机回归清单:改了设备、时序、WDA 相关的代码,要在真机上重跑相关的用例,并在 PR 里写明跑了哪些、用什么设备和 iOS 版本。
+#1~#34 来自 toolkit 和本项目早期实际踩过的坑,#35~#45 是多设备和 HID 横屏,#46~#58 是实时画面、开发者工具和英文界面,#59 起是 iPhone 18 Pro Max(iOS 27.2.1)真机全量测试发现的问题。能单测的写单测,不能单测的进真机回归清单:改了设备、时序、WDA 相关的代码,要在真机上重跑相关的用例,并在 PR 里写明跑了哪些、用什么设备和 iOS 版本。
| # | 坑 | 正确行为 | 测试方式 |
|---|---|---|---|
@@ -62,3 +62,8 @@
| 56 | 安装和重签同时进行:idevice 把每个 .ipa 上传到手机上同一个文件(`PublicStaging/idevice.ipa`),互相覆盖 | 安装(`iphone_install_app`、重签、`sign`)互相排队 | 真机(安装和重签同时进行,两个都成功) |
| 57 | iPhone 横屏时 viewer 画面还是竖的、内容是歪的,点击也错位 | iPhone 上 WDA 每个会话开 `mjpegFixOrientation`,帧随界面转正 | 真机:Safari 转横屏,`/stream` 的帧是 2796×1290 且内容正立 |
| 58 | 持设备锁的调用不返回:之后的请求全部排队到过期,进程却还活着,服务管理器不会重启 | 完成巡检或请求时记心跳,约 10 分钟没有心跳就退出(`watchdog.rs`),巡检因为锁被占而跳过时不算 | 单测 a_beat_ends_the_silence |
+| 59 | iPhone 18 Pro Max(iOS 27.2.1)上按住 0.5 秒的 IOHID 电源键没反应,每次锁屏都退到 WDA 的锁屏:约 10 秒,日志里还记一次超时 | 电源键按 0.1 秒(0.05~0.15 秒都约 0.7 秒锁屏) | 单测(`hid_buttons_send_consumer_page_events`)+ 真机计时(锁屏约 0.9 秒) |
+| 60 | IOHID 的 AC Home 在 iPhone 18 Pro Max(iOS 27.2.1)上基本不起作用,按住多久都一样;XCTest 的 home 在 iPhone 12 mini 上不起作用,正相反。只按固定顺序的话,前者每次 Home 都先白等 2 秒 | 按设备记住上次让主屏回到前台的按法,下次先用它;不起作用再换另一种,换成功了就改记 | 真机计时(iPhone 18 Pro Max:第一次约 3.7 秒,之后约 1.3 秒);iPhone 12 mini 待复测 |
+| 61 | 点击、长按用 0.2 秒的动画冷却:界面上一直有动画时(键盘弹着)WDA 要约 26 秒才返回(同 `NO_COOL_OFF` 注释里滑动的情况) | 点击、长按和滑动一样用冷却 0(`IdleSettings::NO_COOL_OFF`);解锁仍用 `QUICK` | 单测(`tap_is_one_gesture_with_quick_waits_then_restores_baseline`)+ 真机计时(设置里搜索后点结果:26 秒 → 1.4 秒;主屏点图标、App 里切标签不变慢) |
+| 62 | 网页检查器没开时手机直接断开 Web Inspector 连接,工具只报一句 TLS 错误 | 连接被手机断开时提示打开 设置 → Safari → 高级 → 网页检查器 | 单测(`a_closed_connection_points_at_the_web_inspector_setting`)+ 真机(开关关着时调 `iphone_web_targets`) |
+| 63 | 不带调试消息的日志流里仍有 Info 级别的条目,和 `iphone_app_logs` 的说明不符 | 采集时丢掉 Info、Debug | 单测(`info_and_debug_entries_are_not_kept`)+ 真机 |