To test the API in Xcode, we are trying to use NLTHTTPStubServer as a dummy server.
I tried the preprocessor macro to change the URL of the development environment and the URL in the test, but it didn't work.
What I've done
Duplicate "Debug" and create "Debug_copy"
2. Set "DEVELOPMENT_ENV" to "Debug_copy" preprocessor macro
3. Change Test Debug to Debug_copy from Schema Settings
4. Set production code to change URL constants with or without DEVELOPMENT_ENV definition
5. Running the test will cause the build to fail.
The details of the error are as follows:
ld —library not found for-lAFNetworking
clang:error:linker command failed with exit code 1 (use-v to see invocation)
I don't know why the error occurs because I haven't changed anything other than defining the macro.
If anyone knows the cause and how to dynamically change the compilation when running the test, please let me know.
The purpose is to set the URL (string) for the test during the test.
Do you happen to use CocoaPods?
Otherwise, ignore this answer.
If you use CocoaPods, I think you can solve this problem by using the one for Debug_copy when linking the libraries on the Pods side.
*The xxxx part is the project name of the application
Hello
I use the same method of switching behavior using macros on a daily basis.
I don't know the details, but I will answer because it might be a hint.
The original Debug has been successfully built, so why don't you try setting the DEVELOPMENT_ENV macro on the original Debug?
If that works, there should be something missing in Debug_copy's settings.
I think you can find it if you check Build Settings to kill the cold.
Is it related to the search path as it seems that the library cannot be found?
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
578 Understanding How to Configure Google API Key
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.