NOTE: Since March 2023, obs-studio
uses an updated build system on macOS that automated most steps required in old build systems. Build instructions for the legacy build system are retained in this document, albeit in a simplified form reflecting the suggested way macOS builds should be approached.
Clone the repository including submodules:
git clone --recursive https://github.com/obsproject/obs-studio.git
Check available CMake presets cmake --list-presets
Select preset for desired build architecture (macos-arm64
or macos-x86_64
): cmake --preset macos-arm64
build_arm64
or build_x86_64
)obs-studio
scheme from the scheme browser at the top of the Xcode window+
to build the project (or +
to build and run it).Alternatively the project can also be built on the command line:
build_arm64
or build_x86_64
)xcodebuild -configuration -scheme obs-studio -parallelizeTargets -destination "generic/platform=macOS,name=Any Mac"
open UI//OBS.app
HINT: You can install the tool xcbeautify
to make the xcodebuild
output more readable - the suggested way to run the build command changes slightly in that case: set -o pipefail && 2>&1 | xcbeautify
CMake creates an install
scheme that will automatically install OBS into the Applications
directory. Choose this scheme from within Xcode (or specify via the command line) and build the project.
To generate optimised and fully codesigned application bundles, use the archive and export functions provided by Xcode:
Custom build options can be provided to CMake after specifying the CMake preset:
cmake --preset macos-arm64 -DENABLE-BROWSER:BOOL=OFF
ccmake --preset macos-arm64
Starting with macOS 11, it is best practice to always codesign all binaries on macOS. For local execution an ad-hoc signature is sufficient, which Xcode will handle automatically ("Sign to Run Locally").
Because macOS stores application permissions (e.g., webcam access, microphone access, screen recording) based on code signatures, this has the side-effect of permissions not being applied to updated binaries (the underlying hashes will not match the entry in macOS' database).
The only way to fix this is to compile the application with a valid Apple developer certificate, as the code signature will not change between builds of the application and permissions will "stick".
Because obs-studio
is made up of multiple independent parts, signing is most easily configured via CMake: Specify a developer team ID via -DOBS_CODESIGN_TEAM
(you can find your team identifier in the Apple developer portal). This will enable automatic codesigning in Xcode for all targets built by the project.
When building (and packaging) on CI, a developer identity need to be provided instead via -DOBS_CODESIGN_IDENTITY
. An identity commonly takes a form of a string like Developer ID Application: ()
. This needs to match the name of the developer certificate that is installed on the machine.
To specify a provisioning profile (needed in future versions of obs-studio
with certain macOS features enabled), pass either the name or UUID of the provisioning profile to CMake via -DOBS_PROVISIONING_PROFILE
. If the provisioning profile is correctly installed in the system (usually by importing it via Xcode or copying it to ~/Library/MobileDevice/Provisioning\ Profiles
) Xcode will automatically pick it up. It will also be used for archiving and exporting.
NOTE: The following instructions only apply to the legacy build system superseded by the instructions above. They are retained here for the time being to allow building older versions of obs-studio
for now-unsupported versions of macOS.
Custom macOS builds allow full customization of the desired build configuration but also require manual setup and preparation. Available CMake configuration variables can be found in the CMake build system documentation.
xcode-select --install
in Terminal, orFFmpeg
, x264
, mbedTLS
, Qt
and more)~/development/obs-build-dependencies/obs-deps
git clone --recursive https://github.com/obsproject/obs-studio.git
(If you do not know what submodules are, or you are not using Git from the command line, PLEASE make sure to fetch the submodules too.)
CI/macos/01_install_dependencies.sh
from the checkout directory (run it with the --help
switch to see all available options). NOTE: The directory where the script will download and setup the dependencies in cannot be changed.
cmake -S . -B build -G Xcode \
-DCEF_ROOT_DIR="~/development/obs-build-dependencies/cef_binary_5060_macos_x86_64" \
-DCMAKE_PREFIX_PATH="~/development/obs-build-dependencies/obs-deps" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DCMAKE_OSX_ARCHITECTURES="x86_64"
Optional Settings:
-DOBS_BUNDLE_CODESIGN_IDENTITY="[YOUR_IDENTITY]"
or a team using -DOBS_BUNDLE_CODESIGN_TEAM="[YOUR_TEAM_ID]"
-DCMAKE_INSTALL_PREFIX=[YOUR INSTALL DESTINATION]
.-G Ninja
or -G 'Unix Makefiles'
-DCMAKE_BUILD_TYPE=RelWithDebInfo
obs-studio.xcodeproj
from the build directory (or any other directory specified via the -B
switch above)obs
schema, recognisable by the OBS Studio app icon.
Installation will use the directory specified via -DCMAKE_INSTALL_PREFIX
or can be customised with the --prefix
switch for Ninja-based builds.
If using Xcode:
install
schemaIf using the command line (Xcode, Ninja, or GNU Makefiles):
cmake --build build
cmake --install build