代码之家  ›  专栏  ›  技术社区  ›  Lester

React native-缺少srcipt:ios

  •  1
  • Lester  · 技术社区  · 6 年前

    如何在iOS刺激器中运行react本机应用程序?

    npm run ios 但我有个错误 missing srcipt: ios

    如何解决这个问题?

    enter image description here

    3 回复  |  直到 6 年前
        1
  •  3
  •   Kirankumar Dafda    6 年前

    你可以用简单的方法运行你的项目

    react-native run-ios
    

    如果你想在任何特定的模拟器设备上运行

    react-native run-ios --simulator="iPhone 6s" // Check your available devices
    
        2
  •  0
  •   Nah    6 年前

    通常我们有 package.json 使用任何命令行脚本,例如:

    "scripts": {
        "test": "node ./node_modules/jest/bin/jest.js --watchAll",
        "dev": "exp start --dev --lan",
        "build-android": "exp build:android",
        "build-ios": "exp build:ios"
    },
    

    你可以用任何东西来标记它们,例如。 "test" 可命名为 "mytest"

    在我上面给出的例子中,您可以看到命令 exp

    使用 npm install -g exp 命令。然后可以运行自定义添加的脚本。

    如果有什么不明白的地方,再问一次。

        3
  •  0
  •   Jordan Daniels    6 年前

    react-native run-ios

    https://facebook.github.io/react-native/docs/running-on-simulator-ios.html

    如果这不起作用,您可以在xcode中打开project目录/app/ios/[your project name].xcodeproj,然后直接在xcode中运行模拟器。