2

Simply i have two frameworks from a payment provider, they provide Debug and Release frameworks, to be used for different environments.

I was trying to configure/find out on the web of a way that i can configure the import of both of them in one scheme, and depending on the Build Configuration it will switch between Debug and Release framework.

I played with Framework Search path for example Debug to have debug url to framework, and the same for Release to link to release framework url to file.

Im looking for something more usable and easy such as run script, or stying away from manual import for each build configuration.

Note: Framework has the same name, as well as the framework is build with objective-c without single header import.

Nata Mio
  • 2,168
  • 3
  • 22
  • 46

2 Answers2

1

You can try below approach,

  • Create a new folder "Frameworks" in the project directory where .xcodeproj exists.

  • Place release framework in /Frameworks/Release/arm64/

  • Place debug framework in /Frameworks/Debug/x86_64/

Paste below script in Build Phases -> Run Script:

cp -r "$PROJECT_DIR/Frameworks/$CONFIGURATION/$ARCHS" "$PROJECT_DIR/"
rm -dfR <Name of the framework> && \
cp -pRP "$ARCHS" <Name of the frameowrk> && \
rm -rf "$ARCHS"
0

not sure if it suits your needs, but you can try

#if DEBUG
 import debugFramework
#else
 import releaseFramework
#endif
Bartosz Jarosz
  • 188
  • 1
  • 5