macOS Installation
Note: macOS support for the full range of functionality offered by the SDK is not yet complete. If you need support for R200 or the ZR300, legacy librealsense offers a subset of SDK functionality.
macOS 12+ (Monterey) and newer
sudo required for USB access. On macOS 12+ most librealsense tools that use libusb must be run with elevated privileges. This is due to macOS USB security changes and overriding the default UVC driver.
# examples
sudo examples/rs-multicam
sudo examples/rs-enumerate-devices
sudo examples/rs-hello-realsense
sudo examples/rs-depth
Current Limitations:
RealSense Viewer is not supported on macOS in the current release
Motion sensors (IMU) are disabled on macOS in the current release
Building from Source
Install CommandLineTools
sudo xcode-select --installor download XCode 6.0+ via the AppStoreInstall the Homebrew package manager via terminal - link
Install the following packages via brew:
brew install cmake libusb pkg-config openssl
Note librealsense requires CMake version 3.10 that can also be obtained via the official CMake site.
Clone the repo
git clone https://github.com/realsenseai/librealsense.git
Generate XCode project:
mkdir build && cd buildsudo xcode-select --resetcmake .. -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true -DFORCE_RSUSB_BACKEND=ON
Build the Project
make -j2
Note: On some Mac systems you might encounter
ld: library not found for -lusb-1.0error (either in the terminal during make or in XCode) This can be worked-around by setting environment variable:/bin/launchctl setenv LIBRARY_PATH /usr/local/lib
Note: On some Mac systems you might encounter
Could NOT find OpenSSLerror (Usually when setting-DCHECK_FOR_UPDATES=ON), this can be worked-around by setting a global variableexport OPENSSL_ROOT_DIR=`brew --prefix openssl`
Note: You can find more information about the available configuration options on this wiki page.
Packaging your application
librealsense requires libusb to be bundled in the application. To fix the real-time linking, use
install_name_tool
install_name_tool -change /usr/local/opt/libusb/lib/libusb-1.0.0.dylib @rpath/libusb-1.0.0.dylib librealsense2.dylib
Copy
libusb-1.0.0.dylibandlibrealsense2.dylibto your application’sFrameworksfolder