React Native App的自定义iOS(登台)配置

Abr*_*m P 5 xcode development-environment environment-variables ios react-native

我已经为我的React Native应用程序创建了一个临时配置,作为我的Release版本的克隆.但是,当我运行时react-native run-ios --configuration Staging,我的构建失败了:

Installing build/Build/Products/Staging-iphonesimulator/flockCover.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Staging-iphonesimulator/myApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Run Code Online (Sandbox Code Playgroud)

在检查构建之后,似乎出现了一些问题:1)CodeSign正在Release版本上运行,如下所示:

CodeSign build/Build/Products/Release-iphonesimulator

2)从版本构建生成符号:

GenerateDSYMFile build/Build/Products/Release-iphonesimulator/flockCover.app/PlugIns/flockCoverTests.xctest.dSYM build/Build/Products/Release-iphonesimulator

其他各种事情都指向Release.

进一步检查表明这是因为我的(构建)环境变量设置不正确,例如:

export BUILT_PRODUCTS_DIR=/Users/name/github/company/app/ios/build/Build/Products/Release-iphonesimulator
export CODESIGNING_FOLDER_PATH=//Users/name/github/company/app/ios/build/Build/Products/Release-iphonesimulator/flockCover.app
export CONFIGURATION=Staging
export CONFIGURATION_BUILD_DIR=/Users/name/github/company/app/ios/build/Build/Products/Release-iphonesimulator
export CONFIGURATION_TEMP_DIR=/Users/name/github/company/app/ios/build/Build/Intermediates/ReactNativeConfig.build/Staging-iphonesimulator
Run Code Online (Sandbox Code Playgroud)

此外,所有第三方库(例如React-Native,Yoga)都在发布模式下运行,结果如下:

export CLASS_FILE_DIR==/Users/name/github/company/app/ios/build/Build/Intermediates/ReactNativeConfig.build/Release-iphonesimulator/ReactNativeConfig.build/JavaClasses
Run Code Online (Sandbox Code Playgroud)

一个有趣的说明,并非所有事情都指向Release,除了最终的错误信息之外,还有以下内容:

=== BUILD TARGET myApp OF PROJECT myProject WITH CONFIGURATION Staging ===

Ld build/Build/Intermediates/flockCover.build/Staging-iphonesimulator(更不用说CONFIGURATION上面的环境变量了.

所以我的问题如下:1)如何正确设置这些环境变量(具体来说CODESIGNING_FOLDER_PATH,CONFIGURATION_BUILD_DIR等等)2.如何在依赖库中构建一个与我的应用程序配置不同的依赖库(例如React).我是否还需要在那里创建配置?3)这首先是导致我的问题的原因吗?