我正试图在我的iPhone中直接运行本机应用程序
命令react-native run-ios --device "XXXX device "
不适合我
得到。
在***** iPhone6上安装并启动您的应用... **安装成功**
Unable to mount developer disk image, (Error Domain = com.apple.dtdevicekit Code = 601 "Could not locate device supportfiles."
UserInfo = {
DeviceType = iPhone7,
2,
NSLocalizedDescription = Could not locate device support files.,
NSLocalizedRecoverySuggestion = This iPhone 6 is running iOS 11.3(15E216),
which may not be supported by this version of Xcode.
}) {
DeviceType = "iPhone7,2";
NSLocalizedDescription = "Could not locate device support files.";
NSLocalizedRecoverySuggestion = "This iPhone 6 is running iOS 11.3 (15E216), which may not be supported by this version of Xcode."
}
xcodebuild:错误:无法找到与提供的目标说明符匹配的目标:{ id:2 dcfa6f3928359203a08971f89513000a776d10f }
不支持的设备说明符选项。 设备“我的Mac”不支持以下选项:id 请仅提供支持的设备说明符选项。
答案 0 :(得分:0)
您可以在没有特定设备名称的情况下运行react-native run-ios
。
如果您想使用特定设备运行,请先运行xcrun simctl list devices
它将列出所有设备并选择任何设备并使用以下命令运行
react-native run-ios --simulator="DEVICE_NAME"
ex:react-native run-ios --simulator="iPhone 4s"
在物理设备上运行应用程序: 按照以下步骤
1)adb start-server
2)adb reverse tcp:8081 tcp:8081
Camera P2P
。3)adb设备
4)react-native run-android
5)adb install android / app / build / outputs / apk / app-debug.apk
6)react-native start
参考:https://facebook.github.io/react-native/docs/running-on-simulator-ios.html#specifying-a-device
答案 1 :(得分:0)
您应该指定simulator
参数,了解更多Running On Simulator
react-native run-ios --simulator="iPhone X"