update: 同步 emu* 脚本至 einz 最新版

- emuResolveIos.js:裸跑时 Booted 优先、否则取系统版本最高的 iPhone;
  EMU 环境变量最高优先;短名表扩至 ip17 系列;修复 rootDir 指向错误
  导致项目 config 永远读不到的问题
- emuBootIos.sh:Xcode 27+ 不再随附 Simulator.app,检测后跳过并提示
  DeviceHub

来源:~/einz/scripts/(拷贝后 einz 侧持续演进,此处为落后快照)

Co-Authored-By: AtomCode (glm5.3-flash) <[email protected]>
This commit is contained in:
luk
2026-10-16 22:02:16 +08:00
co-authored by AtomCode
parent f743ce02ef
commit 75ae4e9e22
2 changed files with 90 additions and 12 deletions
+12 -2
View File
@@ -9,7 +9,7 @@
# npm run app-ios-boot -- FF429526-A7EE-… # 直接给 UDID
# [email protected] npm run app-ios-boot # 用环境变量改默认
#
# 短名表见 emuResolveIos.js 的 builtinAlias(ip16 / ip16plus / ip16pro / ip16pm),
# 短名表见 scripts/emuResolveIos.js 的 builtinAlias(ip16 / ip16plus / ip16pro / ip16pm),
# 也可以在 package.json 的 config 里加("ipad": "iPad Pro 13-inch (M4)")。
#
# 跑 App 永远打「当前已启动的那台」(纯 booted 语义):
@@ -27,5 +27,15 @@ if xcrun simctl boot "${udid}" 2>/dev/null; then
else
echo "(已在运行,跳过 boot)"
fi
open "$(xcode-select -p)/Applications/Simulator.app"
# Xcode 27 起不再随附 Simulator.app(simctl 独立工作);模拟器 GUI 改由
# DeviceHub(Xcode.app/Contents/Applications/DeviceHub.app)承担——有就开它,
# 没有就跳过(flutter run 也会自己唤起模拟器窗口)。
SIM_APP="$(xcode-select -p)/Applications/Simulator.app"
if [ -d "$SIM_APP" ]; then
open "$SIM_APP"
else
echo "(本机 Xcode 无 Simulator.app(Xcode 27+ 已移除),跳过开 GUI)"
echo " 看模拟器界面:open -b com.apple.dt.Devices # DeviceHub"
echo " 或直接 flutter run,会自动把模拟器窗口带到前台"
fi
xcrun simctl list devices booted