Not sure if this is the best solution but it appears to work for me.
If you add a build script below target dependancies then add in the following code. This assumes you have 2 libraries
- library.a
- library_simulator.a
The project would be set up to use library.a and if you are using the simulator the script will remove library.a and replace it with library_simulator.a. You would need to add the simulator to your build scheme to make sure it is built when doing a build and both libraries would need the same interface.
if [[ "${SDKROOT}" == *Simulator* ]]
then
if [[ -f "${BUILT_PRODUCTS_DIR}/library.a"]]
then
rm -rf "${BUILT_PRODUCTS_DIR}/library.a"
fi
mv "${BUILT_PRODUCTS_DIR}/library_simulator.a" "${BUILT_PRODUCTS_DIR}/library.a"
fi
Not sure how much use this is to you, I only tested it briefly. Hope it helps.