You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Unity package for zipping builds automatically, and on Windows, fix OSX builds by adding the executable bits in the process.
4
4
5
5
## Usage
6
6
7
-
Install the package according to the installation instructions
7
+
Install the package according to the [installation instructions](#installation). Once installed, every OSX build you create, the post processing script will run, zip your build, and if necessary, fixes said build to be able to run on OSX devices.
8
8
9
-
...
9
+
### Project settings
10
+
11
+
This package comes with project specific settings, found at `Edit > Project Settings... > OSX Zip Options`.
12
+
13
+
|Setting|Description
14
+
|---|---
15
+
|[Zip Creation Method](#zip-creation-method)|Which method to use for creating the build zip file. (Windows Editor only).
16
+
|[Zip Compression Level](#zip-compression-level)|The compression level to apply when generating the zip file.
17
+
|Original Build Option|Determines what happens to the original build directory that was used to create the zip file.
18
+
|WSL Process Timeout|The time (in seconds) until the wsl process times out.
19
+
|Verbose Logging|If checked, prints additional debugging information about the build process.
20
+
21
+
#### Zip Creation Method
22
+
23
+
##### WSL
24
+
25
+
> [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/) (WSL) lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual-boot setup.
26
+
27
+
To use this option, WSL has to be installed (preferably an Ubuntu distribution, it's currently the only one we've tested), including the `zip` package on the standard Distribution of WSL on your device.
28
+
29
+
- For more information on how to install WSL: https://learn.microsoft.com/en-us/windows/wsl/install/
30
+
- For more information on how to install the `zip` package on Linux (in this case, WSL): https://www.tecmint.com/install-zip-and-unzip-in-linux/#zipubuntu
31
+
32
+
##### Zip Manipulation
33
+
34
+
A Windows-only solution, that zips the build, then edits very specifc bytes of the newly created zip, in order to make it compatible with OSX.
|None|No compression (`0` in the zip command)|No compression
41
+
|Fastest|Fast compression (`1` out of 9 in the zip command)|Fast compression
42
+
|Optimal|Best compression (`9` out of 9 in the zip command)|Best compression
10
43
11
44
## Installation
12
45
@@ -31,33 +64,38 @@ You can also download this repository and extract the `Editor` directory file an
31
64
32
65
## The Problem
33
66
34
-
What the problem is
67
+
Any build for OSX (otherwise known as MacOS) built on Windows devices, do in general *not* work. Instead, you get presented with an error, saying `The application "game-name" can't be opened`, with no more information.
68
+
69
+
The reason why OSX builds built on Windows do not work on OSX, is the fact that Windows does not get the concept of file attributes, or at least does not know executable flags, which are needed for OSX to know a file is executable. This executable generally can only be added on Unix devices, which both Linux and OSX devices are. The only current solutions for creating an OSX build, are building on either Linux or OSX itself.
35
70
36
71
## The Solution
37
72
38
-
How this package solves the problem (zip)
73
+
This package adds or preservers the executable bits, which get lost because of Windows.
74
+
75
+
If you use the [WSL Zip Creation Method](#wsl), it utilises the Windows Subsystem for Linux to zip the build, so OSX knows how to read, unpack, and fix all files, hence adding the executable bit. It's possible to manually add the executable bit to a file on Linux too, with the `chmod` command.
39
76
77
+
The [Zip Manipulation](#zip-manipulation) method, instead, is a Windows-only solution. Instead of relying on a Unix system, it zips the build first, then edits the zip itself and its entries (the files inside), to accomodate the necessary file attributes getting lost. To make sure everything works as expected on OSX when unzipping this zip, it changes the zip OS to Linux too, to fake it being made on Linux.
40
78
41
79
### TODO
42
80
43
81
The following files will need to be edited:
44
82
45
-
- package.json
46
-
- Package Name
47
-
- Description
48
-
- Package version
49
-
- Minimum Unity version
50
-
- Author information
51
-
- Package samples
83
+
-[ ]package.json
84
+
-[x]Package Name
85
+
-[x]Description
86
+
-[x]Package version
87
+
-[x]Minimum Unity version
88
+
-[ ]Author information
89
+
-[ ]Package samples
52
90
- More information about package manifest files: https://docs.unity3d.com/Manual/upm-manifestPkg.html
53
-
- Runtime .asmdef
54
-
- File name must be [company-name].[package-name].asmdef
55
-
- Assembly name must be [company-name].[package-name]
56
-
- Editor .asmdef
57
-
- File name must be "[company-name].[package-name].Editor.asmdef"
58
-
- Assembly name must be "[company-name].[package-name].Editor"
59
-
- Optional: Reference runtime assembly
60
-
- LICENSE.md
61
-
- This README.md
91
+
-[ ]Runtime .asmdef
92
+
-[ ]File name must be [company-name].[package-name].asmdef
93
+
-[ ]Assembly name must be [company-name].[package-name]
94
+
-[ ]Editor .asmdef
95
+
-[ ]File name must be "[company-name].[package-name].Editor.asmdef"
96
+
-[ ]Assembly name must be "[company-name].[package-name].Editor"
97
+
-[ ]Optional: Reference runtime assembly
98
+
-[ ]LICENSE.md
99
+
-[x]This README.md
62
100
63
101
See https://docs.unity3d.com/Manual/cus-layout.html for more info.
Copy file name to clipboardExpand all lines: package.json
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,14 @@
2
2
"name": "com.github.d3tonat0r.unityosxbuild",
3
3
"version": "0.1.0",
4
4
"displayName": "OSX Build",
5
-
"description": "A brief description of the package. This is the text that appears in the details view of the Package Manager window. This field supports UTF–8 character codes. This means that you can use special formatting character codes, such as line breaks (\n) and bullets (\u25AA).",
6
-
"unity": "2022.1",
7
-
"category": "",
8
-
"hideInEditor": true
5
+
"description": "A Unity package for zipping builds automatically, and on Windows, fix OSX builds by adding the executable bits in the process.",
0 commit comments