Building osu!
This guide covers how to build and run osu! from source code using different methods.Building from CLI
Quick Start
The fastest way to build and run osu! is with a single command:- Restore NuGet packages
- Build the project
- Run the game
Release Build
When running locally for performance testing, use the Release configuration:Restoring NuGet Packages
If the build fails, try restoring NuGet packages manually:Building from an IDE
Use IDE build functionality
Use the provided Build/Run functionality in your IDE:
- Visual Studio: Press F5 or click Start
- Rider: Use the Run button or Shift+F10
- VS Code: Use the Run and Debug panel
Build Configuration
The project uses these key configuration files:global.json
Directory.Build.props
Key settings:- Language Version: C# 12.0
- Nullable: Enabled
- Code Analysis: Multiple analyzers enabled
- Documentation: XML documentation generated for all projects
Testing with Local Framework Modifications
You can cross-test changes in osu-resources or osu-framework locally.
Project Structure Required
These commands assume you have projects checked out in adjacent directories:Code Analysis
Before committing code, run the code formatter:Additional Analysis Tools
The project uses several code analysis tools:- Cross-platform analyzers: Integrated into the compiler, provide warnings during editing and building
- JetBrains ReSharper InspectCode: Run with
./InspectCode.ps1or use Rider for inline support
Build Targets
Desktop Platforms
Windows
Windows 10+ (x64) - Primary development platform
macOS
macOS 12+ (Intel and Apple Silicon)
Linux
Linux (x64) via AppImage
Mobile Platforms
- Android: 5+
- iOS/iPadOS: 13.4+
Troubleshooting
Build Failures
- Restore packages:
dotnet restore - Clean build:
dotnet clean && dotnet build - Check SDK version:
dotnet --versionshould be 8.0.100+
Performance Issues
- Ensure you’re using Release configuration:
-c Release - Check for Debug mode overhead in your IDE settings
Mobile Build Issues
Run the workload restore command:Next Steps
Architecture
Learn about the codebase structure
Contributing
Read the contribution guidelines