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

真机多 App 测试发现的问题:遮挡、弹窗、丢字、小组件坐标、等稳定、滑动慢、输出噪声

Derrorsce8304af5e0a
diff --git a/crates/ictl-daemon/src/core.rs b/crates/ictl-daemon/src/core.rs
index cfd25fb..9ff8e32 100644
--- a/crates/ictl-daemon/src/core.rs
+++ b/crates/ictl-daemon/src/core.rs
@@ -114,7 +114,7 @@ pub(crate) struct Inner {
/// HID 会话最近一次使用的时间;空闲超过 [`crate::supervise::HID_IDLE`] 就关掉(它持有屏幕媒体流)
pub hid_used: Option<Instant>,
/// 最近一次读到的元素树。只在调用方允许(max_age_ms)时复用;改变界面的操作做完就清掉
- pub elements_cache: Option<(Instant, Vec<ictl_wda::Element>)>,
+ pub elements_cache: Option<(Instant, ictl_wda::elements::Tree)>,
pub dedup: Dedup,
pub next_resign: Instant,
pub next_session_check: Instant,
@@ -341,6 +341,7 @@ impl Daemon {
Request::TerminateApp { app } => self.terminate_app(g, &app).await,
Request::OpenUrl { url } => self.open_url(g, &url).await,
Request::Settle { max_ms } => self.settle(g, Duration::from_millis(max_ms)).await,
+ Request::AlertCheck => self.alert_check(g).await,
Request::WaitFor { text, timeout_ms } => self.wait_for(g, &text, Duration::from_millis(timeout_ms)).await,
Request::Doctor => Ok(self.doctor(g).await),
Request::UnlockReset => {
diff --git a/crates/ictl-daemon/src/imaging.rs b/crates/ictl-daemon/src/imaging.rs
index 12c1389..9634485 100644
--- a/crates/ictl-daemon/src/imaging.rs
+++ b/crates/ictl-daemon/src/imaging.rs
@@ -65,6 +65,53 @@ pub fn thumb_diff(a: &[u8], b: &[u8]) -> f64 {
a.iter().zip(b).map(|(x, y)| f64::from(x.abs_diff(*y))).sum::<f64>() / a.len() as f64
}
+/// 两帧之间的变化:整体平均差,和变化最大的一小块(8×8 像素,约 70×70 点)的平均差。
+/// 加载圈这种小东西在整体平均里几乎看不出来,在小块里很明显
+#[derive(Debug, Clone, Copy, PartialEq)]
+pub struct Motion {
+ pub mean: f64,
+ pub max_tile: f64,
+}
+
+const TILE: usize = 8;
+
+/// 画面大部分是同一种颜色(白底/灰底的加载页、空白页)。加载圈和游戏、地图上的小动画单看画面变化分不开
+/// (真机:小红书搜索加载圈和消消乐地图待机动画,变化最大的小块都在 4 左右),加载页几乎是空白的,游戏、地图满屏是图
+pub fn mostly_blank(thumb: &[u8]) -> bool {
+ if thumb.is_empty() {
+ return false;
+ }
+ let mut hist = [0usize; 256];
+ for &p in thumb {
+ hist[p as usize] += 1;
+ }
+ let mode = (0..256).max_by_key(|&v| hist[v]).unwrap_or(0);
+ let near: usize = hist[mode.saturating_sub(12)..=(mode + 12).min(255)].iter().sum();
+ near as f64 >= thumb.len() as f64 * 0.7
+}
+
+pub fn thumb_motion(a: &[u8], b: &[u8]) -> Motion {
+ let mean = thumb_diff(a, b);
+ if a.len() != b.len() || a.len() != (THUMB_W * THUMB_H) as usize {
+ return Motion { mean, max_tile: mean };
+ }
+ let (w, h) = (THUMB_W as usize, THUMB_H as usize);
+ let mut max_tile = 0f64;
+ for ty in (0..h).step_by(TILE) {
+ for tx in (0..w).step_by(TILE) {
+ let (mut sum, mut n) = (0u32, 0u32);
+ for y in ty..(ty + TILE).min(h) {
+ for x in tx..(tx + TILE).min(w) {
+ sum += u32::from(a[y * w + x].abs_diff(b[y * w + x]));
+ n += 1;
+ }
+ }
+ max_tile = max_tile.max(f64::from(sum) / f64::from(n));
+ }
+ }
+ Motion { mean, max_tile }
+}
+
/// 整屏缩放到点尺寸:图像像素即点坐标。返回 (jpeg, 说明文字)
pub fn full_screen(png: &[u8], screen: ScreenSize, via: &str) -> Result<(Vec<u8>, String), String> {
let img = decode(png)?;
@@ -144,6 +191,31 @@ mod tests {
const SCREEN: ScreenSize = ScreenSize { width: 430.0, height: 932.0 };
+ /// 只有一小块在变(加载圈):整体平均差低于静止阈值,最大的小块很明显
+ #[test]
+ fn small_spinner_shows_up_in_tiles_only() {
+ let len = (THUMB_W * THUMB_H) as usize;
+ let a = vec![200u8; len];
+ let mut b = a.clone();
+ for (x, y) in [(24, 50), (25, 50), (24, 51), (25, 52)] {
+ b[y * THUMB_W as usize + x] = 40;
+ }
+ let m = thumb_motion(&a, &b);
+ assert!(m.mean < 3.0, "{m:?}");
+ assert!(m.max_tile >= 4.0, "{m:?}");
+ assert_eq!(thumb_motion(&a, &a), Motion { mean: 0.0, max_tile: 0.0 });
+ }
+
+ #[test]
+ fn blank_page_vs_busy_picture() {
+ let len = (THUMB_W * THUMB_H) as usize;
+ let mut page = vec![245u8; len];
+ page[..len / 5].fill(30);
+ assert!(mostly_blank(&page));
+ let busy: Vec<u8> = (0..len).map(|i| (i * 37 % 251) as u8).collect();
+ assert!(!mostly_blank(&busy));
+ }
+
fn png(w: u32, h: u32) -> Vec<u8> {
let mut out = Cursor::new(Vec::new());
image::RgbImage::from_pixel(w, h, image::Rgb([30, 60, 90]))
diff --git a/crates/ictl-daemon/src/tools.rs b/crates/ictl-daemon/src/tools.rs
index f837b12..b01aa60 100644
--- a/crates/ictl-daemon/src/tools.rs
+++ b/crates/ictl-daemon/src/tools.rs
@@ -5,7 +5,9 @@ use std::time::{Duration, Instant};
use base64::Engine;
use ictl_device::{AppInfo, Button, DeviceError, HidSession, ScreenSize, apps, hid::ascii_to_usage};
use ictl_unlock::UnlockError;
-use ictl_wda::{WdaError, elements, swipe_steps};
+use ictl_wda::elements::{self, TapPoint, Tree};
+use ictl_wda::http::DeviceTransport;
+use ictl_wda::{Launch, WdaClient, WdaError};
use crate::core::{Daemon, Inner, drop_tunnel, wda_down};
use crate::imaging::{self, fmt_g};
@@ -18,6 +20,13 @@ pub(crate) const LOCK_SETTLE: Duration = Duration::from_secs(3);
const VISUAL_SETTLE_BELOW: usize = 12;
/// 两帧缩略图平均逐像素差低于这个值算静止(0~255)。游戏背景的轻微摆动约 1~2,消除动画几十
const VISUAL_STILL: f64 = 3.0;
+/// 整体静止时,某一小块的平均差超过这个值算「还有一小块在动」(加载圈、小动画)。完全没动的两帧差是 0。
+/// 只在画面大部分是空白时才提醒([`imaging::mostly_blank`]),游戏、地图的待机动画不算
+const LOCAL_MOTION: f64 = 4.0;
+/// 等界面稳定时,前后两次元素位置差不超过这么多点就算没动(惯性滚动的尾巴)
+const STILL_TOLERANCE: i64 = 3;
+/// 滑动后最多等这么久让列表停下(快速滑动的惯性滚动约 2 秒)
+const SCROLL_SETTLE: Duration = Duration::from_millis(2500);
/// 按 Home 后最多等这么久,确认主屏到了前台
const HOME_SETTLE: Duration = Duration::from_secs(2);
const SPRINGBOARD: &str = "com.apple.springboard";
@@ -161,16 +170,16 @@ impl Daemon {
}
/// 当前界面的元素树。缓存不超过 `max_age` 就直接用(0 = 总是重读);重读的结果写回缓存
- async fn tree(&self, g: &mut Inner, max_age: Duration) -> Result<Vec<elements::Element>, String> {
+ async fn tree(&self, g: &mut Inner, max_age: Duration) -> Result<Tree, String> {
if !max_age.is_zero()
- && let Some((t, els)) = &g.elements_cache
+ && let Some((t, tree)) = &g.elements_cache
&& t.elapsed() <= max_age
{
- return Ok(els.clone());
+ return Ok(tree.clone());
}
- let els = self.require_wda(g)?.elements().await.map_err(|e| e.to_string())?;
- g.elements_cache = Some((Instant::now(), els.clone()));
- Ok(els)
+ let tree = self.require_wda(g)?.tree().await.map_err(|e| e.to_string())?;
+ g.elements_cache = Some((Instant::now(), tree.clone()));
+ Ok(tree)
}
pub(crate) async fn list_elements(
@@ -181,7 +190,7 @@ impl Daemon {
max_age: Duration,
) -> Result<String, String> {
self.ensure_unlocked(g).await?;
- let els = self.tree(g, max_age).await?;
+ let els = self.tree(g, max_age).await?.elements;
let shown: Vec<&elements::Element> =
if filter.is_empty() { els.iter().collect() } else { elements::filter(&els, filter) };
let lines: Vec<_> = shown.iter().take(limit).map(|e| e.describe()).collect();
@@ -194,39 +203,43 @@ impl Daemon {
}
/// 等界面稳定,最多等 `max`:
- /// - 有元素树的界面:连续两次读到的元素一样(读元素树时 WDA 本身也会等界面空闲)
+ /// - 有元素树的界面:连续两次读到的元素一样,并且没有加载圈。轮询期间让 WDA 读树时不等界面空闲、动画冷却
+ /// (否则滑完第一次读要等惯性滚动停下再冷却 2 秒,页面加载时一次能卡好几秒,超过上限很多)
/// - 元素很少的界面(游戏、地图,画面变化不反映在元素树里):改看画面,连续两帧缩略图几乎一样。
/// 截图约 0.2 秒一张,两帧之间再隔一点,避免两帧落在同一段静止的过渡里
+ ///
+ /// 屏幕上有弹窗时在结果里提醒(读树时顺带看,不多花时间)
pub(crate) async fn settle(&self, g: &mut Inner, max: Duration) -> Result<String, String> {
let t0 = Instant::now();
let Some(w) = self.wda(g) else {
tokio::time::sleep(max.min(Duration::from_millis(500))).await;
return Ok("WDA 不可用,等了 0.5 秒".into());
};
- let first = w.elements().await.map_err(|e| e.to_string())?;
- if first.len() < VISUAL_SETTLE_BELOW {
- return self.settle_visually(g, t0, max).await;
- }
- let mut prev = first;
- let msg = loop {
- // 读元素树时 WDA 本身会等界面空闲,两次之间不用再多等
- tokio::time::sleep(Duration::from_millis(50)).await;
- let cur = w.elements().await.map_err(|e| e.to_string())?;
- let same = cur == prev;
- prev = cur;
- if same {
- break format!("界面已稳定({:.1} 秒)", t0.elapsed().as_secs_f64());
- }
- if t0.elapsed() >= max {
- break format!("{:.1} 秒内界面一直在变(可能有动画),按最后的状态返回", max.as_secs_f64());
- }
+ w.begin_polling().await.map_err(|e| e.to_string())?;
+ let r = poll_stable(w, t0, max).await;
+ w.end_polling().await;
+ let (first, polled) = r?;
+ let Some((msg, tree)) = polled else {
+ // 元素很少:改看画面
+ let note = alert_note(&first);
+ return Ok(self.settle_visually(g, t0, max).await? + &note);
+ };
+ let note = alert_note(&tree);
+ // 自己画的加载圈(不是 ActivityIndicator)不在树里,树稳定了页面可能还在加载。
+ // 加载中的页面中间是空的:只在这种时候多看一眼画面(约 0.5 秒),平常不多花时间
+ let screen = self.screen(g).await?;
+ let msg = if msg.starts_with("界面已稳定") && middle_is_empty(&tree, screen.height) {
+ msg + &self.motion_note(g).await
+ } else {
+ msg
};
// 紧接着的 then=elements 直接用这棵树
- g.elements_cache = Some((Instant::now(), prev));
- Ok(msg)
+ g.elements_cache = Some((Instant::now(), tree));
+ Ok(msg + &note)
}
async fn settle_visually(&self, g: &mut Inner, t0: Instant, max: Duration) -> Result<String, String> {
+ let deadline = t0 + max;
let w = self.require_wda(g)?;
let mut prev: Option<Vec<u8>> = None;
loop {
@@ -234,12 +247,19 @@ impl Daemon {
let cur = tokio::task::spawn_blocking(move || imaging::thumbnail(&png))
.await
.map_err(|e| format!("图像处理任务异常:{e}"))??;
- if let Some(p) = &prev
- && imaging::thumb_diff(p, &cur) < VISUAL_STILL
- {
- return Ok(format!("画面已静止({:.1} 秒)", t0.elapsed().as_secs_f64()));
+ if let Some(p) = &prev {
+ let m = imaging::thumb_motion(p, &cur);
+ if m.mean < VISUAL_STILL {
+ let local = if m.max_tile >= LOCAL_MOTION && imaging::mostly_blank(&cur) {
+ ";但有一小块还在动(可能是加载圈或小动画),内容可能还没加载完,要等结果用 iphone_wait_for 或稍后再截图"
+ } else {
+ ""
+ };
+ return Ok(format!("画面已静止({:.1} 秒){local}", t0.elapsed().as_secs_f64()));
+ }
}
- if t0.elapsed() >= max {
+ // 不够再截一张(约 0.2 秒)、隔一下再比的时间了
+ if deadline.saturating_duration_since(Instant::now()) < Duration::from_millis(300) {
return Ok(format!("{:.1} 秒内画面一直在动,按最后的状态返回", max.as_secs_f64()));
}
prev = Some(cur);
@@ -247,21 +267,65 @@ impl Daemon {
}
}
+ /// 隔一下截两张图,画面还在动就返回提醒,否则返回空串
+ async fn motion_note(&self, g: &mut Inner) -> String {
+ let Some(w) = self.wda(g) else { return String::new() };
+ let mut thumbs = Vec::new();
+ for i in 0..2 {
+ if i > 0 {
+ tokio::time::sleep(Duration::from_millis(150)).await;
+ }
+ let Ok(png) = w.screenshot_png().await else { return String::new() };
+ match tokio::task::spawn_blocking(move || imaging::thumbnail(&png)).await {
+ Ok(Ok(t)) => thumbs.push(t),
+ _ => return String::new(),
+ }
+ }
+ let m = imaging::thumb_motion(&thumbs[0], &thumbs[1]);
+ if (m.mean >= VISUAL_STILL || m.max_tile >= LOCAL_MOTION) && imaging::mostly_blank(&thumbs[1]) {
+ ";但画面中间是空的、还有东西在动(可能还在加载),要等结果用 iphone_wait_for 或稍后再截图".into()
+ } else {
+ String::new()
+ }
+ }
+
+ /// 前台是 SpringBoard 时查有没有系统弹窗(权限请求等),有就返回提醒,没有返回空串。
+ /// 不带 then 的操作做完后调:弹窗挡着时点击、滑动都会落在弹窗上,WDA 却照样报成功。
+ /// 前台是 App 时只多一次约 0.13 秒的查询;在主屏上再多约 0.4 秒
+ pub(crate) async fn alert_check(&self, g: &mut Inner) -> Result<String, String> {
+ let Some(w) = self.wda(g) else { return Ok(String::new()) };
+ if w.active_app().await.map_err(|e| e.to_string())? != SPRINGBOARD {
+ return Ok(String::new());
+ }
+ Ok(match w.alert_text().await {
+ Ok(Some(text)) => alert_msg(&text),
+ _ => String::new(),
+ })
+ }
+
/// 等包含 `text` 的元素出现
pub(crate) async fn wait_for(&self, g: &mut Inner, text: &str, timeout: Duration) -> Result<String, String> {
self.ensure_unlocked(g).await?;
let t0 = Instant::now();
let w = self.require_wda(g)?;
- loop {
- let els = w.elements().await.map_err(|e| e.to_string())?;
- if let Some(e) = elements::find(&els, text).first() {
- return Ok(format!("已出现 {}({:.1} 秒)", e.describe(), t0.elapsed().as_secs_f64()));
- }
- if t0.elapsed() >= timeout {
- return Err(format!("{:.0} 秒内没出现包含 \"{text}\" 的元素,截图看看屏幕", timeout.as_secs_f64()));
+ // 轮询时不等界面空闲:页面还在加载、播放动画时每次读树也只要约 0.2 秒
+ w.begin_polling().await.map_err(|e| e.to_string())?;
+ let r = async {
+ loop {
+ let els = w.elements().await.map_err(|e| e.to_string())?;
+ // 不算输入框里的字:刚输入的搜索词不能算「结果出来了」
+ if let Some(e) = elements::find_shown(&els, text).first() {
+ return Ok(format!("已出现 {}({:.1} 秒)", e.describe(), t0.elapsed().as_secs_f64()));
+ }
+ if t0.elapsed() >= timeout {
+ return Err(format!("{:.0} 秒内没出现包含 \"{text}\" 的元素,截图看看屏幕", timeout.as_secs_f64()));
+ }
+ tokio::time::sleep(Duration::from_millis(300)).await;
}
- tokio::time::sleep(Duration::from_millis(300)).await;
}
+ .await;
+ w.end_polling().await;
+ r
}
pub(crate) async fn tap(&self, g: &mut Inner, x: f64, y: f64) -> Result<String, String> {
@@ -287,8 +351,8 @@ impl Daemon {
max_age: Duration,
) -> Result<String, String> {
self.ensure_unlocked(g).await?;
- let els = self.tree(g, max_age).await?;
- let matches = elements::find(&els, text);
+ let tree = self.tree(g, max_age).await?;
+ let matches = elements::find(&tree.elements, text);
if matches.is_empty() {
return Ok(format!("没找到包含 \"{text}\" 的元素,先用 iphone_list_elements 或截图看看屏幕"));
}
@@ -297,13 +361,26 @@ impl Daemon {
return Ok(format!("只匹配到 {} 个:\n{}", matches.len(), list.join("\n")));
}
let e = matches[index];
- self.require_wda(g)?.tap(e.center.0 as f64, e.center.1 as f64).await.map_err(|e| e.to_string())?;
+ // 中心被悬浮栏、键盘、浮层之类盖住时,点上去会落在盖着的东西上
+ let ((x, y), moved) = match tree.tap_point(e) {
+ TapPoint::Center(p) => (p, String::new()),
+ TapPoint::Moved { at, by } => {
+ (at, format!(";它的中心被「{by}」盖住,改点没被盖住的 ({},{})", fmt_g(at.0), fmt_g(at.1)))
+ }
+ TapPoint::Covered { by } => {
+ return Ok(format!(
+ "被挡住:{} 整个被「{by}」盖住,没有点;先滑动让它露出来,或截图后按坐标点",
+ e.describe()
+ ));
+ }
+ };
+ self.require_wda(g)?.tap(x, y).await.map_err(|e| e.to_string())?;
let note = if matches.len() > 1 {
format!("(共匹配 {} 个,点的是第 {index} 个)", matches.len())
} else {
String::new()
};
- Ok(format!("已点击 {}{note}", e.describe()))
+ Ok(format!("已点击 {}{note}{moved}", e.describe()))
}
pub(crate) async fn long_press(&self, g: &mut Inner, x: f64, y: f64, seconds: f64) -> Result<String, String> {
@@ -322,8 +399,13 @@ impl Daemon {
self.ensure_unlocked(g).await?;
let desc = format!("({},{}) → ({},{})", fmt_g(from.0), fmt_g(from.1), fmt_g(to.0), fmt_g(to.1));
if let Some(w) = self.wda(g) {
- match w.actions(&swipe_steps(from, to, (seconds * 1000.0) as u64)).await {
- Ok(()) => return Ok(format!("已滑动 {desc}")),
+ match w.swipe(from, to, (seconds * 1000.0) as u64).await {
+ // 滑动请求不等惯性滚动(等的话设置不对能卡十几秒),这里等列表停下再返回:
+ // 列表还在滚时下一次点击只会让它停住,点不到东西
+ Ok(()) => {
+ let vertical = (to.1 - from.1).abs() >= (to.0 - from.0).abs();
+ return Ok(format!("已滑动 {desc}{}", wait_scrolled(w, vertical).await));
+ }
Err(WdaError::Unavailable(_)) => {}
Err(e) => return Err(e.to_string()),
}
@@ -334,7 +416,6 @@ impl Daemon {
pub(crate) async fn type_text(&self, g: &mut Inner, text: &str, submit: bool) -> Result<String, String> {
self.ensure_unlocked(g).await?;
- let payload = if submit { format!("{text}\n") } else { text.to_owned() };
let n = text.chars().count();
if let Some(w) = self.wda(g) {
// /wda/keys 没有输入框获得焦点时也返回成功,其实什么都没输:先看屏幕上有没有键盘
@@ -344,21 +425,39 @@ impl Daemon {
"屏幕上没有键盘(没有输入框获得焦点),什么都没输;先点一下输入框,截图确认键盘出来了再输入".into(),
);
}
- Ok(true) => w.keys(&payload).await,
+ Ok(true) if text.is_empty() => Ok(()),
+ Ok(true) => w.keys(text).await,
Err(e) => Err(e),
};
match typed {
- Ok(()) => return Ok(format!("已输入 {n} 个字符{}", if submit { ",并按了回车" } else { "" })),
+ Ok(()) => {
+ // 有的 App 边输入边刷新输入框,会吞掉一部分字(高德搜索框「故宫博物院」只剩「故宫博」),WDA 照样报成功:
+ // 输完读回输入框核对,少了结尾几个字就补上;对不上就不按回车
+ let note = match verify_typed(w, text).await {
+ Typed::Ok | Typed::Unknown => String::new(),
+ Typed::Fixed(k) => format!("(第一次有 {k} 个字没输进去,已补上)"),
+ Typed::Mismatch(now) => {
+ return Err(format!(
+ "输入了 {n} 个字符,但输入框里现在是「{now}」,和要输入的「{text}」对不上(App 可能吞掉了部分字符){};截图确认后再处理",
+ if submit { ",没有按回车" } else { "" }
+ ));
+ }
+ };
+ if submit {
+ w.keys("\n").await.map_err(|e| format!("文字已输入{note},按回车失败:{e}"))?;
+ }
+ return Ok(format!("已输入 {n} 个字符{note}{}", if submit { ",并按了回车" } else { "" }));
+ }
Err(WdaError::Unavailable(_)) => {}
Err(e) => return Err(e.to_string()),
}
}
+ let payload = if submit { format!("{text}\n") } else { text.to_owned() };
// 先检查,一个都不输;不打开 HID 会话
if let Some(c) = payload.chars().find(|c| ascii_to_usage(*c).is_none()) {
return Err(format!("WDA 不可用,HID 只能输入美式键盘上的英文和符号,不能输入 {c:?}"));
}
- let p = payload.clone();
- self.hid_do(g, move |h| Box::pin(async move { h.type_ascii(&p).await })).await?;
+ self.hid_do(g, move |h| Box::pin(async move { h.type_ascii(&payload).await })).await?;
Ok(format!("已输入 {n} 个字符(经 HID)"))
}
@@ -466,14 +565,12 @@ impl Daemon {
let bid = self.resolve_app(g, app).await?;
self.ensure_unlocked(g).await?;
let w = self.require_wda(g)?;
- if w.launch_app(&bid).await.map_err(|e| e.to_string())? {
- return Ok(format!("已启动 {bid}"));
- }
- Ok(match w.alert_text().await {
- Ok(Some(text)) => {
+ Ok(match w.launch_app(&bid).await.map_err(|e| e.to_string())? {
+ Launch::Foreground => format!("已启动 {bid}"),
+ Launch::Blocked(text) => {
format!("已启动 {bid},但屏幕上有系统弹窗「{text}」挡着;先用 iphone_tap_element 点弹窗上的按钮")
}
- _ => format!("已启动 {bid},但 8 秒内没到前台(可能启动慢),先截图确认"),
+ Launch::Slow => format!("已启动 {bid},但 8 秒内没到前台(可能启动慢),先截图确认"),
})
}
@@ -490,3 +587,190 @@ impl Daemon {
Ok(format!("已打开 {url}"))
}
}
+
+/// 屏幕中间(上下各去掉一段,留给导航栏、标签栏)几乎没有元素:加载中、空白页
+fn middle_is_empty(tree: &Tree, screen_h: f64) -> bool {
+ let (top, bottom) = ((screen_h * 0.25) as i64, (screen_h * 0.85) as i64);
+ tree.elements.iter().filter(|e| e.center.1 > top && e.center.1 < bottom).count() <= 1
+}
+
+/// 滑动后等列表停下(最多 [`SCROLL_SETTLE`]):沿滑动方向的位置连续两次差不超过 [`STILL_TOLERANCE`]。
+/// 没停下返回提醒;元素很少(游戏、地图)看不出来,不等
+async fn wait_scrolled(w: &mut WdaClient<DeviceTransport>, vertical: bool) -> String {
+ if w.begin_polling().await.is_err() {
+ return String::new();
+ }
+ let t0 = Instant::now();
+ let r: Result<bool, WdaError> = async {
+ let mut prev = w.tree().await?;
+ if prev.elements.len() < VISUAL_SETTLE_BELOW {
+ return Ok(true);
+ }
+ while t0.elapsed() < SCROLL_SETTLE {
+ tokio::time::sleep(Duration::from_millis(30)).await;
+ let cur = w.tree().await?;
+ if cur.still_along(&prev, vertical, STILL_TOLERANCE) {
+ return Ok(true);
+ }
+ prev = cur;
+ }
+ Ok(false)
+ }
+ .await;
+ w.end_polling().await;
+ match r {
+ Ok(false) => format!("({:.1} 秒后列表还在动,可能还在滚动)", SCROLL_SETTLE.as_secs_f64()),
+ _ => String::new(),
+ }
+}
+
+/// 轮询元素树直到连续两次一样(位置差不超过 [`STILL_TOLERANCE`],且没有加载圈)或到 `max`。返回第一次读到的树,以及 (结果说明, 最后的树);
+/// 第一次读到的元素很少(游戏、地图)时第二项是 None,由调用方改看画面。
+/// 不中途丢弃请求:丢掉的请求手机上仍在执行,后面的请求要排在它后面
+async fn poll_stable(
+ w: &mut WdaClient<DeviceTransport>,
+ t0: Instant,
+ max: Duration,
+) -> Result<(Tree, Option<(String, Tree)>), String> {
+ let first = w.tree().await.map_err(|e| e.to_string())?;
+ if first.elements.len() < VISUAL_SETTLE_BELOW {
+ return Ok((first, None));
+ }
+ let mut prev = first.clone();
+ let msg = loop {
+ if t0.elapsed() >= max {
+ break if prev.loading {
+ format!(
+ "{:.1} 秒内页面一直在加载(有加载圈),按最后的状态返回;要等结果出来用 iphone_wait_for",
+ max.as_secs_f64()
+ )
+ } else {
+ format!("{:.1} 秒内界面一直在变(可能有动画),按最后的状态返回", max.as_secs_f64())
+ };
+ }
+ // 一次读树本身约 0.2 秒,两次之间不用再多等
+ tokio::time::sleep(Duration::from_millis(30)).await;
+ let cur = w.tree().await.map_err(|e| e.to_string())?;
+ let same = cur.close_to(&prev, STILL_TOLERANCE);
+ prev = cur;
+ if same && !prev.loading {
+ break format!("界面已稳定({:.1} 秒)", t0.elapsed().as_secs_f64());
+ }
+ };
+ Ok((first, Some((msg, prev))))
+}
+
+fn alert_msg(text: &str) -> String {
+ format!("\n注意:屏幕上有系统弹窗「{text}」挡着,点击、滑动都会落在弹窗上;先用 iphone_tap_element 点弹窗上的按钮")
+}
+
+/// 树里有弹窗就返回提醒
+fn alert_note(tree: &Tree) -> String {
+ match tree.alert() {
+ Some(a) => {
+ let title = [&a.label, &a.name].into_iter().find(|s| !s.is_empty()).cloned().unwrap_or_default();
+ format!("\n注意:屏幕上有弹窗「{title}」,先点弹窗上的按钮(见元素列表或截图)")
+ }
+ None => String::new(),
+ }
+}
+
+/// 输入后核对的结果
+#[derive(Debug, PartialEq)]
+enum Typed {
+ Ok,
+ /// 核对不了:没读到输入框、有密码框、或读树失败
+ Unknown,
+ /// 结尾有几个字没输进去,已补上
+ Fixed(usize),
+ /// 对不上(输入框里现在的内容)
+ Mismatch(String),
+}
+
+fn squash(s: &str) -> String {
+ s.chars().filter(|c| !c.is_whitespace()).collect()
+}
+
+/// 输入框里的内容有没有包含刚输入的文字(忽略空白:手机号之类会被自动加空格)
+fn typed_into(values: &[String], text: &str) -> bool {
+ let want = squash(text);
+ values.iter().any(|v| squash(v).contains(&want))
+}
+
+/// 输入框结尾是 `text` 的前几个字(后面的丢了):返回输进去了几个字
+fn typed_prefix(values: &[String], text: &str) -> Option<usize> {
+ let chars: Vec<char> = text.chars().collect();
+ values
+ .iter()
+ .filter_map(|v| {
+ let v = squash(v);
+ (1..chars.len()).rev().find(|&k| {
+ let p = squash(&chars[..k].iter().collect::<String>());
+ !p.is_empty() && v.ends_with(&p)
+ })
+ })
+ .max()
+}
+
+async fn verify_typed(w: &mut WdaClient<DeviceTransport>, text: &str) -> Typed {
+ if squash(text).is_empty() {
+ return Typed::Unknown;
+ }
+ let mut values = None;
+ // 树可能比输入框慢一拍:第一次对不上隔一下再读一次,确认真的少了再补,免得补重
+ for attempt in 0..2 {
+ if attempt > 0 {
+ tokio::time::sleep(Duration::from_millis(300)).await;
+ }
+ let Some(v) = w.elements().await.ok().and_then(|e| elements::field_values(&e)) else { return Typed::Unknown };
+ if v.is_empty() {
+ return Typed::Unknown;
+ }
+ if typed_into(&v, text) {
+ return Typed::Ok;
+ }
+ values = Some(v);
+ }
+ let values = values.unwrap_or_default();
+ let shown = || values.iter().find(|v| !v.is_empty()).cloned().unwrap_or_default();
+ let Some(k) = typed_prefix(&values, text) else { return Typed::Mismatch(shown()) };
+ // 剩下的一个字一个字慢慢补
+ let rest: Vec<char> = text.chars().skip(k).collect();
+ for c in &rest {
+ if w.keys(&c.to_string()).await.is_err() {
+ return Typed::Mismatch(shown());
+ }
+ tokio::time::sleep(Duration::from_millis(150)).await;
+ }
+ match w.elements().await.ok().and_then(|e| elements::field_values(&e)) {
+ Some(v) if typed_into(&v, text) => Typed::Fixed(rest.len()),
+ Some(v) => Typed::Mismatch(v.into_iter().find(|v| !v.is_empty()).unwrap_or_default()),
+ None => Typed::Unknown,
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ fn v(s: &[&str]) -> Vec<String> {
+ s.iter().map(|x| x.to_string()).collect()
+ }
+
+ #[test]
+ fn typed_text_is_found_ignoring_spaces() {
+ assert!(typed_into(&v(&["搜索", "红烧肉做法"]), "红烧肉做法"));
+ assert!(typed_into(&v(&["130 1234 5678"]), "13012345678"));
+ assert!(!typed_into(&v(&["故宫博"]), "故宫博物院"));
+ }
+
+ #[test]
+ fn dropped_tail_is_detected_after_existing_text() {
+ assert_eq!(typed_prefix(&v(&["故宫博"]), "故宫博物院"), Some(3));
+ // 输入框原来就有字
+ assert_eq!(typed_prefix(&v(&["abc故宫"]), "故宫博物院"), Some(2));
+ // 一个字都没进去(或者是占位文字):不猜,报对不上
+ assert_eq!(typed_prefix(&v(&["搜索"]), "故宫博物院"), None);
+ assert_eq!(typed_prefix(&v(&[""]), "故宫"), None);
+ }
+}
diff --git a/crates/ictl-mcp/src/lib.rs b/crates/ictl-mcp/src/lib.rs
index 1e74efc..48ff701 100644
--- a/crates/ictl-mcp/src/lib.rs
+++ b/crates/ictl-mcp/src/lib.rs
@@ -96,7 +96,7 @@ pub fn tools() -> Vec<Tool> {
),
t(
"iphone_list_elements",
- "列出屏幕上带文字的界面元素:类型、标签、中心点坐标、尺寸。\n\nfilter: 只返回标签/名字/值里包含该文字的元素(不区分大小写)。\n注意:按坐标判断是否在屏幕内,被弹窗遮住的元素也可能列出来,不确定时截图核对。",
+ "列出屏幕上带文字的界面元素:类型、标签、中心点坐标、尺寸。\n\nfilter: 只返回类型/标签/名字/值里包含该文字的元素(不区分大小写),例如 SearchField、Button。\n注意:按坐标判断是否在屏幕内,被弹窗遮住的元素也可能列出来,不确定时截图核对。",
schema(
json!({"filter": {"type": "string", "default": ""}, "limit": {"type": "integer", "default": 150}}),
&[],
@@ -109,7 +109,7 @@ pub fn tools() -> Vec<Tool> {
),
t(
"iphone_tap_element",
- "按文字点击元素:先找标签/名字完全相同的,找不到再找包含该文字的。\n\nindex: 匹配到多个时点第几个(从 0 开始,顺序同 iphone_list_elements)。",
+ "按文字点击元素:先找标签/名字完全相同的,找不到再找包含该文字的。中心被悬浮栏、键盘等盖住时改点没被盖住的部分,整个被盖住就不点。\n\nindex: 匹配到多个时点第几个(从 0 开始,顺序同 iphone_list_elements)。",
schema(
with_then(json!({"text": {"type": "string"}, "index": {"type": "integer", "default": 0}})),
&["text"],
@@ -135,7 +135,7 @@ pub fn tools() -> Vec<Tool> {
),
t(
"iphone_type_text",
- "在当前获得焦点的输入框里输入文字(支持中文)。需要先点中输入框。submit=True 时末尾按回车。",
+ "在当前获得焦点的输入框里输入文字(支持中文)。需要先点中输入框。submit=True 时末尾按回车。\n输完会读回输入框核对:少了结尾几个字会自动补上;对不上就报错,不按回车。",
schema(
with_then(json!({"text": {"type": "string"}, "submit": {"type": "boolean", "default": false}})),
&["text"],
@@ -171,7 +171,7 @@ pub fn tools() -> Vec<Tool> {
),
t(
"iphone_wait_for",
- "等包含某段文字的界面元素出现(例如页面加载完、弹窗出现),出现就立即返回;超时报错。代替反复截图轮询。",
+ "等包含某段文字的界面元素出现(例如页面加载完、弹窗出现),出现就立即返回;超时报错。代替反复截图轮询。输入框里的字不算。",
schema(
json!({"text": {"type": "string"}, "timeout": {"type": "number", "default": 5, "description": "最多等几秒(不超过 30)"}}),
&["text"],
@@ -373,9 +373,15 @@ pub fn batch_steps(args: &Map<String, Value>) -> Result<Vec<Step>, String> {
.collect()
}
-/// tap_element 的结果是不是「没点到」(没找到、或 index 超出匹配个数)
+/// tap_element 的结果是不是「没点到」(没找到、index 超出匹配个数、或整个被别的东西盖住)
pub fn tap_missed(text: &str) -> bool {
- text.starts_with("没找到") || text.starts_with("只匹配到")
+ text.starts_with("没找到") || text.starts_with("只匹配到") || text.starts_with("被挡住")
+}
+
+/// 不带 then 的操作做完后要不要查系统弹窗(弹窗挡着时操作都落在弹窗上,WDA 照样报成功)。
+/// 按键自己处理(Home 先查弹窗;锁屏后不用查),结束 App 后前台是主屏,不会冒出新弹窗
+pub fn wants_alert_check(req: &Request) -> bool {
+ req.is_device_action() && !matches!(req, Request::PressButton { .. } | Request::TerminateApp { .. })
}
/// 守护进程响应 → MCP 结果。错误走工具错误(is_error),文字原样给客户端
@@ -427,8 +433,8 @@ impl ServerHandler for McpServer {
// then 只对操作类工具有意义;看界面的工具本身就是返回界面
let resp = self.call(&req).await;
Ok(match resp {
- Response::Text { text } if req.is_device_action() && then.then != Then::None => {
- self.finish(text, false, then).await
+ Response::Text { text } if req.is_device_action() => {
+ self.finish(text, false, then, wants_alert_check(&req)).await
}
resp => to_result(resp),
}
@@ -444,13 +450,21 @@ impl McpServer {
})
}
- /// 操作完成后:按 then 等界面稳定,再附上元素列表或截图
- async fn finish(&self, mut text: String, failed: bool, opts: ThenOpts) -> CallToolResult {
+ /// 操作完成后:按 then 等界面稳定,再附上元素列表或截图(等稳定时顺带提醒弹窗)。
+ /// 不带 then 时,`alert_check` 为真就查一下有没有系统弹窗挡着
+ async fn finish(&self, mut text: String, failed: bool, opts: ThenOpts, alert_check: bool) -> CallToolResult {
let done = |blocks: Vec<ContentBlock>| {
if failed { CallToolResult::error(blocks) } else { CallToolResult::success(blocks) }
};
let then = opts.then;
if then == Then::None {
+ // 结果里已经说了有弹窗(启动 App 被挡)就不再查
+ if alert_check
+ && !text.contains("系统弹窗")
+ && let Response::Text { text: t } = self.call(&Request::AlertCheck).await
+ {
+ text += &t;
+ }
return done(vec![ContentBlock::text(text)]);
}
match self.call(&Request::Settle { max_ms: opts.settle_ms }).await {
@@ -490,6 +504,8 @@ impl McpServer {
};
let total = steps.len();
let mut lines = Vec::new();
+ // 最后一步是不是需要查弹窗的操作
+ let mut check = false;
for (i, step) in steps.into_iter().enumerate() {
let n = i + 1;
match step {
@@ -504,21 +520,24 @@ impl McpServer {
if n < total {
lines.push(format!("第 {n} 步没点到,后面 {} 步没有执行", total - n));
}
- return self.finish(lines.join("\n"), true, then).await;
+ return self.finish(lines.join("\n"), true, then, false).await;
+ }
+ Response::Text { text } => {
+ lines.push(format!("{n}. {tool} → {text}"));
+ check = wants_alert_check(&req);
}
- Response::Text { text } => lines.push(format!("{n}. {tool} → {text}")),
Response::Image { caption, .. } => lines.push(format!("{n}. {tool} → {caption}")),
Response::Error { message } => {
lines.push(format!("{n}. {tool} → 出错:{message}"));
if n < total {
lines.push(format!("第 {n} 步出错,后面 {} 步没有执行", total - n));
}
- return self.finish(lines.join("\n"), true, then).await;
+ return self.finish(lines.join("\n"), true, then, true).await;
}
},
}
}
- self.finish(lines.join("\n"), false, then).await
+ self.finish(lines.join("\n"), false, then, check).await
}
}
@@ -537,6 +556,15 @@ mod tests {
v.as_object().cloned().unwrap()
}
+ #[test]
+ fn alert_check_after_actions_but_not_buttons_or_reads() {
+ assert!(wants_alert_check(&Request::Swipe { from: (0.0, 0.0), to: (1.0, 1.0), seconds: 0.3 }));
+ assert!(wants_alert_check(&Request::LaunchApp { app: "微信".into() }));
+ assert!(!wants_alert_check(&Request::PressButton { button: "home".into() }));
+ assert!(!wants_alert_check(&Request::TerminateApp { app: "微信".into() }));
+ assert!(!wants_alert_check(&Request::Status));
+ }
+
#[test]
fn toolkit_tools_plus_wait_for_and_batch() {
let names: Vec<_> = tools().iter().map(|t| t.name.to_string()).collect();
@@ -663,6 +691,8 @@ mod tests {
assert!(tap_missed("没找到包含 \"x\" 的元素,先用 iphone_list_elements 或截图看看屏幕"));
assert!(tap_missed("只匹配到 1 个:\nButton \"x\""));
assert!(!tap_missed("已点击 Button \"x\""));
+ assert!(tap_missed("被挡住:Button \"x\" 整个被「浮层」盖住,没有点"));
+ assert!(!tap_missed("已点击 Button \"x\";它的中心被「搜索」盖住,改点没被盖住的 (215,848)"));
}
#[test]
diff --git a/crates/ictl-protocol/src/lib.rs b/crates/ictl-protocol/src/lib.rs
index 5fa63f3..193e16b 100644
--- a/crates/ictl-protocol/src/lib.rs
+++ b/crates/ictl-protocol/src/lib.rs
@@ -66,6 +66,8 @@ pub enum Request {
Settle {
max_ms: u64,
},
+ /// 查屏幕上有没有挡着的系统弹窗:有就返回提醒文字,没有返回空文字。不带 then 的操作做完后调
+ AlertCheck,
/// 等包含 `text` 的元素出现,最多等 `timeout_ms`(代替 agent 反复截图轮询)
WaitFor {
text: String,
diff --git a/crates/ictl-wda/src/client.rs b/crates/ictl-wda/src/client.rs
index 1a2c055..a1ee250 100644
--- a/crates/ictl-wda/src/client.rs
+++ b/crates/ictl-wda/src/client.rs
@@ -64,9 +64,26 @@ impl IdleSettings {
pub const DEFAULT: Self = Self { wait_for_idle_timeout: 10.0, animation_cool_off_timeout: 2.0 };
/// 临时调小的值(0 会导致锁屏唤醒失败,所以不是 0)
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 秒(惯性滚动期间一直等)
+ /// - 滑完马上读元素树:冷却 0 约 0.2 秒;默认约 2.2 秒;0.2 秒要约 18 秒
+ pub const NO_COOL_OFF: Self = Self { wait_for_idle_timeout: 1.0, animation_cool_off_timeout: 0.0 };
}
const SPRINGBOARD: &str = "com.apple.springboard";
+/// 启动 App 后至少过这么久才返回:App 切到前台的放大动画约 0.5 秒,期间的点击会被吞
+const LAUNCH_MIN: Duration = Duration::from_millis(800);
+
+/// [`WdaClient::launch_app`] 的结果
+#[derive(Debug, Clone, PartialEq)]
+pub enum Launch {
+ /// 到了前台
+ Foreground,
+ /// 系统弹窗挡着(弹窗文字)
+ Blocked(String),
+ /// 8 秒内没到前台,也没有弹窗
+ Slow,
+}
/// [`WdaClient::check_lock`] 的结果
#[derive(Debug)]
@@ -262,8 +279,13 @@ impl<T: Transport> WdaClient<T> {
}
pub async fn elements(&mut self) -> Result<Vec<elements::Element>> {
+ Ok(self.tree().await?.elements)
+ }
+
+ /// 元素树,带上「谁盖住谁」「有没有加载圈」等信息
+ pub async fn tree(&mut self) -> Result<elements::Tree> {
let screen = self.screen_size().await?;
- Ok(elements::parse(&self.source_xml().await?, screen))
+ Ok(elements::parse_tree(&self.source_xml().await?, screen))
}
/// 点击:一个 W3C actions 单指手势(按下 50ms),期间把等待设置临时调小。真机计时(iOS 27):
@@ -273,30 +295,53 @@ impl<T: Transport> WdaClient<T> {
///
/// 和 `/wda/tap` 一样不等点击引起的动画结束,调用方要看结果就再截图
pub async fn tap(&mut self, x: f64, y: f64) -> Result<()> {
- self.quick_gesture(&tap_steps(x, y, TAP_PRESS_MS)).await
+ self.quick_gesture(&tap_steps(x, y, TAP_PRESS_MS), IdleSettings::QUICK).await
}
/// 长按:按下、停 `seconds` 秒、抬起,一个 actions 手势。`/wda/touchAndHold` 前后都等界面空闲,
/// 真机上主屏长按图标 1.2 秒要约 12 秒才返回
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)).await
- }
-
- /// 发一个手势,期间把等待设置临时调小(见 [`Self::tap`]),做完恢复
- async fn quick_gesture(&mut self, steps: &[PointerStep]) -> Result<()> {
- let baseline = match self.idle_baseline {
- Some(b) => b,
- None => {
- // 上次没恢复成功的话读到的就是调小的值:按 WDA 默认值算
- let b = match self.idle_settings().await? {
- s if s == IdleSettings::QUICK => IdleSettings::DEFAULT,
- s => s,
- };
- self.idle_baseline = Some(b);
- b
- }
+ self.quick_gesture(&tap_steps(x, y, (seconds * 1000.0) as u64), IdleSettings::QUICK).await
+ }
+
+ /// 滑动:一个 actions 手势,期间用 [`IdleSettings::NO_COOL_OFF`]。做完时列表可能还在惯性滚动,
+ /// 要看结果的调用方自己等界面稳定
+ pub async fn swipe(&mut self, from: (f64, f64), to: (f64, f64), ms: u64) -> Result<()> {
+ self.quick_gesture(&swipe_steps(from, to, ms), IdleSettings::NO_COOL_OFF).await
+ }
+
+ /// 开始轮询界面:读元素树时不等界面空闲、动画冷却(约 0.2 秒一次),由调用方比较前后两次判断稳定。
+ /// 用完调 [`Self::end_polling`] 恢复
+ pub async fn begin_polling(&mut self) -> Result<()> {
+ self.baseline().await?;
+ self.set_idle_settings(IdleSettings::NO_COOL_OFF).await
+ }
+
+ pub async fn end_polling(&mut self) {
+ let b = self.idle_baseline.unwrap_or(IdleSettings::DEFAULT);
+ if let Err(e) = self.set_idle_settings(b).await {
+ tracing::warn!("轮询后恢复 WDA 等待设置失败:{e}");
+ }
+ }
+
+ /// 平时的等待设置(第一次用时读一次)
+ async fn baseline(&mut self) -> Result<IdleSettings> {
+ if let Some(b) = self.idle_baseline {
+ return Ok(b);
+ }
+ // 上次没恢复成功的话读到的就是调小的值:按 WDA 默认值算
+ let b = match self.idle_settings().await? {
+ s if s == IdleSettings::QUICK || s == IdleSettings::NO_COOL_OFF => IdleSettings::DEFAULT,
+ s => s,
};
- self.set_idle_settings(IdleSettings::QUICK).await?;
+ self.idle_baseline = Some(b);
+ Ok(b)
+ }
+
+ /// 发一个手势,期间把等待设置临时换成 `during`(见 [`Self::tap`]),做完恢复
+ async fn quick_gesture(&mut self, steps: &[PointerStep], during: IdleSettings) -> Result<()> {
+ let baseline = self.baseline().await?;
+ self.set_idle_settings(during).await?;
let r = self.actions(steps).await;
if let Err(e) = self.set_idle_settings(baseline).await {
tracing::warn!("手势后恢复 WDA 等待设置失败:{e}");
@@ -339,34 +384,54 @@ impl<T: Transport> WdaClient<T> {
self.post("/wda/lock", json!({})).await.map(drop)
}
- /// 启动并等到前台、界面稳定(冷启动后立即点击会被吞)。返回 8 秒内是否到了前台;
+ /// 启动并等到前台、界面稳定(冷启动后立即点击会被吞),最多等 8 秒。
/// 等待期间查前台出错不算失败(启动命令已经成功了)
- pub async fn launch_app(&mut self, bundle_id: &str) -> Result<bool> {
+ pub async fn launch_app(&mut self, bundle_id: &str) -> Result<Launch> {
+ let started = tokio::time::Instant::now();
self.in_session("POST", "/wda/apps/launch", Some(json!({"bundleId": bundle_id})), Duration::from_secs(60))
.await?;
- let deadline = tokio::time::Instant::now() + Duration::from_secs(8);
+ let t0 = tokio::time::Instant::now();
+ let deadline = t0 + Duration::from_secs(8);
let mut foreground = false;
while tokio::time::Instant::now() < deadline {
- if self.active_app().await.is_ok_and(|a| a == bundle_id) {
- foreground = true;
- break;
+ match self.active_app().await {
+ Ok(a) if a == bundle_id => {
+ foreground = true;
+ break;
+ }
+ // 系统弹窗(权限请求)挡着时前台一直是 SpringBoard,原来要白等满 8 秒。
+ // 刚启动的一瞬间前台也还是 SpringBoard,过 1 秒还是才去查弹窗(查一次约 0.4 秒)
+ Ok(a) if a == SPRINGBOARD && bundle_id != SPRINGBOARD && t0.elapsed() >= Duration::from_secs(1) => {
+ if let Ok(Some(text)) = self.alert_text().await {
+ return Ok(Launch::Blocked(text));
+ }
+ }
+ _ => {}
}
tokio::time::sleep(Duration::from_millis(500)).await;
}
+ if !foreground {
+ return Ok(match self.alert_text().await {
+ Ok(Some(text)) => Launch::Blocked(text),
+ _ => Launch::Slow,
+ });
+ }
// 冷启动后立即点击会被吞(回归用例 #13)。原来固定再等 1 秒;改为等界面稳定:连续两次元素树一样
// (读元素树时 WDA 本身也等界面空闲),最多仍是 1 秒
- if foreground {
- let deadline = tokio::time::Instant::now() + Duration::from_secs(1);
- let mut prev = None;
- while tokio::time::Instant::now() < deadline {
- let cur = self.source_xml().await.ok();
- if cur.is_some() && cur == prev {
- break;
- }
- prev = cur;
+ let deadline = tokio::time::Instant::now() + Duration::from_secs(1);
+ let mut prev = None;
+ while tokio::time::Instant::now() < deadline {
+ let cur = self.source_xml().await.ok();
+ if cur.is_some() && cur == prev {
+ break;
}
+ prev = cur;
+ }
+ // 切回已在后台的 App 时元素树马上就稳定了(约 0.4 秒),放大进场的动画还没完,这时点击会被吞(真机:小红书、高德各一次)
+ if let Some(left) = LAUNCH_MIN.checked_sub(started.elapsed()) {
+ tokio::time::sleep(left).await;
}
- Ok(foreground)
+ Ok(Launch::Foreground)
}
pub async fn terminate_app(&mut self, bundle_id: &str) -> Result<()> {
diff --git a/crates/ictl-wda/src/elements.rs b/crates/ictl-wda/src/elements.rs
index 53a3867..bfb876a 100644
--- a/crates/ictl-wda/src/elements.rs
+++ b/crates/ictl-wda/src/elements.rs
@@ -3,7 +3,10 @@
//! - 只保留有 label/name/value 的元素
//! - 按坐标判断是否在屏幕内(请求时排除了 WDA 的可见性计算:完整树 7~8 秒,排除后约 0.3 秒)
//! - 铺满全屏的 Application/Window 之类去掉;父子重复(同文字同位置)去重
-//! - 点击中心取元素在屏幕内的部分
+//! - 按钮、单元格里重复按钮文字的子文字、按钮里的图标、滚动条、状态栏、只有开发者标识的容器和图片去掉
+//! (只占 token,按名字点按钮本身就行)
+//! - 小组件里的元素 WDA 给的是相对小组件的坐标,换算成屏幕坐标
+//! - 点击中心取元素在屏幕内的部分;中心被后面(上层)的东西盖住时另找没被盖住的点([`Tree::tap_point`])
//! - 锁屏密码键盘的 `Key` 元素不显示时也在树里,**不能**据此判断键盘已出现
use ictl_device::ScreenSize;
@@ -13,7 +16,22 @@ use quick_xml::{XmlVersion, events::Event};
pub const SOURCE_EXCLUDED: &str =
"visible,accessible,focused,enabled,selected,index,traits,placeholderValue,hittable,customActions,nativeFrame";
-#[derive(Debug, Clone, PartialEq)]
+/// 屏幕坐标下的矩形(点)
+#[derive(Debug, Clone, Copy, PartialEq, Default)]
+pub struct Rect {
+ pub x: f64,
+ pub y: f64,
+ pub w: f64,
+ pub h: f64,
+}
+
+impl Rect {
+ fn contains(&self, (px, py): (f64, f64)) -> bool {
+ px >= self.x && px < self.x + self.w && py >= self.y && py < self.y + self.h
+ }
+}
+
+#[derive(Debug, Clone, Default)]
pub struct Element {
pub kind: String,
pub label: String,
@@ -21,6 +39,177 @@ pub struct Element {
pub value: String,
pub center: (i64, i64),
pub size: (i64, i64),
+ /// 在屏幕内的部分(屏幕坐标)
+ pub visible: Rect,
+ /// 在整棵树里的先后序号:(自己, 最后一个后代)。后出现的画在上层
+ span: (usize, usize),
+ /// 在哪一层,判断谁能盖住它(见 [`Tree::tap_point`])
+ layer: Layer,
+ /// 最近的栏、键盘、弹窗、面板祖先(含自己)的序号;0 = 没有。同一个栏/弹窗里的东西互相不算盖住
+ group: usize,
+}
+
+/// 元素所在的层
+#[derive(Debug, Clone, Copy, Default, PartialEq)]
+enum Layer {
+ /// 普通界面
+ #[default]
+ Plain,
+ /// 可滚动的内容里(列表、网页)
+ Scroll,
+ /// 导航栏、工具栏、标签栏里
+ Bar,
+}
+
+/// 只比看得见的内容:等界面稳定时比较前后两棵树,不因没有文字的节点增减而算「变了」
+impl PartialEq for Element {
+ fn eq(&self, o: &Self) -> bool {
+ (&self.kind, &self.label, &self.name, &self.value, self.center, self.size)
+ == (&o.kind, &o.label, &o.name, &o.value, o.center, o.size)
+ }
+}
+
+/// 可能盖住别的元素的东西,包括没有文字的容器(例如悬浮搜索栏的底板、键盘)。
+/// 可滚动内容里的节点不算(单元格的背景层、滚到导航栏底下的行)
+#[derive(Debug, Clone, PartialEq)]
+struct Blocker {
+ span: (usize, usize),
+ rect: Rect,
+ /// 在工具栏、标签栏、键盘、弹窗、面板里(浮在内容上面的层)
+ floating: bool,
+ /// 在键盘、弹窗、面板里(能盖住导航栏的)
+ modal: bool,
+ /// 同 [`Element::group`]
+ group: usize,
+ /// 自己或第一个有文字的后代的文字,用来告诉调用方是什么挡着
+ name: String,
+}
+
+/// 解析后的元素树
+#[derive(Debug, Clone, Default)]
+pub struct Tree {
+ pub elements: Vec<Element>,
+ blockers: Vec<Blocker>,
+ /// 屏幕上有转圈的加载指示(ActivityIndicator,有没有文字都算)
+ pub loading: bool,
+}
+
+impl PartialEq for Tree {
+ fn eq(&self, o: &Self) -> bool {
+ self.elements == o.elements && self.loading == o.loading
+ }
+}
+
+/// 按名字点击时实际点哪里
+#[derive(Debug, Clone, PartialEq)]
+pub enum TapPoint {
+ Center((f64, f64)),
+ /// 中心被 `by` 盖住,改点元素里没被盖住的 `at`
+ Moved {
+ at: (f64, f64),
+ by: String,
+ },
+ /// 整个都被 `by` 盖住
+ Covered {
+ by: String,
+ },
+}
+
+impl Tree {
+ /// 和另一棵树看起来一样:元素一一对应、文字相同,位置最多差 `tol` 点。
+ /// 列表惯性滚动的尾巴每次只挪一两点,按完全相同判断要多等一两秒
+ pub fn close_to(&self, o: &Tree, tol: i64) -> bool {
+ self.loading == o.loading
+ && self.elements.len() == o.elements.len()
+ && self.elements.iter().zip(&o.elements).all(|(a, b)| {
+ (&a.kind, &a.label, &a.name, &a.value, a.size) == (&b.kind, &b.label, &b.name, &b.value, b.size)
+ && (a.center.0 - b.center.0).abs() <= tol
+ && (a.center.1 - b.center.1).abs() <= tol
+ })
+ }
+
+ /// 滑动后判断列表停没停:只看沿滑动方向(`vertical`)的位置,不看值和另一个方向。
+ /// 网页里自动轮播的图、播放进度一直在变,但列表已经停了
+ pub fn still_along(&self, o: &Tree, vertical: bool, tol: i64) -> bool {
+ self.elements.len() == o.elements.len()
+ && self.elements.iter().zip(&o.elements).all(|(a, b)| {
+ let (pa, pb) = if vertical { (a.center.1, b.center.1) } else { (a.center.0, b.center.0) };
+ (&a.kind, &a.label, &a.name) == (&b.kind, &b.label, &b.name) && (pa - pb).abs() <= tol
+ })
+ }
+
+ /// 弹窗(系统权限弹窗、App 自己的提示框)
+ pub fn alert(&self) -> Option<&Element> {
+ self.elements.iter().find(|e| e.kind == "Alert")
+ }
+
+ /// 点 `e` 时落在哪。WDA 不给可见性(太慢),只能按位置推:树里在它后面出现、又不是它后代、并且能盖住它的东西
+ /// 画在它上面。单靠树里的先后会误判(单元格里的背景层排在按钮后面;导航栏排在滚到它底下的内容前面),所以按层限定:
+ /// - 栏里的元素只会被键盘、弹窗、面板盖住
+ /// - 可滚动内容里的元素会被内容外面的任何东西盖住(悬浮栏、浮层横幅)
+ /// - 其他元素只会被浮在上面的层(工具栏、标签栏、键盘、弹窗、面板)盖住
+ pub fn tap_point(&self, e: &Element) -> TapPoint {
+ let can_cover = |b: &Blocker| {
+ (e.group == 0 || b.group != e.group)
+ && match e.layer {
+ Layer::Bar => b.modal,
+ Layer::Scroll => true,
+ Layer::Plain => b.floating,
+ }
+ };
+ let cover =
+ |p: (f64, f64)| self.blockers.iter().find(|b| b.span.0 > e.span.1 && can_cover(b) && b.rect.contains(p));
+ let center = (e.center.0 as f64, e.center.1 as f64);
+ let Some(first) = cover(center) else { return TapPoint::Center(center) };
+ let v = e.visible;
+ let inset = (v.w / 4.0).min(v.h / 4.0).min(4.0);
+ let along =
+ |start: f64, len: f64, n: usize, i: usize| start + inset + (len - 2.0 * inset) * i as f64 / (n - 1) as f64;
+ let mut points: Vec<(f64, f64)> = (0..7)
+ .flat_map(|i| (0..5).map(move |j| (i, j)))
+ .map(|(i, j)| (along(v.x, v.w, 7, i), along(v.y, v.h, 5, j)))
+ .collect();
+ let d = |p: &(f64, f64)| (p.0 - center.0).powi(2) + (p.1 - center.1).powi(2);
+ points.sort_by(|a, b| d(a).total_cmp(&d(b)));
+ let by = if first.name.is_empty() { "没有文字的浮层".to_owned() } else { first.name.clone() };
+ match points.into_iter().find(|p| cover(*p).is_none()) {
+ Some(p) => TapPoint::Moved { at: (p.0.round(), p.1.round()), by },
+ None => TapPoint::Covered { by },
+ }
+ }
+}
+
+/// 底部悬浮工具栏/标签栏(iOS 26 起的玻璃栏)实际接收点击的范围比元素树给的框往外多约 20 点。
+/// 真机:设置首页搜索栏底板顶边 856,点 834 还能进下面那一行,838 就被栏吞掉(什么都不发生);
+/// 左右两边按同样的余量算
+const BAR_SLOP: f64 = 24.0;
+
+/// 可滚动的内容区
+const SCROLLERS: [&str; 5] = ["ScrollView", "Table", "CollectionView", "WebView", "TextView"];
+/// 盖在一切之上的层
+const MODALS: [&str; 4] = ["Keyboard", "Alert", "Sheet", "Popover"];
+/// 自成一组的层:组里的东西互相不算盖住(弹窗按钮后面排着弹窗自己的背景层)
+const GROUPS: [&str; 7] = ["Toolbar", "TabBar", "NavigationBar", "Keyboard", "Alert", "Sheet", "Popover"];
+
+/// 输入框类元素
+const EDITABLE: [&str; 4] = ["TextField", "SearchField", "TextView", "SecureTextField"];
+/// 子元素的文字已经包含在它们的文字里时,子元素不再单列
+const CONTAINERS: [&str; 10] =
+ ["Button", "Cell", "Link", "Icon", "MenuItem", "SearchField", "TextField", "Switch", "Tab", "Key"];
+
+/// 只有开发者起的标识、没有给人看的文字:`label-view`、`launch_logo`、UUID 之类
+fn looks_like_identifier(s: &str) -> bool {
+ s.len() >= 3 && s.is_ascii() && !s.contains(char::is_whitespace) && s.contains(['_', '-', '.', ':'])
+}
+
+fn is_scroll_bar(kind: &str, label: &str) -> bool {
+ kind == "Other" && (label.contains("滚动条") || label.to_lowercase().contains("scroll bar"))
+}
+
+/// 超长文字截断显示(筛选、按名字点仍按全文)
+fn clip(s: &str, max: usize, keep: usize) -> String {
+ let n = s.chars().count();
+ if n <= max { s.to_owned() } else { format!("{}…(共 {n} 字)", s.chars().take(keep).collect::<String>()) }
}
impl Element {
@@ -28,13 +217,18 @@ impl Element {
format!("{} {} {}", self.label, self.name, self.value).to_lowercase()
}
- /// 与 toolkit 相同的一行描述:`Button "显示与亮度" id="..." @(215,676) 390x53`
+ /// 与 toolkit 相同的一行描述:`Button "显示与亮度" id="..." @(215,676) 390x53`。超长的文字和标识截断
pub fn describe(&self) -> String {
let text =
[&self.label, &self.name, &self.value].into_iter().find(|s| !s.is_empty()).cloned().unwrap_or_default();
- let mut s = format!("{} \"{}\"", self.kind, text);
+ let mut s = format!("{} \"{}\"", self.kind, clip(&text, 80, 60));
if !self.name.is_empty() && !self.label.is_empty() && self.name != self.label {
- s += &format!(" id=\"{}\"", self.name);
+ let id = if self.name.chars().count() > 48 {
+ format!("{}…", self.name.chars().take(40).collect::<String>())
+ } else {
+ self.name.clone()
+ };
+ s += &format!(" id=\"{id}\"");
}
if !self.value.is_empty() && self.value != self.label && self.value != self.name {
let v: String = self.value.chars().take(60).collect();
@@ -51,13 +245,55 @@ fn py_round(v: f64) -> i64 {
}
pub fn parse(xml: &str, screen: ScreenSize) -> Vec<Element> {
+ parse_tree(xml, screen).elements
+}
+
+/// 解析时每个还没闭合的节点
+struct Open {
+ abs: Rect,
+ /// 在工具栏/标签栏里
+ in_bar: bool,
+ /// 在导航栏/工具栏/标签栏里
+ on_bar: bool,
+ /// 在可滚动的内容里
+ in_scroll: bool,
+ /// 在键盘、弹窗、面板里
+ modal: bool,
+ group: usize,
+ /// 这一层子节点的原始坐标要加上的偏移(小组件内部用的是相对小组件的坐标)
+ offset: (f64, f64),
+ in_status_bar: bool,
+ kind: String,
+ kept: Option<usize>,
+ blocker: Option<usize>,
+}
+
+pub fn parse_tree(xml: &str, screen: ScreenSize) -> Tree {
let (sw, sh) = (screen.width, screen.height);
let mut reader = quick_xml::Reader::from_str(xml);
let mut seen = std::collections::HashSet::new();
- let mut out = Vec::new();
+ let mut tree = Tree::default();
+ let mut stack: Vec<Open> = Vec::new();
+ // 节点序号(文档顺序)
+ let mut n = 0usize;
+ let close = |tree: &mut Tree, o: &Open, end: usize| {
+ if let Some(i) = o.kept {
+ tree.elements[i].span.1 = end;
+ }
+ if let Some(i) = o.blocker {
+ tree.blockers[i].span.1 = end;
+ }
+ };
loop {
- let e = match reader.read_event() {
- Ok(Event::Start(e)) | Ok(Event::Empty(e)) => e,
+ let (e, empty) = match reader.read_event() {
+ Ok(Event::Start(e)) => (e, false),
+ Ok(Event::Empty(e)) => (e, true),
+ Ok(Event::End(_)) => {
+ if let Some(o) = stack.pop() {
+ close(&mut tree, &o, n);
+ }
+ continue;
+ }
Ok(Event::Eof) => break,
Err(e) => {
// 解析到一半出错:已解析的照常返回,但要留痕,否则「没找到元素」看起来像真结果
@@ -66,6 +302,7 @@ pub fn parse(xml: &str, screen: ScreenSize) -> Vec<Element> {
}
Ok(_) => continue,
};
+ n += 1;
let tag = e.name().as_ref().to_owned();
let mut attr = std::collections::HashMap::new();
for a in e.attributes().flatten() {
@@ -75,43 +312,174 @@ pub fn parse(xml: &str, screen: ScreenSize) -> Vec<Element> {
}
let get = |k: &str| attr.get(k).map(|s| s.trim().to_owned()).unwrap_or_default();
let (label, name, value) = (get("label"), get("name"), get("value"));
- let text = [&label, &name, &value].into_iter().find(|s| !s.is_empty()).cloned();
- let Some(text) = text else { continue };
let num = |k: &str| attr.get(k).and_then(|s| s.parse::<f64>().ok()).unwrap_or(0.0);
- let (x, y, w, h) = (num("x"), num("y"), num("width"), num("height"));
- if w <= 0.0 || h <= 0.0 || x >= sw || y >= sh || x + w <= 0.0 || y + h <= 0.0 {
- continue;
+ let raw = Rect { x: num("x"), y: num("y"), w: num("width"), h: num("height") };
+ let full_kind = attr.get("type").cloned().unwrap_or(tag);
+ let kind = full_kind.strip_prefix("XCUIElementType").unwrap_or(&full_kind).to_owned();
+
+ // 小组件的内容:某个节点在 (0,0) 且和父节点一样大,而父节点不在 (0,0)——从它开始坐标是相对父节点的
+ let parent = stack.last();
+ let mut offset = parent.map_or((0.0, 0.0), |p| p.offset);
+ if let Some(p) = parent
+ && raw.x == 0.0
+ && raw.y == 0.0
+ && (raw.w - p.abs.w).abs() < 1.0
+ && (raw.h - p.abs.h).abs() < 1.0
+ && (p.abs.x != 0.0 || p.abs.y != 0.0)
+ {
+ offset = (p.abs.x, p.abs.y);
}
- if w >= sw && h >= sh {
- continue;
+ let abs = Rect { x: raw.x + offset.0, y: raw.y + offset.1, ..raw };
+ let in_status_bar = kind == "StatusBar" || parent.is_some_and(|p| p.in_status_bar);
+ let in_bar = matches!(kind.as_str(), "Toolbar" | "TabBar") || parent.is_some_and(|p| p.in_bar);
+ let on_bar = in_bar || kind == "NavigationBar" || parent.is_some_and(|p| p.on_bar);
+ // 子节点在可滚动内容里(容器自己不算:它就是那块区域)
+ let in_scroll = parent.is_some_and(|p| p.in_scroll || SCROLLERS.contains(&p.kind.as_str()));
+ let modal = MODALS.contains(&kind.as_str()) || parent.is_some_and(|p| p.modal);
+ let group = if GROUPS.contains(&kind.as_str()) { n } else { parent.map_or(0, |p| p.group) };
+ let onscreen =
+ abs.w > 0.0 && abs.h > 0.0 && abs.x < sw && abs.y < sh && abs.x + abs.w > 0.0 && abs.y + abs.h > 0.0;
+ let (vx1, vy1) = (abs.x.max(0.0), abs.y.max(0.0));
+ let visible = Rect { x: vx1, y: vy1, w: (abs.x + abs.w).min(sw) - vx1, h: (abs.y + abs.h).min(sh) - vy1 };
+ let text = [&label, &name, &value].into_iter().find(|s| !s.is_empty()).cloned();
+ let scroll_bar = is_scroll_bar(&kind, &label);
+ if kind == "ActivityIndicator" && onscreen {
+ tree.loading = true;
}
- if !seen.insert((text, py_round(x), py_round(y), py_round(w), py_round(h))) {
- continue;
+
+ // 能挡住别人的:在屏幕内、不是铺满大半屏的透明容器、不是细线和滚动条
+ let blocker = (onscreen
+ && !in_scroll
+ && !SCROLLERS.contains(&kind.as_str())
+ && !scroll_bar
+ && !matches!(kind.as_str(), "Application" | "Window")
+ && visible.w >= 8.0
+ && visible.h >= 8.0
+ && visible.w * visible.h < sw * sh * 0.5)
+ .then(|| {
+ let name = text.as_deref().map(|t| clip(t, 20, 20)).unwrap_or_default();
+ let mut rect = visible;
+ if in_bar && rect.y > sh * 0.6 {
+ rect = Rect {
+ x: rect.x - BAR_SLOP,
+ y: rect.y - BAR_SLOP,
+ w: rect.w + 2.0 * BAR_SLOP,
+ h: rect.h + BAR_SLOP,
+ };
+ }
+ tree.blockers.push(Blocker { span: (n, n), rect, floating: in_bar || modal, modal, group, name });
+ tree.blockers.len() - 1
+ });
+ if let Some(t) = &text {
+ for o in &stack {
+ if let Some(i) = o.blocker
+ && tree.blockers[i].name.is_empty()
+ {
+ tree.blockers[i].name = clip(t, 20, 20);
+ }
+ }
}
- let (vx1, vy1, vx2, vy2) = (x.max(0.0), y.max(0.0), (x + w).min(sw), (y + h).min(sh));
- let kind = attr.get("type").cloned().unwrap_or(tag);
- out.push(Element {
- kind: kind.strip_prefix("XCUIElementType").unwrap_or(&kind).to_owned(),
- label,
- name,
- value,
- center: (py_round((vx1 + vx2) / 2.0), py_round((vy1 + vy2) / 2.0)),
- size: (py_round(w), py_round(h)),
+
+ let kind_for_children = kind.clone();
+ let kept = text.filter(|text| {
+ let noise = !onscreen
+ || (abs.w >= sw && abs.h >= sh)
+ || scroll_bar
+ || (in_status_bar && kind != "Button")
+ || (matches!(kind.as_str(), "Other" | "Image")
+ && value.is_empty()
+ && (label.is_empty() || label == name)
+ && looks_like_identifier(&name))
+ // 按钮、单元格里的图标,和重复按钮文字的子文字
+ || (matches!(kind.as_str(), "StaticText" | "Image")
+ && stack.iter().filter_map(|o| o.kept).map(|i| &tree.elements[i]).any(|a| {
+ CONTAINERS.contains(&a.kind.as_str())
+ && !a.label.is_empty()
+ && (kind == "Image" || a.label.contains(text.as_str()))
+ }));
+ !noise && seen.insert((text.clone(), py_round(abs.x), py_round(abs.y), py_round(abs.w), py_round(abs.h)))
+ });
+ let kept = kept.map(|_| {
+ tree.elements.push(Element {
+ kind,
+ label,
+ name,
+ value,
+ center: (py_round(visible.x + visible.w / 2.0), py_round(visible.y + visible.h / 2.0)),
+ size: (py_round(abs.w), py_round(abs.h)),
+ visible,
+ span: (n, n),
+ layer: if on_bar {
+ Layer::Bar
+ } else if in_scroll {
+ Layer::Scroll
+ } else {
+ Layer::Plain
+ },
+ group,
+ });
+ tree.elements.len() - 1
});
+ let o = Open {
+ abs,
+ in_bar,
+ on_bar,
+ in_scroll,
+ modal,
+ group,
+ kind: kind_for_children,
+ offset,
+ in_status_bar,
+ kept,
+ blocker,
+ };
+ if empty {
+ close(&mut tree, &o, n);
+ } else {
+ stack.push(o);
+ }
}
- out
+ tree
}
-/// 标签/名字/值里包含 `text` 的元素(不区分大小写)
+/// 类型/标签/名字/值里包含 `text` 的元素(不区分大小写)。列元素时筛选用,可以按类型筛(如 `SearchField`)
pub fn filter<'a>(elements: &'a [Element], text: &str) -> Vec<&'a Element> {
let t = text.to_lowercase();
- elements.iter().filter(|e| e.haystack().contains(&t)).collect()
+ elements.iter().filter(|e| e.haystack().contains(&t) || e.kind.to_lowercase().contains(&t)).collect()
}
-/// 按文字找元素:先找标签或名字完全相同的,没有再找包含该文字的
+/// 按文字找元素:先找标签或名字完全相同的,没有再找标签/名字/值包含该文字的(不看类型)
pub fn find<'a>(elements: &'a [Element], text: &str) -> Vec<&'a Element> {
let exact: Vec<_> = elements.iter().filter(|e| e.label == text || e.name == text).collect();
- if exact.is_empty() { filter(elements, text) } else { exact }
+ if !exact.is_empty() {
+ return exact;
+ }
+ let t = text.to_lowercase();
+ elements.iter().filter(|e| e.haystack().contains(&t)).collect()
+}
+
+/// 等某段文字出现时用:同 [`find`],但不算输入框里的内容(刚输入的搜索词不能算「结果出来了」)
+pub fn find_shown<'a>(elements: &'a [Element], text: &str) -> Vec<&'a Element> {
+ let shown = |e: &Element| -> Vec<String> {
+ if !EDITABLE.contains(&e.kind.as_str()) {
+ return vec![e.label.clone(), e.name.clone(), e.value.clone()];
+ }
+ [&e.label, &e.name].into_iter().filter(|s| **s != e.value).cloned().collect()
+ };
+ let exact: Vec<_> = elements.iter().filter(|e| shown(e).iter().any(|s| s == text)).collect();
+ if !exact.is_empty() {
+ return exact;
+ }
+ let t = text.to_lowercase();
+ elements.iter().filter(|e| shown(e).iter().any(|s| s.to_lowercase().contains(&t))).collect()
+}
+
+/// 屏幕上输入框里的内容,用来核对输入有没有丢字。有密码框时返回 None(值是圆点,核对不了)
+pub fn field_values(elements: &[Element]) -> Option<Vec<String>> {
+ if elements.iter().any(|e| e.kind == "SecureTextField") {
+ return None;
+ }
+ Some(elements.iter().filter(|e| EDITABLE.contains(&e.kind.as_str())).map(|e| e.value.clone()).collect())
}
/// 锁屏密码键盘上 0~9 各键的中心点;没找齐 10 个返回 None。
@@ -198,6 +566,9 @@ mod tests {
const PIN_IOS27: &str = include_str!("../tests/fixtures/passcode-view-ios27.xml");
const NC_IOS27: &str = include_str!("../tests/fixtures/notification-center-ios27.xml");
const PARTIAL_IOS27: &str = include_str!("../tests/fixtures/passcode-partial-ios27.xml");
+ const SETTINGS_IOS27: &str = include_str!("../tests/fixtures/settings-floating-search-ios27.xml");
+ const HOME_WIDGETS_IOS27: &str = include_str!("../tests/fixtures/home-widgets-ios27.xml");
+ const WALLET_IOS27: &str = include_str!("../tests/fixtures/settings-wallet-ios27.xml");
#[test]
fn delete_key_found_by_position_on_real_keypad() {
@@ -261,7 +632,190 @@ mod tests {
fn center_is_clipped_to_visible_part() {
let h = home();
assert_eq!(h.iter().find(|e| e.label == "被顶出屏幕一半").unwrap().center, (150, 10));
- assert_eq!(h.iter().find(|e| e.label.starts_with("垂直滚动条")).unwrap().center.0, 421);
+ }
+
+ #[test]
+ fn scroll_bars_are_dropped() {
+ assert!(!labels(&home()).iter().any(|l| l.contains("滚动条")));
+ assert!(!labels(&parse(SETTINGS_IOS27, SCREEN)).iter().any(|l| l.contains("滚动条")));
+ }
+
+ /// 真机:设置首页往上滑后,「钱包与Apple Pay」那一行(832~886)被底部悬浮搜索栏盖住:
+ /// 栏的底板从 856 起,实际吞点击的范围再往上约 20 点,露出来的部分点不中
+ #[test]
+ fn tap_point_avoids_floating_search_bar() {
+ let t = parse_tree(SETTINGS_IOS27, SCREEN);
+ let wallet = t.elements.iter().find(|e| e.label == "钱包与Apple Pay").unwrap();
+ assert_eq!(wallet.center, (215, 859));
+ assert_eq!(t.tap_point(wallet), TapPoint::Covered { by: "搜索".into() });
+ // 中心在栏上方、下半截被盖住的:改点上半截
+ let mut half = wallet.clone();
+ half.visible = Rect { y: 810.0, ..half.visible };
+ half.center = (215, 837);
+ match t.tap_point(&half) {
+ TapPoint::Moved { at, by } => {
+ assert!(at.1 < 832.0 && at.1 >= 810.0, "{at:?}");
+ assert_eq!(by, "搜索");
+ }
+ other => panic!("{other:?}"),
+ }
+ // 没被挡的照常点中心
+ let wallpaper = t.elements.iter().find(|e| e.label == "相机").unwrap();
+ assert_eq!(t.tap_point(wallpaper), TapPoint::Center((wallpaper.center.0 as f64, wallpaper.center.1 as f64)));
+ // 搜索栏自己(在最上层)不算被挡
+ let search = t.elements.iter().find(|e| e.kind == "SearchField").unwrap();
+ assert!(matches!(t.tap_point(search), TapPoint::Center(_)));
+ }
+
+ /// 真机:设置 › 钱包与Apple Pay。单元格里的背景层排在按钮后面、滚到导航栏底下的行排在导航栏后面,都不算盖住
+ #[test]
+ fn decorations_and_content_under_nav_bar_do_not_cover() {
+ let t = parse_tree(WALLET_IOS27, SCREEN);
+ for label in ["通知、隐式推送", "设置"] {
+ let e = t.elements.iter().find(|e| e.label == label).unwrap();
+ assert!(matches!(t.tap_point(e), TapPoint::Center(_)), "{label}");
+ }
+ }
+
+ /// 真机:天气的定位服务弹窗,按钮后面排着弹窗自己的背景层(没有文字)
+ #[test]
+ fn alert_buttons_are_not_covered_by_their_own_alert() {
+ let xml = r#"<XCUIElementTypeApplication type="XCUIElementTypeApplication" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeAlert type="XCUIElementTypeAlert" label="打开定位服务" x="55" y="404" width="320" height="149">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" label="取消" x="219" y="488" width="140" height="49"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="55" y="404" width="320" height="149"/>
+ </XCUIElementTypeAlert>
+ </XCUIElementTypeApplication>"#;
+ let t = parse_tree(xml, SCREEN);
+ let cancel = t.elements.iter().find(|e| e.label == "取消").unwrap();
+ assert!(matches!(t.tap_point(cancel), TapPoint::Center(_)));
+ }
+
+ #[test]
+ fn tap_point_reports_fully_covered() {
+ let xml = r#"<XCUIElementTypeApplication type="XCUIElementTypeApplication" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeScrollView type="XCUIElementTypeScrollView" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" label="底下的按钮" x="100" y="500" width="100" height="40"/>
+ </XCUIElementTypeScrollView>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="450" width="430" height="200">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" label="浮层" x="10" y="460" width="60" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeApplication>"#;
+ let t = parse_tree(xml, SCREEN);
+ let b = t.elements.iter().find(|e| e.label == "底下的按钮").unwrap();
+ assert_eq!(t.tap_point(b), TapPoint::Covered { by: "浮层".into() });
+ }
+
+ /// 真机:主屏天气小组件里的文字,WDA 给的是相对小组件的坐标
+ #[test]
+ fn widget_contents_are_moved_to_screen_coordinates() {
+ let els = parse(HOME_WIDGETS_IOS27, SCREEN);
+ let city = els.iter().find(|e| e.label == "上海市").unwrap();
+ // 小组件内容区在 (29,84),文字在其中 (19,19) 起 52x13
+ assert_eq!(city.center, (74, 110));
+ // 主屏图标本来就是屏幕坐标,不受影响
+ let clock = els.iter().find(|e| e.label == "时钟" && e.kind == "Icon").unwrap();
+ assert!(clock.center.1 > 400);
+ }
+
+ #[test]
+ fn close_to_tolerates_small_drift_only() {
+ let t = parse_tree(SETTINGS_IOS27, SCREEN);
+ let mut moved = t.clone();
+ for e in &mut moved.elements {
+ e.center.1 += 2;
+ }
+ assert!(t.close_to(&moved, 2));
+ assert!(!t.close_to(&moved, 1));
+ moved.elements.pop();
+ assert!(!t.close_to(&moved, 2));
+ }
+
+ #[test]
+ fn still_along_ignores_values_and_the_other_axis() {
+ let t = parse_tree(SETTINGS_IOS27, SCREEN);
+ let mut carousel = t.clone();
+ carousel.elements[0].value = "第 2 页".into();
+ carousel.elements[0].center.0 += 100;
+ assert!(t.still_along(&carousel, true, 3));
+ assert!(!t.still_along(&carousel, false, 3));
+ let mut scrolled = t.clone();
+ scrolled.elements[0].center.1 += 10;
+ assert!(!t.still_along(&scrolled, true, 3));
+ }
+
+ #[test]
+ fn noise_is_dropped_but_tap_targets_stay() {
+ let h = parse(HOME_WIDGETS_IOS27, SCREEN);
+ let l = labels(&h);
+ assert!(!l.iter().any(|s| s == "label-view"));
+ // 状态栏(时间、信号、电量)
+ assert!(!h.iter().any(|e| e.label.contains("电池电量")));
+ assert!(h.iter().any(|e| e.kind == "Icon" && e.label == "设置"));
+ let s = parse(SETTINGS_IOS27, SCREEN);
+ // 按钮里重复按钮文字的 StaticText 和右边的箭头图标不再单列
+ assert_eq!(s.iter().filter(|e| e.label == "钱包与Apple Pay").count(), 1);
+ assert!(!s.iter().any(|e| e.label == "chevron.forward"));
+ assert!(s.iter().any(|e| e.kind == "Button" && e.label == "通知"));
+ }
+
+ #[test]
+ fn long_text_and_ids_are_clipped_in_description() {
+ let e = Element {
+ kind: "Button".into(),
+ label: "很长".repeat(100),
+ name: format!("Open.{}", "X".repeat(100)),
+ ..Default::default()
+ };
+ let d = e.describe();
+ assert!(d.contains("…(共 200 字)") && d.chars().count() < 160, "{d}");
+ assert!(filter(std::slice::from_ref(&e), "很长很长").len() == 1, "筛选仍按全文");
+ }
+
+ #[test]
+ fn filter_matches_type_but_find_does_not() {
+ let s = parse(SETTINGS_IOS27, SCREEN);
+ assert_eq!(filter(&s, "searchfield").len(), 1);
+ assert!(find(&s, "SearchField").is_empty());
+ }
+
+ #[test]
+ fn find_shown_ignores_text_typed_into_fields() {
+ let els = vec![
+ Element {
+ kind: "TextView".into(),
+ label: "红烧肉做法".into(),
+ value: "红烧肉做法".into(),
+ ..Default::default()
+ },
+ Element {
+ kind: "SearchField".into(), label: "搜索".into(), value: "红烧肉".into(), ..Default::default()
+ },
+ ];
+ assert!(find_shown(&els, "红烧肉").is_empty());
+ assert_eq!(find_shown(&els, "搜索").len(), 1);
+ let mut more = els.clone();
+ more.push(Element { kind: "StaticText".into(), label: "家常红烧肉".into(), ..Default::default() });
+ assert_eq!(find_shown(&more, "红烧肉")[0].label, "家常红烧肉");
+ }
+
+ #[test]
+ fn field_values_skip_password_forms() {
+ let field = |kind: &str, v: &str| Element { kind: kind.into(), value: v.into(), ..Default::default() };
+ assert_eq!(field_values(&[field("SearchField", "故宫博")]), Some(vec!["故宫博".to_owned()]));
+ assert_eq!(field_values(&[field("TextField", "me"), field("SecureTextField", "••")]), None);
+ }
+
+ #[test]
+ fn loading_indicator_and_alert_are_reported() {
+ let xml = r#"<XCUIElementTypeApplication type="XCUIElementTypeApplication" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeActivityIndicator type="XCUIElementTypeActivityIndicator" x="200" y="450" width="30" height="30"/>
+ <XCUIElementTypeAlert type="XCUIElementTypeAlert" label="“微信”想给你发送通知" x="55" y="390" width="320" height="173"/>
+ </XCUIElementTypeApplication>"#;
+ let t = parse_tree(xml, SCREEN);
+ assert!(t.loading);
+ assert_eq!(t.alert().unwrap().label, "“微信”想给你发送通知");
+ assert!(!parse_tree(HOME, SCREEN).loading);
}
#[test]
@@ -304,9 +858,9 @@ mod tests {
kind: kind.into(),
label: label.into(),
name: label.into(),
- value: String::new(),
center: (x, 100),
size: (80, 80),
+ ..Default::default()
}
}
diff --git a/crates/ictl-wda/src/lib.rs b/crates/ictl-wda/src/lib.rs
index be4bd1e..f0ae6bc 100644
--- a/crates/ictl-wda/src/lib.rs
+++ b/crates/ictl-wda/src/lib.rs
@@ -9,7 +9,7 @@ pub mod elements;
pub mod http;
pub mod runner;
-pub use client::{IdleSettings, LockCheck, PointerStep, WdaClient, actions_body, swipe_steps, tap_steps};
+pub use client::{IdleSettings, Launch, LockCheck, PointerStep, WdaClient, actions_body, swipe_steps, tap_steps};
pub use elements::Element;
pub use runner::WdaRunner;
diff --git a/crates/ictl-wda/tests/fixtures/home-widgets-ios27.xml b/crates/ictl-wda/tests/fixtures/home-widgets-ios27.xml
new file mode 100644
index 0000000..999a7b9
--- /dev/null
+++ b/crates/ictl-wda/tests/fixtures/home-widgets-ios27.xml
@@ -0,0 +1,610 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XCUIElementTypeApplication type="XCUIElementTypeApplication" name=" " label=" " x="0" y="0" width="430" height="932" processId="37" bundleId="com.apple.springboard">
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="100"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="Home screen icons" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="860" y="0" width="430" height="932"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" x="0" y="0" width="0" height="0">
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" value="小组件, 叠放" name="天气" label="天气" x="27" y="81" width="179" height="203">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="83" width="175" height="190">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="83" width="175" height="176">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="83" width="175" height="176">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="widget-stack:&lt;天气,地图,备忘录&gt;" x="29" y="83" width="175" height="176">
+ <XCUIElementTypeScrollView type="XCUIElementTypeScrollView" x="29" y="83" width="175" height="176">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="天气" label="天气" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="19" y="19" width="135" height="137">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="上海市,20°摄氏度,多云,明天气温降低,最高气温21°,最高气温26°摄氏度,最低气温17°摄氏度" label="上海市,20°摄氏度,多云,明天气温降低,最高气温21°,最高气温26°摄氏度,最低气温17°摄氏度" x="19" y="19" width="135" height="137">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="上海市" name="上海市" label="上海市" x="19" y="19" width="52" height="13"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="20°" name="20°" label="20°" x="19" y="30" width="69" height="54"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="温度计" label="温度计" x="19" y="96" width="14" height="23"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="明天气温降低,最高气温21°" name="明天气温降低,最高气温21°" label="明天气温降低,最高气温21°" x="19" y="123" width="135" height="33"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="0" height="0"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="天气" label="天气" x="0" y="0" width="175" height="175"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="29" y="84" width="175" height="175"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="0%" name="水平滚动条, 1页" label="水平滚动条, 1页" x="29" y="225" width="175" height="31">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="32" y="252" width="166" height="4"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="0%" name="水平滚动条, 1页" label="水平滚动条, 1页" x="29" y="225" width="175" height="31">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="32" y="252" width="166" height="4"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeScrollView>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="96" y="261" width="41" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="96" y="261" width="41" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="96" y="261" width="41" height="21">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="63" y="227" width="107" height="88"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="96" y="261" width="41" height="21"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" value="小组件, 叠放" name="日历" label="日历" x="224" y="81" width="179" height="203">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="83" width="175" height="190">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="83" width="175" height="176">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="83" width="175" height="176">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="widget-stack:&lt;日历,照片&gt;" x="226" y="83" width="175" height="176">
+ <XCUIElementTypeScrollView type="XCUIElementTypeScrollView" x="226" y="83" width="175" height="176">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="日历" label="日历" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="19" y="17" width="85" height="101">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="iconic-date-header-view" label="11月01日 星期日" x="19" y="17" width="64" height="41">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="1" name="1" label="1" x="19" y="14" width="17" height="44"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="廿三" name="廿三" label="廿三" x="43" y="21" width="16" height="32"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="周日" name="周日" label="周日" x="67" y="21" width="16" height="32"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="今天无日程" name="今天无日程" label="今天无日程" x="19" y="97" width="85" height="21"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="0" height="0"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="日历" label="日历" x="0" y="0" width="175" height="175"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="226" y="84" width="175" height="175"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="0%" name="水平滚动条, 1页" label="水平滚动条, 1页" x="226" y="225" width="175" height="31">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="229" y="252" width="166" height="4"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="0%" name="水平滚动条, 1页" label="水平滚动条, 1页" x="226" y="225" width="175" height="31">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="229" y="252" width="166" height="4"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeScrollView>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="293" y="261" width="41" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="293" y="261" width="41" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="293" y="261" width="41" height="21">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="261" y="227" width="106" height="88"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="293" y="261" width="41" height="21"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="FaceTime通话" label="FaceTime通话" x="17" y="295" width="100" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="297" width="68" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="297" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="297" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="297" width="68" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="19" y="368" width="96" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="19" y="368" width="96" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="19" y="368" width="96" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="-14" y="333" width="163" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="19" y="368" width="96" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" value="11月01日 星期日" name="日历" label="日历" x="129" y="295" width="73" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="297" width="69" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="297" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="297" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="297" width="69" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="145" y="368" width="41" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="145" y="368" width="41" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="145" y="368" width="41" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="113" y="333" width="106" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="145" y="368" width="41" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="照片" label="照片" x="228" y="295" width="73" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="297" width="69" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="297" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="297" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="297" width="69" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="244" y="368" width="41" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="244" y="368" width="41" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="244" y="368" width="41" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="211" y="333" width="107" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="244" y="368" width="41" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="相机" label="相机" x="327" y="295" width="72" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="297" width="68" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="297" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="297" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="297" width="68" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="343" y="368" width="40" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="343" y="368" width="40" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="343" y="368" width="40" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="310" y="333" width="107" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="343" y="368" width="40" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" value="无未读电子邮件" name="邮件" label="邮件" x="31" y="402" width="72" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="404" width="68" height="82">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="404" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="404" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="404" width="68" height="68"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="47" y="475" width="40" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="47" y="475" width="40" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="47" y="475" width="40" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="14" y="440" width="107" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="47" y="475" width="40" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="备忘录" label="备忘录" x="129" y="402" width="73" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="404" width="69" height="82">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="404" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="404" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="404" width="69" height="68"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="139" y="475" width="53" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="139" y="475" width="53" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="139" y="475" width="53" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="107" y="440" width="118" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="139" y="475" width="53" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" value="20:51" name="时钟" label="时钟" x="228" y="402" width="73" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="404" width="69" height="82">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="404" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="404" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="404" width="69" height="68"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="244" y="475" width="41" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="244" y="475" width="41" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="244" y="475" width="41" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="211" y="440" width="107" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="244" y="475" width="41" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="地图" label="地图" x="327" y="402" width="72" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="404" width="68" height="82">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="404" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="404" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="404" width="68" height="68"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="343" y="475" width="40" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="343" y="475" width="40" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="343" y="475" width="40" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="310" y="440" width="107" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="343" y="475" width="40" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="TV" label="TV" x="31" y="508" width="72" height="96">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="510" width="68" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="510" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="510" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="510" width="68" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="50" y="581" width="33" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="50" y="581" width="33" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="50" y="581" width="33" height="21">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="18" y="547" width="99" height="88"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="50" y="581" width="33" height="21"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="App Store" label="App Store" x="126" y="508" width="79" height="96">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="510" width="69" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="510" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="510" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="510" width="69" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="128" y="581" width="75" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="128" y="581" width="75" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="128" y="581" width="75" height="21">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="96" y="547" width="140" height="88"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="128" y="581" width="75" height="21"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="游戏" label="游戏" x="228" y="508" width="73" height="96">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="510" width="69" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="510" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="510" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="510" width="69" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="244" y="581" width="41" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="244" y="581" width="41" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="244" y="581" width="41" height="21">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="211" y="547" width="107" height="88"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="244" y="581" width="41" height="21"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="健康" label="健康" x="327" y="508" width="72" height="96">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="510" width="68" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="510" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="510" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="510" width="68" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="343" y="581" width="40" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="343" y="581" width="40" height="21">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="343" y="581" width="40" height="21">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="310" y="547" width="107" height="88"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="343" y="581" width="40" height="21"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="钱包" label="钱包" x="31" y="615" width="72" height="95">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="617" width="68" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="617" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="617" width="68" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="617" width="68" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="47" y="688" width="40" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="47" y="688" width="40" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="47" y="688" width="40" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="14" y="653" width="107" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="47" y="688" width="40" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" value="1个新项目" name="设置" label="设置" x="129" y="604" width="84" height="106">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="617" width="69" height="83">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="617" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="184" y="606" width="27" height="27">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="184" y="606" width="27" height="27">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="192" y="609" width="11" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="617" width="69" height="69">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="617" width="69" height="69"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="label-view" x="145" y="688" width="41" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="145" y="688" width="41" height="20">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="145" y="688" width="41" height="20">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="113" y="653" width="106" height="89"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="145" y="688" width="41" height="20"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" x="0" y="0" width="0" height="0">
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="天气" label="天气" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="股市" label="股市" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="查找" label="查找" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="家庭" label="家庭" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="图书" label="图书" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="健身" label="健身" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="提醒事项" label="提醒事项" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="文件" label="文件" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="实用工具" label="“实用工具”文件夹" x="0" y="0" width="0" height="0">
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="密码" label="密码" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="放大器" label="放大器" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="测距仪" label="测距仪" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="快捷指令" label="快捷指令" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="语音备忘录" label="语音备忘录" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="指南针" label="指南针" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="计算器" label="计算器" x="0" y="0" width="0" height="0"/>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="联系人" label="联系人" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="iTunes Store" label="iTunes Store" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="翻译" label="翻译" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="爱思全能版" label="爱思全能版" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="Shadowrocket" label="Shadowrocket" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="微信" label="微信" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="高德地图" label="高德地图" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="小红书" label="小红书" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="图乐园" label="图乐园" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="WebDriverAgentRunner-Runner" label="WebDriverAgentRunner-Runner" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="开心消消乐" label="开心消消乐" x="0" y="0" width="0" height="0"/>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="第1页(共2页)" name="spotlight-pill" label="搜索" x="184" y="756" width="62" height="31">
+ <XCUIElementTypePageIndicator type="XCUIElementTypePageIndicator" value="第1页(共2页)" name="Page control" x="184" y="756" width="62" height="36"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="spotlight-pill" x="184" y="756" width="62" height="31">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="184" y="756" width="62" height="31">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="magnifyingglass" label="搜索" x="196" y="766" width="12" height="11"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="搜索" name="搜索" label="搜索" x="210" y="764" width="25" height="15"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="812" width="430" height="120">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="14" y="812" width="402" height="106">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="程序坞" label="程序坞" x="0" y="812" width="430" height="106">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="812" width="430" height="106"/>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="电话" label="电话" x="31" y="829" width="72" height="72">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="831" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="831" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="831" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="33" y="831" width="68" height="68"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="Safari浏览器" label="Safari浏览器" x="129" y="829" width="73" height="72">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="831" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="831" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="831" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="131" y="831" width="69" height="68"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="信息" label="信息" x="228" y="829" width="73" height="72">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="831" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="831" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="831" width="69" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="230" y="831" width="69" height="68"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ <XCUIElementTypeIcon type="XCUIElementTypeIcon" name="音乐" label="音乐" x="327" y="829" width="72" height="72">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="831" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="831" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="831" width="68" height="68">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="329" y="831" width="68" height="68"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeIcon>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="138" y="922" width="154" height="6">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="138" y="922" width="154" height="6">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="138" y="922" width="154" height="6"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="152" y="11" width="126" height="37">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="152" y="11" width="126" height="37"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="152" y="11" width="126" height="37">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="152" y="11" width="126" height="37">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="152" y="11" width="126" height="37"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="152" y="11" width="126" height="37">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="152" y="11" width="126" height="37"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="152" y="11" width="126" height="37"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="jindo-container-view:1" x="152" y="11" width="126" height="37">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="142" y="10" width="146" height="49"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="232" y="25" width="9" height="10"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="1290" height="2796">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="1290" height="2796">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="1290" height="2796"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="1290" height="2796"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="1290" height="2796"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="1290" height="2796"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="1290" height="2796">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="1290" height="2796"/>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeStatusBar type="XCUIElementTypeStatusBar" x="0" y="0" width="430" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="54">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="20:51" name="20:51" label="20:51" x="57" y="18" width="48" height="23"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="信号强度:3(共4格)" name="蜂窝网络" label="蜂窝网络" x="305" y="21" width="22" height="15"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="SSID, 3(共3格Wi-Fi信号)" name="3(共3格Wi-Fi信号)" x="334" y="21" width="20" height="15">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="wifi" label="Wi-Fi" x="332" y="19" width="24" height="19"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="正在充电" name="电池电量80%" label="电池电量80%" x="361" y="21" width="32" height="16"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeStatusBar>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="1290" height="2796">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="1573" y="-300" width="17" height="17"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="1573" y="-300" width="17" height="17"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="457" y="34" width="376" height="110"/>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="0" height="0"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeWindow>
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="0" height="0"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="0" height="0"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+</XCUIElementTypeApplication>
+
diff --git a/crates/ictl-wda/tests/fixtures/settings-floating-search-ios27.xml b/crates/ictl-wda/tests/fixtures/settings-floating-search-ios27.xml
new file mode 100644
index 0000000..a9c26b7
--- /dev/null
+++ b/crates/ictl-wda/tests/fixtures/settings-floating-search-ios27.xml
@@ -0,0 +1,351 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XCUIElementTypeApplication type="XCUIElementTypeApplication" name="设置" label="设置" x="0" y="0" width="430" height="932" processId="1222" bundleId="com.apple.Preferences">
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeNavigationBar type="XCUIElementTypeNavigationBar" name="设置" x="0" y="59" width="430" height="54">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="设置" name="设置" label="设置" x="198" y="70" width="34" height="22"/>
+ </XCUIElementTypeNavigationBar>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeCollectionView type="XCUIElementTypeCollectionView" name="com.apple.settings.sidebar.collectionView" x="0" y="0" width="430" height="933">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="-20" y="-284" width="470" height="664"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="933">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="153"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="806" width="430" height="127"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="933">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="153"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="806" width="430" height="127"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="-5" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="-5" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="-5" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="-5" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="-5" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="-5" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.wallpaper" label="墙纸" x="20" y="-5" width="390" height="53">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="墙纸" name="墙纸" label="墙纸" x="38" y="7" width="76" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="7" width="28" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="15" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="47" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="47" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="47" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="47" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="47" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="47" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.search" label="搜索" x="20" y="47" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="59" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="搜索" name="搜索" label="搜索" x="38" y="60" width="76" height="28"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="67" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="46" width="310" height="2"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="100" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="100" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="100" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="100" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="100" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="100" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.appearance" label="外观" x="20" y="100" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="112" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="外观" name="外观" label="外观" x="38" y="112" width="76" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="120" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="99" width="310" height="1"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="152" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="152" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="152" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="152" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="152" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="152" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.displayAndBrightness" label="显示与亮度" x="20" y="152" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="164" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="显示与亮度" name="显示与亮度" label="显示与亮度" x="38" y="164" width="127" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="172" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="151" width="310" height="2"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="204" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="204" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="204" width="390" height="54"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="204" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="204" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="204" width="390" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.camera" label="相机" x="20" y="204" width="390" height="54">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="相机" name="相机" label="相机" x="38" y="217" width="76" height="28"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="217" width="28" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="225" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="203" width="310" height="2"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="256" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="256" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="256" width="390" height="54"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="256" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="256" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="256" width="390" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.homeScreen" label="主屏幕与App资源库" x="20" y="256" width="390" height="54">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="269" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="主屏幕与App资源库" name="主屏幕与App资源库" label="主屏幕与App资源库" x="38" y="269" width="196" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="277" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="255" width="310" height="2"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="309" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="309" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="309" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="309" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="309" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="309" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.siri" label="Siri" x="20" y="309" width="390" height="53">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="Siri" name="Siri" label="Siri" x="38" y="321" width="66" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="321" width="28" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="329" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="308" width="310" height="2"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="-20" y="379" width="470" height="245"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="396" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="396" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="396" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="396" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="396" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="396" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.notifications" label="通知" x="20" y="396" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="408" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="通知" name="通知" label="通知" x="38" y="409" width="76" height="28"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="416" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="448" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="448" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="448" width="390" height="54"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="448" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="448" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="448" width="390" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.sounds" label="声效与触感反馈" x="20" y="448" width="390" height="54">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="461" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="声效与触感反馈" name="声效与触感反馈" label="声效与触感反馈" x="38" y="461" width="160" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="469" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="447" width="310" height="2"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="501" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="501" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="501" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="501" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="501" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="501" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.focus" label="专注模式" x="20" y="501" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="513" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="专注模式" name="专注模式" label="专注模式" x="38" y="513" width="110" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="521" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="500" width="310" height="2"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="553" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="553" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="553" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="553" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="553" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="553" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.screenTime" label="屏幕时间" x="20" y="553" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="566" width="28" height="28"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="屏幕时间" name="屏幕时间" label="屏幕时间" x="38" y="566" width="110" height="28"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="574" width="8" height="12"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="552" width="310" height="2"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="-20" y="623" width="470" height="193"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="640" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="640" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="640" width="390" height="54"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="640" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="640" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="640" width="390" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.passcodeAndBiometrics" label="面容ID与密码" x="20" y="640" width="390" height="54">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="面容ID与密码" name="面容ID与密码" label="面容ID与密码" x="38" y="653" width="147" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="653" width="28" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="661" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="693" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="693" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="693" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="693" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="693" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="693" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.sos" label="SOS紧急联络" x="20" y="693" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="705" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="SOS紧急联络" name="SOS紧急联络" label="SOS紧急联络" x="38" y="705" width="146" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="713" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="692" width="310" height="2"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="745" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="745" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="745" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="745" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="745" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="745" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.privacyAndSecurity" label="隐私与安全" x="20" y="745" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="758" width="28" height="28"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="隐私与安全" name="隐私与安全" label="隐私与安全" x="38" y="758" width="127" height="28"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="766" width="8" height="12"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="744" width="310" height="2"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="-20" y="815" width="470" height="193"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="832" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="832" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="832" width="390" height="54"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="832" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="832" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="832" width="390" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.walletAndApplePay" label="钱包与Apple Pay" x="20" y="832" width="390" height="54">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="钱包与Apple Pay" name="钱包与Apple Pay" label="钱包与Apple Pay" x="38" y="845" width="171" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="845" width="28" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="853" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" x="20" y="885" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="885" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="885" width="390" height="53"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="885" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="885" width="390" height="53">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="885" width="390" height="53">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.settings.gameCenter" label="Game Center" x="20" y="885" width="390" height="53">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="897" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="Game Center" name="Game Center" label="Game Center" x="38" y="897" width="143" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="chevron.forward" x="380" y="905" width="8" height="13"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="884" width="310" height="2"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="73%" name="垂直滚动条, 3页" label="垂直滚动条, 3页" x="397" y="113" width="30" height="765">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="424" y="431" width="3" height="325"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="73%" name="垂直滚动条, 3页" label="垂直滚动条, 3页" x="397" y="113" width="30" height="765">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="424" y="431" width="3" height="325"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCollectionView>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="215" y="479" width="0" height="1"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeToolbar type="XCUIElementTypeToolbar" name="Toolbar" label="工具栏" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="59" width="430" height="873">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="59" width="430" height="873">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="59" width="0" height="0">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="28" y="856" width="374" height="48">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="28" y="856" width="374" height="48">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="28" y="866" width="374" height="28">
+ <XCUIElementTypeSearchField type="XCUIElementTypeSearchField" value="搜索" name="搜索" label="搜索" x="28" y="866" width="374" height="28">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="Dictate" label="听写" x="369" y="869" width="18" height="22"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" name="magnifyingglass" label="搜索" x="40" y="870" width="21" height="20"/>
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="Dictate" label="听写" x="369" y="869" width="18" height="22"/>
+ </XCUIElementTypeSearchField>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeToolbar>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeToolbar type="XCUIElementTypeToolbar" name="Toolbar" label="工具栏" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeToolbar>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+</XCUIElementTypeApplication>
+
diff --git a/crates/ictl-wda/tests/fixtures/settings-wallet-ios27.xml b/crates/ictl-wda/tests/fixtures/settings-wallet-ios27.xml
new file mode 100644
index 0000000..b3e6910
--- /dev/null
+++ b/crates/ictl-wda/tests/fixtures/settings-wallet-ios27.xml
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XCUIElementTypeApplication type="XCUIElementTypeApplication" name="设置" label="设置" x="0" y="0" width="430" height="932" processId="1322" bundleId="com.apple.Preferences">
+ <XCUIElementTypeWindow type="XCUIElementTypeWindow" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeNavigationBar type="XCUIElementTypeNavigationBar" name="钱包与Apple Pay" x="0" y="59" width="430" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="BackButton" label="设置" x="20" y="59" width="44" height="44"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="钱包与Apple Pay" name="钱包与Apple Pay" label="钱包与Apple Pay" x="149" y="70" width="132" height="22"/>
+ </XCUIElementTypeNavigationBar>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="113" width="430" height="785">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeTable type="XCUIElementTypeTable" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="允许钱包与Apple Pay访问" x="0" y="113" width="430" height="56">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="允许钱包与Apple Pay访问" label="允许钱包与Apple Pay访问" x="20" y="-10" width="390" height="56"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="SIRI" label="Apple智能与Siri" x="20" y="45" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="45" width="360" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="45" width="360" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="SIRI" label="Apple智能与Siri" x="38" y="58" width="165" height="28">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="57" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="Apple智能与Siri" name="Apple智能与Siri" label="Apple智能与Siri" x="38" y="58" width="165" height="28"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="45" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="45" width="390" height="54"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="97" width="310" height="2"/>
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="chevron" label="chevron" x="379" y="64" width="11" height="15"/>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="SEARCH" label="搜索" x="20" y="98" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="98" width="360" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="98" width="360" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="SEARCH" label="搜索" x="38" y="111" width="76" height="29">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="搜索" name="搜索" label="搜索" x="38" y="111" width="76" height="29"/>
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="111" width="28" height="29"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="98" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="98" width="390" height="54"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="150" width="310" height="2"/>
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="chevron" label="chevron" x="379" y="118" width="11" height="15"/>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="NOTIFICATIONS" x="20" y="151" width="390" height="75">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="151" width="360" height="75">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="151" width="360" height="75">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="NOTIFICATIONS" label="通知、隐式推送" x="38" y="167" width="102" height="43">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="174" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="通知" name="通知" label="通知" x="80" y="167" width="34" height="21"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="隐式推送" name="隐式推送" label="隐式推送" x="80" y="191" width="60" height="19"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="151" width="390" height="75">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="151" width="390" height="75"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="80" y="224" width="310" height="2"/>
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="chevron" label="chevron" x="379" y="181" width="11" height="15"/>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="实时活动" x="20" y="225" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="225" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="225" width="390" height="54">
+ <XCUIElementTypeSwitch type="XCUIElementTypeSwitch" value="1" name="实时活动" label="实时活动" x="38" y="238" width="352" height="28">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="实时活动" x="38" y="237" width="28" height="29"/>
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="实时活动" label="实时活动" x="80" y="241" width="68" height="22"/>
+ <XCUIElementTypeSwitch type="XCUIElementTypeSwitch" value="1" x="329" y="237" width="63" height="29"/>
+ </XCUIElementTypeSwitch>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="com.apple.Passbook.wireless" x="20" y="278" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="278" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="278" width="390" height="54">
+ <XCUIElementTypeSwitch type="XCUIElementTypeSwitch" value="1" name="com.apple.Passbook.wireless" label="蜂窝数据" x="38" y="291" width="352" height="29">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.Passbook.wireless" x="38" y="291" width="28" height="29"/>
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="com.apple.Passbook.wireless" label="蜂窝数据" x="80" y="295" width="68" height="21"/>
+ <XCUIElementTypeSwitch type="XCUIElementTypeSwitch" value="1" x="329" y="291" width="63" height="29"/>
+ </XCUIElementTypeSwitch>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="331" width="430" height="19"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="349" width="430" height="18"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="Apple Pay默认设置" x="20" y="366" width="390" height="75">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="366" width="360" height="75">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="366" width="360" height="75">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="Apple Pay默认设置" label="Apple Pay默认设置、卡片、地址、偏好设置" x="38" y="382" width="192" height="43">
+ <XCUIElementTypeImage type="XCUIElementTypeImage" x="38" y="389" width="28" height="29"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="Apple Pay默认设置" name="Apple Pay默认设置" label="Apple Pay默认设置" x="80" y="382" width="146" height="21"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="卡片、地址、偏好设置" name="卡片、地址、偏好设置" label="卡片、地址、偏好设置" x="80" y="406" width="150" height="19"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="366" width="390" height="75">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="366" width="390" height="75"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="439" width="390" height="2"/>
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="chevron" label="chevron" x="379" y="396" width="11" height="15"/>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="440" width="430" height="18"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="付款卡" x="0" y="457" width="430" height="39">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" name="付款卡" label="付款卡" x="20" y="457" width="390" height="39"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="添加卡片" label="添加卡片" x="20" y="495" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="547" width="390" height="2"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="添加卡片" name="添加卡片" label="添加卡片" x="40" y="512" width="68" height="21"/>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="548" width="430" height="66">
+ <XCUIElementTypeTextView type="XCUIElementTypeTextView" value="通过iPhone在线上、App中和任何支持免接触式支付的地方使用Apple Pay付款。无需解锁设备或者通过面容ID或密码认证,即可在交通读卡器上快速付款。 了解数据的管理方式…" x="40" y="556" width="350" height="49">
+ <XCUIElementTypeTextView type="XCUIElementTypeTextView" name="通过iPhone在线上、App中和任何支持免接触式支付的地方使用Apple Pay付款。无需解锁设备或者通过面容ID或密码认证,即可在交通读卡器上快速付款。 了解数据的管理方式…" label="通过iPhone在线上、App中和任何支持免接触式支付的地方使用Apple Pay付款。无需解锁设备或者通过面容ID或密码认证,即可在交通读卡器上快速付款。 了解数据的管理方式…" x="40" y="556" width="350" height="49">
+ <XCUIElementTypeLink type="XCUIElementTypeLink" name="了解数据的管理方式…" label="了解数据的管理方式…" x="263" y="588" width="127" height="17"/>
+ </XCUIElementTypeTextView>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="0%" name="水平滚动条, 1页" label="水平滚动条, 1页" x="40" y="577" width="350" height="25">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="1" y="598" width="36" height="4"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeTextView>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="612" width="430" height="19"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="自动填充卡片" label="自动填充卡片、2" x="20" y="630" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="630" width="360" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="630" width="360" height="54">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="自动填充卡片" label="自动填充卡片、2" x="40" y="647" width="332" height="21">
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="自动填充卡片" name="自动填充卡片" label="自动填充卡片" x="40" y="647" width="102" height="21"/>
+ <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="2" name="2" label="2" x="361" y="647" width="11" height="21"/>
+ </XCUIElementTypeButton>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="630" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="630" width="390" height="54"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="682" width="390" height="2"/>
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="chevron" label="chevron" x="379" y="650" width="11" height="15"/>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="683" width="430" height="19"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="701" width="430" height="18"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="隐藏已过期的凭证" x="20" y="718" width="390" height="55">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="718" width="390" height="55">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="718" width="390" height="55">
+ <XCUIElementTypeSwitch type="XCUIElementTypeSwitch" value="1" name="隐藏已过期的凭证" label="隐藏已过期的凭证" x="40" y="731" width="350" height="29">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="隐藏已过期的凭证" label="隐藏已过期的凭证" x="40" y="735" width="135" height="21"/>
+ <XCUIElementTypeSwitch type="XCUIElementTypeSwitch" value="1" x="329" y="731" width="63" height="29"/>
+ </XCUIElementTypeSwitch>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="772" width="430" height="18"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="789" width="430" height="19"/>
+ <XCUIElementTypeCell type="XCUIElementTypeCell" name="PKOrderManagementDisabled" x="20" y="807" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="807" width="390" height="54">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="20" y="807" width="390" height="54">
+ <XCUIElementTypeSwitch type="XCUIElementTypeSwitch" value="1" name="PKOrderManagementDisabled" label="订单追踪" x="40" y="820" width="350" height="28">
+ <XCUIElementTypeButton type="XCUIElementTypeButton" name="PKOrderManagementDisabled" label="订单追踪" x="40" y="823" width="68" height="22"/>
+ <XCUIElementTypeSwitch type="XCUIElementTypeSwitch" value="1" x="329" y="819" width="63" height="29"/>
+ </XCUIElementTypeSwitch>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeCell>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="860" width="430" height="18"/>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="100%" name="垂直滚动条, 2页" label="垂直滚动条, 2页" x="397" y="113" width="30" height="764">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="424" y="204" width="3" height="670"/>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" value="0%" name="水平滚动条, 1页" label="水平滚动条, 1页" x="55" y="899" width="320" height="30">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="58" y="926" width="314" height="3"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeTable>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeToolbar type="XCUIElementTypeToolbar" name="Toolbar" label="工具栏" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeToolbar>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeToolbar type="XCUIElementTypeToolbar" name="Toolbar" label="工具栏" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeToolbar>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932">
+ <XCUIElementTypeOther type="XCUIElementTypeOther" x="0" y="0" width="430" height="932"/>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeOther>
+ </XCUIElementTypeWindow>
+</XCUIElementTypeApplication>
+