【发布时间】:2021-03-12 05:54:06
【问题描述】:
我有一个 ReactNative 0.63.2 项目。它运行在模拟器上,它运行在物理设备上。决定现在就开始使用 Detox。
在运行示例测试时,我遇到了这个错误:
Error: field CFBundleIdentifier not found inside Info.plist of app binary at /Users/jesus/Documents/projects/appname/ios/build/Build/Products/Debug-iphonesimulator/Appname.app
在我的Info.plist:
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
我的.detoxrc.json:
{
"testRunner": "jest",
"runnerConfig": "e2e/config.json",
"configurations": {
"ios": {
"type": "ios.simulator",
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Appname.app",
"build": "xcodebuild -project ios/Appname.xcodeproj -scheme Appname -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"device": {
"type": "iPhone 11"
}
},
"android": {
"type": "android.emulator",
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"device": {
"avdName": "Pixel_API_28_AOSP"
}
}
}
}
我检查了 Xcode > General 中是否设置了 Bundle Identifier。在 Build Settings > Packaging 下还有一个字段,其中 app.appname 设置正确。
【问题讨论】:
标签: ios react-native detox