您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

run-packager.sh 737B

12345678910111213141516171819
  1. #!/bin/bash
  2. # This script is executed from Xcode to start the React packager for Debug
  3. # targets.
  4. export RCT_METRO_PORT="${RCT_METRO_PORT:=8081}"
  5. echo "export RCT_METRO_PORT=${RCT_METRO_PORT}" > "${SRCROOT}/../../node_modules/react-native/scripts/.packager.env"
  6. if [[ "$CONFIGURATION" = "Debug" ]]; then
  7. if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then
  8. if ! curl -s "http://localhost:${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then
  9. echo "Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly"
  10. exit 2
  11. fi
  12. else
  13. open -g "$SRCROOT/../../node_modules/react-native/scripts/launchPackager.command" || echo "Can't start packager automatically"
  14. fi
  15. fi