diff --git a/scripts/local_test.sh b/scripts/local_test.sh index 0f0e3e3..b42d303 100755 --- a/scripts/local_test.sh +++ b/scripts/local_test.sh @@ -53,7 +53,9 @@ if [ "${1:-}" = "--ios" ]; then cd client flutter build ios --release --config-only "${DEFINES[@]}" cd ios - CD_ID="$(xcrun devicectl list devices 2>/dev/null | grep 'available (paired)' | grep 'iPhone' | grep -oE '[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}' | head -1 || true)" + # 已配对可安装的 iPhone:新版 Xcode(devicectl) USB 直连并解锁显示 "connected", + # 旧版曾显示 "available (paired)";两者都收。-w 词匹配避免误命中 disconnected/unavailable。 + CD_ID="$(xcrun devicectl list devices 2>/dev/null | grep 'iPhone' | grep -Ew 'connected|available' | grep -oE '[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}' | head -1 || true)" if [ -z "$CD_ID" ]; then echo "!! 未检测到已配对 iPhone(插线并解锁后重试)" >&2 exit 1