React Native - Xcode 模拟器上的 .app 文件要求 Bundle URL

React Native - .app file on Xcode Simulator asking for Bundle URL

我想为我的 React Native 应用程序生成 .app 或 .ipa 文件,以便我可以使用它在模拟器上使用 Appium 进行自动化测试。 这是我用来为模拟器构建应用程序文件的命令(使用 Fastlane)

lane :buildForAutomation  do |options|

xcodebuild(scheme: "CavionNovus",
           xcargs: "-configuration 'Debug' -sdk 'iphonesimulator' -destination 'generic/platform=iOS Simulator' "
           )

end

这将生成一个 .app 文件。我已经使用下面的命令在模拟器上安装了相同的

xcrun simctl install booted ./CavionNovus.app

它将成功安装应用程序,启动时将等待几秒钟并在屏幕上显示错误消息。

它要求 metro bundle packager 。 所以我的疑问是

我们是否需要像 metro bundler 这样的打包器来 运行 模拟器中的 .app 文件? 如果是这样,我如何在构建过程中添加它?

使用 xcodebuild(scheme: "CavionNovus", xcargs: "-configuration 'Debug' -sdk 'iphonesimulator' -destination 'generic/platform=iOS Simulator'") 时,您正在调试模式下构建 ipa。要在没有 Metro Bundler 的情况下 运行 您的应用程序,您必须将配置更改为 release