Fix setup on stock macOS bash, shader step false success, battery gate misreport (#4, #5, #7)

- Brace every $NAME that is directly followed by a non-ASCII character in the shell scripts: bash 3.2 in a UTF-8 locale read the first byte of the following character as part of the variable name and aborted under set -u (#4, #6).
- setup.sh and d2rm_pack.py: the shader translation step is complete only when every entry in the completion marker is ok and every library file exists; the script's exit status is no longer hidden by a pipe (#5).
- devbattery.sh / devlock.sh: a missing local timeout or ideviceinfo is reported as such and stops at once, instead of being reported as an offline device and polled for up to an hour (#7).
- smoke_mac.sh builds its package for iPhone only regardless of the project default.

Reported by @SakuraToErii. The setup.sh part of #4 was also submitted by @hubeiqiao in #6.

Co-authored-by: hubeiqiao <12777592+hubeiqiao@users.noreply.github.com>
This commit is contained in:
jhaizhou
2026-10-13 03:17:23 +08:00
co-authored by hubeiqiao
parent 824d2d3f0b
commit 66c3a2fb70
28 changed files with 121 additions and 68 deletions
+2 -2
View File
@@ -52,7 +52,7 @@ EOF
)
dc process launch --device $D --terminate-existing --environment-variables "$ENV" --json-output "$OUT/launch.json" $B -mode boot > "$OUT/launch.log" 2>&1
PID=$(python3 -c "import json;print(json.load(open('$OUT/launch.json'))['result']['process']['processIdentifier'])")
t "启动 pid $PID,跑 ${CAP}s"; sleep "$CAP"
t "启动 pid ${PID},跑 ${CAP}s"; sleep "$CAP"
dc process terminate --device $D --pid "$PID" > "$OUT/stop.log" 2>&1 && t "已停 pid $PID" || t "pid $PID 已自行退出"
# 只拉本局产物(Documents 里有 9 GB romfs,不整目录拉):启动日志、四份记录、脚本里的截图
# E2E_PULL(空格分隔,不带本局前缀,如 "c2s.jsonl state.jsonl s2.png"):只拉这几份——每次 copy from 约 20 s,全拉会把锁内时间拖过 2 分钟
@@ -63,6 +63,6 @@ ALL="boot.txt ${RID}_c2s.jsonl ${RID}_uimsg.jsonl ${RID}_ticks.jsonl ${RID}_targ
for f in $ALL; do
g=${f#${RID}_} # 拉回后去掉本局前缀,结果目录里的文件名与旧版一致(e2e_* 照旧) | After pulling, strip this run's prefix so the file names in the result directory match the old version (e2e_* unchanged)
case $f in ${RID}_*.jsonl) g=e2e_$g;; esac
dc copy from --device $D --domain-type appDataContainer --domain-identifier $B --source "Documents/$f" --destination "$OUT/$g" >> "$OUT/copy.log" 2>&1 || t "【红】拉不到 $f(本局没写)"
dc copy from --device $D --domain-type appDataContainer --domain-identifier $B --source "Documents/$f" --destination "$OUT/$g" >> "$OUT/copy.log" 2>&1 || t "【红】拉不到 ${f}(本局没写)"
done
left=$(pids); [ -z "$left" ] && t "设备上 DmIOS 进程 0" || t "【红】仍有 DmIOS 进程 $left"