Prerequisites
Before installing Buck, ensure you have the following prerequisites:Java 8
Buck requires Java 8 to run. You can download it from:- Oracle Java SE Development Kit 8
- Or use a package manager like Homebrew:
brew install openjdk@8
macOS Development Tools
For iOS development with Buck, you’ll also need:- Xcode: Download from the Mac App Store
- Command Line Tools: Install via
xcode-select --install
Installing Buck
Install Buck using Make
BuckSample includes a convenient Make command that downloads and installs Buck:This command performs the following actions:
- Downloads Buck from Airbnb’s fork hosted on JitPack
- Saves the Buck executable to
tools/buck - Makes the file executable
The Makefile downloads a specific version of Buck that Airbnb has tested and verified:
Verify Buck installation
Confirm that Buck is installed correctly:You should see version information displayed:
Installation Details
Buck Executable Location
The Makefile configures Buck to be installed locally in the project:- Version consistency: Every developer uses the same Buck version
- No global installation: No conflicts with other projects
- Easy updates: Update Buck by re-running
make install_buck
What Gets Installed
Buck is distributed as a.pex file (Python EXecutable), which is a self-contained Python application. The downloaded file:
- Contains all Buck dependencies
- Requires only Java 8 to run
- Can be executed directly without additional setup
Optional Dependencies
CocoaPods (Optional)
If you need to update or modify CocoaPods dependencies:Ruby Gems (Optional)
For Buck Local functionality (generates Xcode projects that invoke Buck):Troubleshooting
Java Version Issues
If Buck fails to run, check your Java version:Permission Denied
If you get a “Permission denied” error when running Buck:Download Failures
If the Buck download fails:- Check your internet connection
- Try downloading manually:
Next Steps
Now that Buck is installed, you’re ready to build and run the example app:- Quickstart Guide - Build and run your first Buck iOS application
Configuration Reference
Buck’s behavior is controlled by.buckconfig in the project root. Key settings include: