Build platform doesn't stick when using VCS (Git)

I’m using a BitBucket Git repo just as my own private repository for a side project in Unity. I have Unity Pro (with iOS). Simple problem really - when I first committed my code, I deleted the Library folder. I also added the following to my .gitignore:

# Ignore The following directories / file extensions
Library/
Temp/

# Ignore the following file extensions
*.exe
*.vcproject
*.sln
*.pidb
.DS_Store
._*
.Spotlight-V100
.Trashes
Icon
.AppleDouble
.LSOverride

# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln

That’s put together from a variety of sources for OSX and Unity .gitignore files I found.

I deleted the Library folder, committed, then re-opened the project. For some reason, my project had reverted back to being a PC and Mac Standalone project and forgotten that it was an iOS project.

Is there a file in the /Library folder I should be not ignoring so Unity remembers the build platform?

Current build setting isn’t saved in version control.

Imagine this: one working copy is configured to compile the iOS version of the game, and another working copy is configured to compile another version, say, the Android version.

If which platform to publish to was saved along in version control, those two people working on separate versions of the game would mess each other up.

And if you ever developed cross-platform games in Unity you would know switching from one platform to another is incredibly slow, as it reimports all the assets for the platform to switch to (would be nice if it keeps imports of assets per platform to prevent that though).

Don’t version control the Library folder. That will mess up your project. Unity can reliably recreate the Library folder anytime, provided that you enabled meta files in your project.

Have you looked at the library folder at all of a project?

It stores all your metadata and build editor settings… The specific file your’e looking for is probably either EditorUserSettings.asset or EditorUserBuildSettings.asset, but that’s besides the point.

The library holds all your settings information AND your metadata associated with settings for each item in your Assets folder. Needless to say, you need that folder if you’re using a repository or version control, and even if you’re not and delete the folder, your project will most likely get messed up upon recreation of the folder.

Your best bet is to read Unity’s documentation for this:

http://docs.unity3d.com/Documentation/Manual/ExternalVersionControlSystemSupport.html