我有一个 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>常规设置中是否设置了Bundle标识符,同时在构建设置>打包下也有一个字段,其中
app.appname
已正确设置。