Start a macOS Project
Important
LiveSwitch doesn’t officially support building a macOS project on Apple M1 devices due to the shift to ARM64. For more details, contact Support.
If you are starting an macOS project, create a new XCode project. Add the LiveSwitch libraries to your project in Xcode - they're the files under macOS/Libraries found in the downloaded ZIP file from the LiveSwitch Console. You should include, at minimum, the following:
libFMLiveSwitch.a
libFMLiveSwitchOpus.a
libFMLiveSwitchVpx.a
libFMLiveSwitchYuv.a
Note
Once you have added the libraries into the Xcode project folder you will still need to link them to the project. You can do this by opening the main project/solution file on the left and go to the 'Build Phases' tab. From there select the 'Link Binary with Libraries' section and select the '+' button. From there select the 'Add Other' dropdown then select the 'Add Files' option. From here find where you stored the libraries in the project and add the new references.
As with other project types, you also need some way to capture audio and video data. LiveSwitch provides a module to handle this. Include:
libFMLiveSwitchCocoa.a
Your project also needs some Apple framework dependencies. Include the following frameworks:
libz.dylib
AudioToolbox.framework
AudioUnit.framework
AVFoundation.framework
CoreAudio.framework
CoreGraphics.framework
CoreMedia.framework
CoreVideo.framework
Security.framework
VideoToolbox.framework
After you have added these dependencies, the last thing to do is to add -ObjC
linker flag. If you don't do this, you are going to get load errors at run time. You can add this under the "Other Linker Flags" section under the build settings for your current build target.
Warning
Don't add the -all_load
flag because it can result in duplicate symbol definitions.