game sync
Sync exported game files from Unity or Unreal Engine to your Flutter project. Can also sync Game Framework plugin scripts to Unity projects.
Usage
sync is a parent command with subcommands — there is no positional engine
argument:
game sync unity --platform <platform> [options] # sync Unity exports
game sync unreal --platform <platform> [options] # sync Unreal exports
game sync scripts [options] # sync Unity plugin scriptsSync Exported Files
Subcommands
unity- Sync exported Unity files into the Flutter projectunreal- Sync exported Unreal files into the Flutter project
Options
| Option | Description | Default |
|---|---|---|
--platform, -p | Target platform(s) | (required) |
--all | Sync all enabled platforms | false |
--clean | Delete target directory before syncing | false |
--config, -c | Path to .game.yml | auto-detect |
Examples
# Sync Unity Android files
game sync unity --platform android
# Sync Unreal iOS files (clean first)
game sync unreal --platform ios --clean
# Sync all enabled Unity platforms
game sync unity --all
# Sync with custom config
game sync unity --platform android --config /path/to/.game.ymlWhat It Syncs
Unity:
- Android: Copies
unityLibraryfolder toandroid/ - iOS/macOS: Copies
UnityFramework.frameworktoios/ormacos/ - Windows/Linux: Copies build directory
Unreal:
- Android: Extracts APK, copies
.solibraries and assets toandroid/app/src/main - iOS: Extracts IPA, copies
UnrealFramework.frameworktoios/ - macOS: Copies
.appbundle or framework - Windows/Linux: Copies packaged build
Sync Plugin Scripts
Sync Game Framework Unity plugin scripts to your Unity project.
Options
| Option | Description | Default |
|---|---|---|
--project, -p | Path to Unity project | from .game.yml |
--target-dir, -t | Target directory in Assets | GameFramework |
--templates | Include template examples | false |
--clean | Clean target directory first | false |
--dry-run | Preview without copying | false |
--config, -c | Path to .game.yml | auto-detect |
Examples
# Sync using .game.yml config
game sync scripts
# Sync with explicit path
game sync scripts --project ~/UnityProjects/MyGame
# Include template examples
game sync scripts --templates --clean
# Dry run to preview changes
game sync scripts --dry-runWhat Gets Synced
Core Scripts:
FlutterMonoBehaviour- Base class for Unity scriptsMessageRouter- Message handling and routingMessagePool- Object pooling for performanceMessageBatcher- Batch message processingBinaryMessageProtocol- High-performance binary messaging
Optional (with --templates):
GameFrameworkDemo.cs- Complete demo exampleRotatingCube.cs- Simple 3D exampleMessagingExample.cs- Communication examples
Features
- Auto-download - Downloads from GitHub if not found locally
- Smart detection - Finds existing Game Framework folder
- No duplicates - Won't create conflicts
- Streaming-aware - Excludes Addressables unless streaming is enabled
Scripts are automatically downloaded from the latest gameframework repository if not found locally!
Configuration
Configure sync paths in .game.yml:
engines:
unity:
project_path: ../MyUnityProject
export_path: ../MyUnityProject/Exports
platforms:
android:
enabled: true
target_path: android/unityLibrary
ios:
enabled: true
target_path: ios/UnityFramework.frameworkTroubleshooting
Export Directory Not Found
Error: Export directory not found
Solution: Run game export first before game sync:
game export unity --platform android
game sync unity --platform androidTarget Path Not Found
Error: Target path does not exist
Solutions:
- Ensure Flutter project structure is correct
- Verify
target_pathin.game.yml - Create directories if needed:
mkdir -p android/
Permission Denied
Error: Permission denied
Solutions:
- Check file permissions
- Run with appropriate permissions
- Ensure no files are locked/in use
Files Already Exist
Warning: Target files already exist
Solutions:
- Use
--cleanflag to delete existing files first - Manually remove the target directory
- Verify you're syncing the correct files
Clean Sync
For release builds or when you want a fresh copy:
game sync unity --platform android --cleanThis:
- Deletes the target directory
- Copies fresh files from export
- Ensures no stale files remain
Related Commands
game export- Export game buildsgame build- Export + sync + buildgame config- View configuration
Next Steps
After syncing:
- Run your Flutter app with
flutter run - Build for release with
flutter build
Files synced successfully? Try flutter run to test your integrated app!