Railway应用部署
云端零配置部署管理
该技能通过命令行完成macOS/iOS原生应用的性能采集与分析,无需打开Instruments图形界面。使用xctrace录制Time Profiler数据,提取样本后进行符号化处理,定位代码热点。
安装要求:需要Xcode命令行工具(xcrun),Python 3环境,以及rg(ripgrep)工具。
步骤一:录制性能数据(附加模式)
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --attach <pid>
步骤二:录制性能数据(启动模式)
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --launch -- /path/App.app/Contents/MacOS/App
步骤三:提取时间样本
scripts/extract_time_samples.py --trace /tmp/App.trace --output /tmp/time-sample.xml
步骤四:获取加载地址
vmmap <pid> | rg -m1 "__TEXT" -n
步骤五:符号化并输出热点
scripts/top_hotspots.py --samples /tmp/time-sample.xml --binary /path/App.app/Contents/MacOS/App --load-address 0x100000000 --top 30
见下方输入与输出表格。
| 项目 | 内容 |
|---|---|
| 输入 | 目标应用PID或二进制路径;Time Profiler模板配置;录制时长(默认90秒);可选的加载地址(用于符号化) |
| 输出 | Instruments .trace文件;时间样本XML数据;热点函数排名列表;符号化后的调用栈 |
| 适用人群 | iOS/macOS原生应用开发者;性能优化工程师;CI/CD自动化流程集成 |
| 不包含 | Android应用分析;网络性能监控;内存泄漏检测(需Allocations模板);UI自动化测试 |
原始链接:https://github.com/openclaw/skills/tree/main/skills/steipete/native-app-performance/SKILL.md
来源类型:GitHub仓库