You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode 15.3执行react-native run-ios或运行时出现PhaseScriptExecution错误

解决React Native iOS构建报错:Command PhaseScriptExecution failed with a nonzero exit code

先处理重复模拟器警告

  • 打开Xcode,进入Window > Devices and Simulators
  • 在Simulators标签下找到重复的iPhone SE (3rd generation)实例,删除多余的那个
  • 或者用命令行直接删除重复实例:
    xcrun simctl delete 6E42CF4B-E0CD-40CE-99F8-81AF07DEC3D5
    

清理缓存与重建依赖

  • 清理Node模块和缓存:
    rm -rf node_modules
    npm cache clean --force
    npm install
    
  • 清理iOS Pods依赖并重新安装:
    cd ios
    rm -rf Pods Podfile.lock
    pod deintegrate
    pod install
    
  • 删除Xcode派生数据(报错里指定的目录):
    rm -rf ~/Library/Developer/Xcode/DerivedData/Vincho-blolxiechfckjwewixzdfkxtcoiw
    

修复脚本执行权限

  • 给报错的Shell脚本添加执行权限:
    chmod +x /Users/user/Library/Developer/Xcode/DerivedData/Vincho-blolxiechfckjwewixzdfkxtcoiw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-rncore.build/Script-46EB2E0001DA30.sh
    
  • 也可以在Xcode里检查:打开Pods工程的React-rncore目标,进入Build Phases,找到[CP-User] Generate Specs脚本,确认Shell路径为/bin/sh,且脚本有执行权限。

重新构建

  • 关闭Xcode,重新打开项目
  • 执行react-native run-ios,或者在Xcode中选择正确的模拟器后点击运行

内容的提问来源于stack exchange,提问作者Alireza Piran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 00:12:18