I haven’t seen these files before, but since upgrading to Unity 5 it now outputs these files for Windows builds. I understand these are for debugging development builds. However my project is till out putting these files and I have set it to release mode. Is it ok to delete these files? any ideas why my project is out putting these files?
I’m not sure how you didn’t notice them before - I’m pretty sure it always did it.
I wouldn’t delete these files. You don’t have to upload them to the windows store, but they will be useful if you get any crash dumps from the Windows Store and you wish to investigate.
Thanks, will keep them with backed up alongside the builds. Erm looking at a pc build created with Unity 4 there is no sign of these files separate, that’s for stand alone pc release.
Ah, Windows Standalone. Since you didn’t specify that in the original post, I thought you were publishing for Windows Store, as that’s what this forum is primarily for.
Either way, I believe we started shipping PDBs with Unity 5 for windows standalones too to ease debugging/profiling with external tools. We always shipped those PDBs for Windows Store applications.
Is there a way to stop these from being built? On OSX and Unity 5.2.3 (Development mode and script debugging are both unchecked)
I don’t think so - may I ask why would you want them not to be built?
Making patches and builds for players. Doing differences on zips in folders. Now will have to script removing them so they are not included in the player downloads. This makes the patches and downloads larger for all.
Could someone use a .PDB file to find a function or variable inside the .exe such as “IsRegistered” or “ThisWasPaidFor” and they muck around to try to unlock a game or replace/override a function?
You don’t need a pdb file for that, because in Unity users are programming with managed language, so you can decompile managed assembly without having symbols.
In the case above pdb files are provided for Unity engine executable, which doesn’t contain user code inside.
“may I ask why would you want them not to be built?” Because they are silly and annoying.
Also, since we pay thousands of dollars a year to Unity for a license, the general plan for Unity is (1) do what we say (2) do what we say
Generally, software that works is better. Unity should adopt this approach. If we turn off silly debugging features, we want them turned off.
Hopefully this silly clutter will be turned off, unless asked for in builds, ASAP
That’s a terrible answer to some very legitimate questions. The people here are just trying to manage their applications, which includes managing build processes and application size. If you really can’t imagine a scenario in which this is a bad thing, then here are a couple for you:
First, there is a ‘Development Build’ setting. The presence of such a setting implies that debug info will or will not be built based on this setting. By building the debug information all the time, you are essentially ignoring that build setting. So should we log a bug for that? If this is not a bug, then what purpose does it serve?
Second, I (like many others) have an automated build process that builds my application, zips it up, then moves it to the appropriate testing environment. My application is 40mb without these pdb files, and 170mb in size with them! That’s over 4 times larger! Over 75% of my zipped application is from debug information that I specifically asked to not have included when I unchecked the ‘Development Build’ option.
Guys, pdb files are provided for your convenience, when you zip or make an installer, simply add an option to ignore them and that’s it, it’s not that hard.
This is a really strange thing. Why is there no option to NOT build these debug files? It may be “for our convenience”, but right now they only add to my inconvenience.
I don’t know what’s wrong with everyone here, either you are already using a build script for a better workflow and removing the files using a script is easy to make. Or you aren’t using a build script in which case you will have to zip the files manually anyway. I really don’t see why everyone is so annoyed by a couple of files.
wow rude
My main problem is the lack of communication from Unity Tech. I already had the case where a developer distributed some zipped demo with these *.pdb files because they either didn’t know a) that Unity (suddenly) creates them or b) that they are not needed for distribution. Either way, Unity should have had a clear message somewhere, that builds have now files you might not need, especially not for release.
In any case it’s really strange when Unity copies (in my case) unnecessary files onto my harddrive every time even though I don’t need them. Is it so hard for Unity to add a checkbox to the GUI?
If you really never ever want to debug Windows stand alone builds put this script into your Assets/Editor folder, name it PostProcessBuild.cs and these annoying PDB files will be history:
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.IO;
public class PostProcessBuild
{
[PostProcessBuildAttribute(1)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
if (target == BuildTarget.StandaloneWindows || target == BuildTarget.StandaloneWindows64)
{
// remove these annoying PDB files as we don't want to debug stand alone builds!
string pureBuildPath = Path.GetDirectoryName(pathToBuiltProject);
foreach (string file in Directory.GetFiles(pureBuildPath, "*.pdb"))
{
Debug.Log(file + " deleted!");
File.Delete(file);
}
}
}
}
Thanks for the script. It works perfectly!
As for Unity, providing them for convenience is only good if they’re actually desired. You must realise that many of your users are amateurs and hobbyists, moreso than with any other game engine. Their needs differ, and that’s not even to say that every developer would want those files for every build anyway.
Giving the user the option to include them is clearly a better option.
In just my case, I want to share a 15MB scene with a friend, but those two extra files alone come to over 140MB, making attaching the files to email impossible, and hogging Dropbox space/bandwidth to share. If I didn’t know that I could safely delete them (only a minor IN-convenience) then I’d be subjecting myself to major inconvenience when trying to share. Can you really not see a situation where this is undesirable?
Hi Unity… is this guy in PR or customer service? Because he shouldn’t be…
What in the world? Is that some kind of joke reply?
I think it comes from the average dev not knowing or realizing that the pdb files are unnecessary for the final distribution. Until reading this thread, I figured that pdb files were a requirement for the final package to run… even though the “db” in “pdb” likely stood for “debug”…
Just delete those pdb files. they are just for Debugging or something. It wont create problems anywhere.