Game Framework

Installation

Game Framework consists of two main components: the SDK (Flutter packages) and the CLI (command-line tool). You'll need both for the complete development experience.

Prerequisites

Before installing Game Framework, ensure you have:

  • Flutter SDK: 3.3.0 or higher
  • Dart SDK: 3.0.0 or higher
  • Unity: 2022.3.x or higher (if using Unity)
  • Unreal Engine: 5.x (if using Unreal)

Verify your Flutter installation:

flutter --version
flutter doctor

SDK Installation

The Game Framework SDK consists of multiple packages that you add to your Flutter project.

1. Add Dependencies

Add the packages to your pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  gameframework: ^0.0.1
  gameframework_unity: ^0.0.1  # If using Unity
  # gameframework_unreal: ^0.0.1  # If using Unreal

2. Install Packages

Run the Flutter pub get command:

flutter pub get

3. Initialize Plugin

In your Flutter app's main file, initialize the engine plugin:

import 'package:flutter/material.dart';
import 'package:gameframework/gameframework.dart';
import 'package:gameframework_unity/gameframework_unity.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Initialize Unity plugin
  UnityEnginePlugin.initialize();
  
  runApp(MyApp());
}

The SDK is now installed! You can start using GameWidget in your Flutter app.

CLI Installation

The game-cli tool automates game exports, file syncing, builds, and publishing. Choose your preferred installation method:

The easiest way to install game-cli on macOS or Linux:

# Add the tap
brew tap xraph/tap

# Install game-cli
brew install game-cli

# Verify installation
game --version

To upgrade to the latest version:

brew upgrade game-cli

Download pre-built binaries for your platform:

Visit the GitHub Releases page and download:

PlatformFile
macOS (Apple Silicon)game-cli-vX.Y.Z-macos-aarch64.tar.gz
macOS (Intel)game-cli-vX.Y.Z-macos-x86_64.tar.gz
Linux (x64)game-cli-vX.Y.Z-linux-x64.tar.gz
Windows (x64)game-cli-vX.Y.Z-windows-x64.zip

Install on macOS/Linux

# Extract the archive
tar -xzf game-cli-*.tar.gz

# Move to your PATH
sudo mv game /usr/local/bin/

# Verify installation
game --version

Install on Windows

# Extract the zip file
Expand-Archive game-cli-*.zip

# Move to system directory
Move-Item game-cli-*\game.exe C:\Windows\System32\

# Verify installation
game --version

For development or if you need the latest changes:

Clone Repository

git clone https://github.com/xraph/game-cli.git
cd game-cli

Install Dependencies

dart pub get

Build and Install

# Use Make for automated installation
make install

This compiles the CLI to a native executable at ~/.local/bin/game.

Add to PATH

Add the installation directory to your PATH (first-time setup):

# Add to your shell profile (~/.zshrc or ~/.bashrc)
export PATH="$HOME/.local/bin:$PATH"

# Reload your shell
source ~/.zshrc  # or source ~/.bashrc

Verify Installation

game --version

Rebuilding After Changes

When developing the CLI:

make rebuild

The CLI is optional for basic SDK usage, but highly recommended for automated workflows and cloud publishing.

Verify Installation

Check SDK Installation

Create a simple Flutter app to verify the SDK works:

import 'package:flutter/material.dart';
import 'package:gameframework/gameframework.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(
        child: Text('Game Framework SDK Installed!'),
      ),
    ),
  ));
}

Run the app:

flutter run

Check CLI Installation

Verify the CLI is installed and accessible:

# Check version
game --version

# View available commands
game --help

# Check CLI configuration
game config show

Next Steps

Now that you have Game Framework installed, here are some recommended next steps:

Ready to build? Follow the Quick Start Guide to create your first integrated app!

For SDK Development

For CLI Usage

Troubleshooting

SDK Installation Issues

Problem: Package not found on pub.dev

The gameframework packages may be published to a private registry or not yet on pub.dev. Check the repository README for alternative installation methods.

Problem: Platform-specific build errors

Ensure you have the required platform tools installed:

  • Android: Android SDK and NDK
  • iOS: Xcode and CocoaPods
  • Desktop: Platform-specific build tools

CLI Installation Issues

Problem: Command not found

Ensure the CLI is in your PATH. Check your shell configuration:

# Check if game is in PATH
which game

# If not, add to PATH
export PATH="$HOME/.local/bin:$PATH"

Problem: Permission denied

Make the game executable:

chmod +x /path/to/game

Problem: Dependencies missing

Install Dart dependencies:

cd game-cli
dart pub get

Platform-Specific Notes

Android

Additional requirements for Android:

  • Android SDK 22+
  • NDK for native builds
  • Gradle 7.0+

iOS

Additional requirements for iOS:

  • macOS with Xcode 14+
  • CocoaPods
  • Valid Apple Developer account for device deployment

Desktop

Additional requirements for desktop:

  • macOS: Xcode command-line tools
  • Windows: Visual Studio 2022 with C++ workload
  • Linux: Build essentials and GTK3

Desktop support is currently in beta. Some features may be unstable.

Getting Help

If you encounter issues during installation: