tools/buck.
Build Commands
build
build
Builds the main ExampleApp target for development.Implementation:Use case: Standard development builds with debug configuration.
build_release
build_release
Builds the ExampleApp target with release configuration.Implementation:Use case: Production builds with optimizations enabled.
watch
watch
Builds the watchOS app extension.Implementation:Use case: Building the watchOS companion app.
message
message
Builds the iMessage extension.Implementation:Use case: Building the iMessage app extension.
Installation & Setup
install_buck
install_buck
Downloads and installs the Buck build tool.Implementation:Use case: First-time setup or updating Buck version.
update_cocoapods
update_cocoapods
Updates CocoaPods repository and installs dependencies.Implementation:Use case: Updating third-party dependencies managed by CocoaPods.
install_ruby_gems
install_ruby_gems
Installs Ruby dependencies using Bundler.Implementation:Use case: Installing Ruby tools needed for BuckLocal and testing.
Testing Commands
test
test
Runs unit tests with code coverage reporting.Implementation:Features:
- Runs CI test bundle
- Generates code coverage data (.profraw files)
- Merges coverage data into .profdata
- Generates coverage report
- Excludes third-party code (Pods, Carthage, buck-out)
buck_out: Buck’s output directoryTEST_BUNDLE: Path to test bundle frombuck targets --show-output
ui_test
ui_test
Runs XCUITest tests on iOS Simulator.Implementation:Configuration:
TARGET_SIMULATOR: iPhone 8 (default)UI_TESTS_TMP: Build directory for UI testsUI_TESTS_TOOLS: Tools directory for test runner
- Builds XCUITests bundle
- Prepares test environment
- Boots simulator
- Installs test app
- Runs tests using xcodebuild
xcode_tests
xcode_tests
Runs tests through Xcode workspace (requires project generation).Implementation:Dependencies: Runs
make project first to generate workspace.Use case: Testing via Xcode’s native test runner.ruby_test
ruby_test
Runs Ruby-based tests for BuckLocal scripts.Implementation:Use case: Testing BuckLocal Ruby automation scripts.
Project Generation
project
project
Generates and opens the Xcode workspace.Implementation:Steps:
- Runs
make cleanto remove old projects - Generates new Xcode workspace from Buck targets
- Opens workspace in Xcode
buck_local_project
buck_local_project
Generates BuckLocal workspace for hybrid Buck/Xcode development.Implementation:Steps:
- Runs
make clean - Generates BuckLocal workspace using Ruby rake task
- Opens BuckLocal workspace
Debugging & Running
debug
debug
Installs and runs the app on iOS Simulator.Implementation:Features:
- Installs debug build
- Launches app automatically
- Uses iPhone 8 simulator
debug_release
debug_release
Installs and runs release build on iOS Simulator.Implementation:Use case: Testing release builds before distribution.
Utility Commands
targets
targets
Lists all Buck targets in the project.Implementation:Output: Shows all buildable targets in the repository.Use case: Discovering available build targets.
audit
audit
Generates Python representations of BUCK files.Implementation:Output: Creates Python files in
Config/Gen/ showing parsed BUCK rules.Use case: Debugging Buck configuration and understanding rule expansion.dependency_graph
dependency_graph
Generates and visualizes the dependency graph.Implementation:Steps:
- Queries all dependencies of ExampleAppBinary
- Outputs GraphViz .dot format
- Converts to PNG using dot command
- Opens visualization
brew install graphviz).Use case: Understanding and optimizing build dependencies.clean
clean
Removes generated files and Buck output.Implementation:Removes:
- All Xcode workspaces
- All Xcode projects
- Buck’s build output (buck-out/)
kill_xcode
kill_xcode
Force quits Xcode and Simulator.Implementation:Use case: Resolving Xcode locks or hung processes.
CI Commands
ci
ci
Runs complete CI pipeline.Implementation:Steps (in order):
install_buck- Install build toolinstall_ruby_gems- Install Ruby dependenciestargets- Verify all targets are validbuild- Build main apptest- Run unit tests with coverageui_test- Run UI testsruby_test- Run Ruby testsproject- Generate Xcode projectxcode_tests- Run tests via Xcodewatch- Build watch extensionmessage- Build message extension
log
log
Simple test command that prints “Make”.Implementation:Use case: Verifying Make is working.
Variables
The Makefile defines several variables used throughout:Path to the local Buck executable.
Buck’s output directory, resolved via
$(BUCK) root.Path to the test bundle, resolved via
buck targets --show-output.Temporary directory for UI test artifacts:
$(buck_root)/build/xcuitest.Directory containing UI test tools:
$(buck_root)/tools/xcuitest.iOS Simulator device for testing.