Game Framework
CLI ReferenceCommands

game export

Export/package your Unity or Unreal Engine game for specified platforms.

Usage

game export <engine> --platform <platform> [options]

Arguments

  • <engine> - Engine type: unity or unreal

Options

OptionDescriptionDefault
--platform, -pTarget platform(s)(required)
--allExport all enabled platformsfalse
--development, -dDevelopment buildfalse
--config, -cPath to .game.ymlauto-detect

Supported Platforms

  • android - Android APK/AAB
  • ios - iOS framework
  • macos - macOS app bundle
  • windows - Windows executable
  • linux - Linux executable

Examples

Export Unity

# Export for Android
game export unity --platform android

# Export for iOS (macOS only)
game export unity --platform ios

# Export for multiple platforms
game export unity --platform android,ios

# Export all enabled platforms
game export unity --all

# Development build
game export unity --platform android --development

Export Unreal

# Export for Android
game export unreal --platform android

# Export for iOS
game export unreal --platform ios

# Export with custom config
game export unreal --platform android --config /path/to/.game.yml

What It Does

The export command:

  1. Validates Configuration - Checks .game.yml for correct paths and settings
  2. Locates Engine - Finds Unity/Unreal installation
  3. Triggers Build - Runs engine build/package process in batch mode
  4. Saves Output - Exports to configured export path

Unity Export Process

Unity -quit -batchmode \
  -projectPath /path/to/project \
  -buildTarget Android \
  -executeMethod BuildScript.Build

Unreal Export Process

/path/to/UE/Engine/Build/BatchFiles/RunUAT.sh \
  BuildCookRun \
  -project=/path/to/project.uproject \
  -platform=Android \
  -cook -stage -archive

Configuration (.game.yml)

Configure export settings in your .game.yml:

engines:
  unity:
    project_path: ../MyUnityProject
    export_path: ../MyUnityProject/Exports
    
    export_settings:
      development: false
      build_configuration: Release
      scenes:
        - MainMenu
        - Gameplay
    
    platforms:
      android:
        enabled: true
        build_settings:
          export_project: true
          scripting_backend: IL2CPP
          target_architectures: [ARM64]
      
      ios:
        enabled: true
        build_settings:
          symlink_libraries: true

Export Settings

Unity Settings

  • development - Enable development build
  • build_configuration - Release, Debug
  • scenes - List of scenes to include
  • scripting_backend - Mono, IL2CPP
  • target_architectures - ARM64, ARMv7

Unreal Settings

  • development - Enable development build
  • build_configuration - Shipping, Development, Debug
  • levels - List of levels to include
  • architecture - ARM64, x64
  • package_data_in_apk - true/false

Platform-Specific Notes

Android

Requirements:

  • Android SDK & NDK installed
  • Unity: API level 22+, ARM64 recommended
  • Unreal: API level 22+, ARM64 required

Export Output:

  • Unity: unityLibrary folder
  • Unreal: APK with native libraries

iOS

Requirements:

  • macOS with Xcode
  • Unity: iOS 12.0+
  • Unreal: iOS 12.0+

Export Output:

  • Unity: UnityFramework.framework
  • Unreal: UnrealFramework.framework

iOS builds can only be performed on macOS systems.

Desktop Platforms

macOS:

  • Requires macOS system
  • Exports .app bundle or framework

Windows:

  • Requires Windows or Wine
  • Exports executable and DLLs

Linux:

  • Exports executable and shared libraries

Troubleshooting

Unity Not Found

Error: Unity Editor not found

Solutions:

  • Install Unity in standard location
  • Add Unity to PATH
  • Specify Unity path in .game.yml:
engines:
  unity:
    unity_path: /Applications/Unity/Hub/Editor/2022.3.0f1/Unity.app

Export Failed

Error: Unity build failed or Unreal package failed

Solutions:

  • Check project compiles - Fix errors in Unity/Unreal Editor first
  • Verify scenes/levels - Ensure all are included in build settings
  • Check platform support - Install target platform in Unity Hub/Unreal
  • Review console output - Check detailed error messages

Path Not Found

Error: Project path not found

Solutions:

  • Verify project_path in .game.yml is correct
  • Use relative paths: ../MyUnityProject
  • Check spelling and case sensitivity

Missing Build Support

Error: Android build support not installed

Solutions:

  • Open Unity Hub → Installs → Add Modules
  • Select Android Build Support (or target platform)
  • Wait for installation to complete

Performance Tips

First Export

The first export may take several minutes as the engine:

  • Compiles all scripts
  • Processes assets
  • Generates platform-specific data

Subsequent Exports

Later exports are faster due to caching:

  • Only changed assets are reprocessed
  • Scripts are incrementally compiled
  • Build cache is reused

Optimize Export Time

  • Clean project - Remove unnecessary assets
  • Disable unused platforms - Only enable what you need
  • Use development builds - Faster for testing
  • Cache builds - Don't clean export directory unnecessarily

Next Steps

After exporting:

  1. Sync files to Flutter with game sync
  2. Run your Flutter app with flutter run
  3. Build for release with game build

Export successful? Run game sync to copy the files to your Flutter project!