# Mac Configurations

Here are examples of different Mac configurations for building for different plaforms.

# OSX Builds

In our OSX example we have used XCode 10.1 which is automatically setup when creating a template c++ project, see our Quick Start Guide. You can find the XCode project files under com.company.cocos/proj.ios_mac/...

If no XCode project was generated, you are likely using a newer version of Cocos2d-x and not 3.17.x

# XCode Settings

Configure the following settings in your XCode Project for all targets:

  1. Include the following folders to the project: Frameplay, Frameplay/Native/Source, and Resources/Frameplay
  2. Add the header search path: $(SRCROOT)/../Frameplay to General>Header Search Paths

Configure the following settings in your XCode Project for desktop target:

  1. Add Frameplay/Native/Platforms/Mac/libFrameplayNative.dylib to Frameworks.
  2. Add libFrameplayNative.dylib to General>Embedded Binaries.
  3. Change the Destination of libFrameplayNative.dylib in Build Phases>Embedded Libraries to Executables.
  4. Add $(SRCROOT)/../Frameplay/Native/Platforms/Mac to Build Settings>Library Search Paths.
  5. Add @executable_path to Build Settings>Runpath Search Paths

# Build Mac

You should now be able to build in XCode 10.x and see the template project open up, displaying a handful of mock advertisements. You can also build by running the following commands. Successful builds will be located in com.company.cocos/bin/debug/mac/...

cd ./com.company.cocos
cocos compile -p mac -m debug

# iOS Builds

# XCode Settings

Configure the following settings in your XCode Project for all targets:

  1. Include the following folders to the project: Frameplay, Frameplay/Native/Source, and Resources/Frameplay
  2. Add the header search path: $(SRCROOT)/../Frameplay to General>Header Search Paths

Configure the following settings in your XCode Project for desktop target:

  1. Add Frameplay/Native/Platforms/iOS/FrameplayNative.Framework to General>Linked Frameworks and Libraries.
  2. Add $(SRCROOT)/../Frameplay/Native/Platforms/iOS to Build Settings>Framework Search Paths.

# Build iOS

You should now be able to deploy to and iOS device through build in XCode 10.x and see the template project open up, displaying a handful of mock advertisements. You can also build by running the following commands. Successful builds will be located in com.company.cocos/bin/debug/ios/...

cd ./com.company.cocos
cocos compile -p ios -m debug

# Android Builds

We don't build the Android APK on Mac in this example although it can be done!

Last Updated: 7/5/2022, 11:26:50 PM