0
0
Unityframework~5 mins

PC/Mac standalone build in Unity

Choose your learning style9 modes available
Introduction

Making a PC/Mac standalone build lets you create a program that runs on Windows or Mac without needing Unity. It turns your game or app into a file people can open easily.

You want to share your game with friends who don't have Unity installed.
You want to test how your game runs on a real PC or Mac outside the editor.
You want to send your game to players or customers as a simple app file.
You want to upload your game to a website or store that accepts PC/Mac apps.
You want to keep your game separate from Unity for easier launching.
Syntax
Unity
1. Open Unity Editor.
2. Go to File > Build Settings.
3. Select PC, Mac & Linux Standalone as the platform.
4. Choose target OS (Windows or Mac).
5. Click Build and choose a folder to save your app.
6. Wait for Unity to create the standalone build.

You can switch between Windows and Mac targets inside Build Settings.

Make sure your scenes are added to the build before building.

Examples
This creates a Windows .exe file you can run on any Windows PC.
Unity
File > Build Settings > Select PC, Mac & Linux Standalone > Target: Windows > Build
This creates a Mac app you can open on any Mac computer.
Unity
File > Build Settings > Select PC, Mac & Linux Standalone > Target: Mac OS X > Build
Sample Program

This script prints a message to the console when you run your standalone build. It helps confirm your build works.

Unity
// This is a simple Unity script to show a message when the game starts
using UnityEngine;

public class HelloWorld : MonoBehaviour
{
    void Start()
    {
        Debug.Log("Hello from standalone build!");
    }
}
OutputSuccess
Important Notes

Always test your standalone build on the target computer to check performance and bugs.

Standalone builds can be large; use compression or remove unused assets to reduce size.

Remember to add all scenes you want in the build in the Build Settings window.

Summary

Standalone builds let you share your Unity game as a simple app for PC or Mac.

Use Build Settings to pick the platform and create the build.

Test your build to make sure it runs well outside Unity.