运行 本地 iOS 设备上的 react-native 应用程序使用 fastlane 匹配方法

Running react-native app on local iOS device with fastlane match method

我正在使用 fastlane 将我的 react-native 应用程序的测试版部署到 TestFlight。 我遵循了一个教程,该教程建议在 Xcode 中禁用 Automatic Signing 并使用 fastlane match 方法:它工作得很好。 (Fastlane tutorial)

我现在想做的是在我自己的本地设备上调试我的应用程序:
我尝试从 Xcode 执行此操作,但出现此错误:

我还安装了 ios-deploy 并尝试了 react-native run-ios --device 命令,它没有给我任何错误,但是应用程序 没有出现在我的设备上 .

如果您将此方法添加到您的 fastfile 中,您可以注册新设备:

desc "Register new devices"
lane :register do
    device_name = prompt(text: "Enter the device name: ")
    device_udid = prompt(text: "Enter the device UDID: ")
    device_hash = {}
    device_hash[device_name] = device_udid
    register_devices(devices: device_hash)
    match(force: true)
  end

然后 运行 fastlane register 在控制台中添加你的名字(任何你想要的)和 phone 的 UDID。那应该注册您的设备并让您构建它。希望对您有所帮助!