Search Unity

Build for iOS deleting all files

Discussion in 'Editor & General Support' started by romanw, Jan 26, 2014.

  1. romanw

    romanw

    Joined:
    Jan 26, 2014
    Posts:
    1
    Hello,

    i wanted to test the build functionality for iOS. So i chose it in the build settings and selected my desktop for the output folder. What i expected was Unity to create another folder within my desktop or just ADD the files to my desktop. Unity started the building process then which took actually more time than i thought because it was just a small test project. What actually happened is that Unity just deleted more than 99% files on my desktop for whatever reason i cant even think of, without even adding the final project after building. Needlessly to say that this was A LOT of data.

    That no final files were created was probably a bug i unfortunately discovered because building was no problem when i chose another folder in a second run. But on the other hand my dummy file which i intentionally put in that folder was deleted aswell like in the first building process so this seems to be a common behaviour.

    Maybe you can blame me for not reading manuals or something (although i dont even know if this is mentioned there) but the user should really at least get a warning message that all the files in the selected folder will be deleted if he wants to proceed. For developers like me which learn software 'learning by doing' such a small 'mistake' (if you can even call it that way. Personally i think a "build" button should never delete ANY data without asking let alone three-digit GB data.) shouldnt be punished like that. Now i can try to get at least part of my data with recover software back.

    Best Regards

    EDIT: Out of curiosity i tried all other build formats today because i wanted to test if all of these modes delete all files in the selected folder. Apparently iOS mode is the only build setting where this behaviour appears. So this doesnt seem to be intentional by the developers. Im using version 4.3.2
     
    Last edited: Jan 26, 2014
  2. Nonononoki

    Nonononoki

    Joined:
    Jul 20, 2013
    Posts:
    20
    Same here. I that I'll be able to recover all lost data
     
  3. ludens1up

    ludens1up

    Joined:
    Feb 7, 2014
    Posts:
    1
    Same. But still, I was shocked when my 51 GB's desktop of data were deleted.
    Is there an explanation for this?
     
  4. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    It's a bit hard to understand exactly what you did… some screenshots will help. When you make an iOS build, you specify a folder where the Xcode project, and all the data needed will be written to. If that folder does not exist, then Unity will create it. If the folder does exist, then it'll wipe the contents (unless you ask to modify the existing folder.) So, if you want to make a build called Bob, and have it on your Desktop, then Save As will be Bob, and Where will be Desktop. If you want to create a build called Desktop, and write that into your home folder, then I can only imagine that Unity will wipe the contents of your desktop. But you'd not do that, right?
     
  5. Kayytrop

    Kayytrop

    Joined:
    Jan 22, 2013
    Posts:
    1
    I have the same problem, I have veruscht under windows to create a ios version than you should then select a folder I have the desktop selected and then comb the error message "Error building Player: IOException: Failed to Move File / Directory from 'Temp / Staging Area / iPhone-Trampoline 'to' C :/ users / username / Desktop '. ". after all data were away on the desktop. A data recovery program could not save her. what can I do to get my data resist to get.

    Sorry for the bad english, I'm from Germany.
     
  6. MadMaxMadGamer

    MadMaxMadGamer

    Joined:
    Oct 15, 2012
    Posts:
    1
    Guess what? I've just did the same 3 hours ago. Wanted to make an ios build for my ipad. Suddenly unity crashes, everything on desktop gone except some programs and 3 empty files..

    Still no fix. Did you find something?

    BECAUSE I WANT MY FILES AGAIN. 400GB + GONE!
     
    ph0817sig likes this.
  7. Boslem

    Boslem

    Joined:
    Aug 15, 2012
    Posts:
    11
    I have had the exact same problem, I tried to make a an IOS build to my Desktop, it seems that Unity defaults the name of the build to "Desktop" if you don't change it and will wipe your desktop instead of making a "Desktop" folder on your desktop. that's the last time I ever click through the build settings fast again. Please find a fix for this because I lost a LARGE amount of data and would bet other people would be pissed off if they did as well.
     
  8. max_filtrato

    max_filtrato

    Joined:
    Mar 24, 2014
    Posts:
    1
    I have had the exact same problem too. Fortunately my Unity project is on SVN repository so I can restore all my project.
    I've got the same problem with Unity 4.3.2 and Unity 4.3.4. I also tried to download the 2d example from Asset store, compiled it for iOS and get the same problem. Most files are deleted. So the problem isn't related with my project but seems to be a general problem.
     
  9. Dude_Erino

    Dude_Erino

    Joined:
    Apr 10, 2014
    Posts:
    1
    Same thing happened this morning. My whole Desktop is blank. Trying to recover my data right now. Backed up the most important data yesterday as usual, but many files I dont back up on a daily basis are gone.

    Don't get my wrong, I love Unity, but this is a HUGE Bug. Regarding to the Issue Tracker http://issuetracker.unity3d.com/iss...ws-deletes-the-files-inside-the-target-folder the problem is known and will be handled, but this was on rev 4.3.1f1 . I used 4.3.4f and had no idea that my data is on the edge to the underworld if i build a ios project to my desktop.

    I never expected something like this to happen with Unity. OK I used a PC at work, but damn, this is so not cool.
    I am shocked and really really pissed off. Fix this please (not for me, but for other people who run into this).

    *Going back starring at data recovery progress bar*
     
  10. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  11. Ted-Chirvasiu

    Ted-Chirvasiu

    Joined:
    Sep 7, 2010
    Posts:
    381
    Same happened here... Everything gone apart from a few shortcuts... A few gigabytes of data are gone...
    When making the build, I just selected my desktop and hit Ok (This was my first time building for IOS). Then it threw an error saying it can't move a file to the specified path and when i looked at the desktop, almost blank. Just 3 shortcuts and a couple of folders left (with their contents deleted apart from some files).
     
    Last edited: Apr 14, 2014
  12. Redtail87

    Redtail87

    Joined:
    Jul 17, 2013
    Posts:
    125
    I can not believe this just happened, I built to the wrong folder on accident and it deleted all of the development files for the project which were not under svn (unity project was), if this was fixed 4 weeks ago why was there not a hotfix put out or even a warning?
     
  13. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Because the fix is in 4.5 and that's not been released yet.
     
  14. Wolftalon

    Wolftalon

    Joined:
    May 11, 2014
    Posts:
    1
    I´m really angry, because same happened to me! Almost all files in desktop were wiped when I tried to make IOS build of my application for my friend. Didn´t expected that from this great app. My files are all gone :(
     
  15. Hohusen

    Hohusen

    Joined:
    Oct 25, 2013
    Posts:
    2
    Bug still exists in 4.6.1p4 via the Build script. Please fix or at least have the deleted files placed in the trash. I'm on OS X.
     
  16. OscarLin

    OscarLin

    Joined:
    Jan 21, 2015
    Posts:
    1
    It's still occur in 5.0.0. I'm on OS X, too.
     
  17. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    If unity would do that, it would generate like 500 MB plus of trash files everytime you press build.
    Placing the xcode project directly on the desktop is just not good pracice and you are kind of dumm to do it.

    Just make a export Folder and a subfolder for every platform in that.
    In that platform folder you can make a folder for your build.
    That way you never have the change to kill something by accident.
     
  18. Baoxue

    Baoxue

    Joined:
    Oct 11, 2014
    Posts:
    3
    hi all,this fixed by using the Relative path,try using "build" to Instead of “C:\unityproject/mypoject/build",it will work .
     
  19. Patterpty

    Patterpty

    Joined:
    Apr 19, 2017
    Posts:
    1
    For iOS device user , it doesn't matter your using the iPhone ,iPod,iPad , as long as you want to wipe everything from iOS device completely , the data can not permanently deleted from phone .unless you deleted them by erase tool ,
    But , once the data has been deleted by it , you can never restore them back again with some recovery tool ,
     
    Last edited: Apr 23, 2017
  20. Lanseerty

    Lanseerty

    Joined:
    Apr 26, 2017
    Posts:
    1
    I doubt that , in fact , any a recovery tools can restore iPhone data , as for what you said the iphone data erase tool, which can only surface erase the data on the phone, and can't delete.
     
    Last edited: May 22, 2017
  21. Iamsfer

    Iamsfer

    Joined:
    May 11, 2017
    Posts:
    1
    No need to worry , as long as the data has been wipe from iPhone with erase tool ,no recovery tool can restore back them on phone again.
     
    Last edited: May 22, 2017
  22. Hasmcerg

    Hasmcerg

    Joined:
    May 22, 2017
    Posts:
    1
    As i think ,you can even delete iPhone everything without recovery. when the data is been covered with other new data after them are deleted from iPhone/iPad/iPod device , so easy , but need long time
     
    Last edited: May 29, 2017
  23. Frank0ie

    Frank0ie

    Joined:
    Aug 24, 2017
    Posts:
    1
    It seems that you have misunderstood what this thread talked about. While creating build format in iOS mode, something went wrong and caused the files all deleted. This issue has already resolved in the later version. Besides, as long as those lost data are not overwritten,
     
    Last edited: Aug 24, 2017
  24. brantKOU

    brantKOU

    Joined:
    Aug 24, 2017
    Posts:
    1
    I was told that I can't completely delete all iPhone data by simply tapping the "Erase all Content and Settings" option in my iPhone since those deleted iPhone data are still stored in somewhere in my iPhone until they are covered by new data several times. Therefore, if I don't want anyone to recover deleted files from my iPhone, I had better overwrite my erased iPhone with new but useless contents.
     
  25. janecoko

    janecoko

    Joined:
    Nov 1, 2017
    Posts:
    1
    Do you try reset you iphone to deleted all iphone data?
     
  26. Kolpoiu

    Kolpoiu

    Joined:
    Nov 9, 2015
    Posts:
    10
    Thanks for sharing it, is it for free?
     
    Last edited: Nov 17, 2017
  27. Kolpoiu

    Kolpoiu

    Joined:
    Nov 9, 2015
    Posts:
    10
    All the iphone data erase tools say that they can wipe out data permanently
     
  28. ButterJam

    ButterJam

    Joined:
    Jun 16, 2017
    Posts:
    5
    It's 2019 now, I am necroposting but this issue still persists. Please fix it Unity technologies #Desktopgone
     
  29. williesco3

    williesco3

    Joined:
    Aug 7, 2019
    Posts:
    1
    This just happened to me today on 2018.3.14 so sad to see some of my daughter's pictures disappear and lost most of my Icons and a whole lot of files on my desktop... has anybody figure it out yet?
    Please let me know.

    August 8 2019
     
  30. amcakebread

    amcakebread

    Joined:
    Nov 8, 2016
    Posts:
    28
    it is still doing this in 2019.3.0f3 - it deleted the entire project because I left it pointing at the default location. Build for iOS on Windows and the entire folder is irrecoverably deleted. I am completely amazed this is still like this. An epic and catastrophic flaw that seemingly no one is worried about!
     
  31. xdprint

    xdprint

    Joined:
    May 29, 2019
    Posts:
    8
    Не могу поверить... Сейчас я остался без большей части моего рабочего стола...
     
  32. msantore22

    msantore22

    Joined:
    Nov 19, 2015
    Posts:
    24
    im having a very similar issue in 2019.3. i created a new folder, and exported my project to said folder. and unity3d just deletes the entire folder. wth man? something is not right....
     
  33. BKinnovationlab

    BKinnovationlab

    Joined:
    Mar 17, 2021
    Posts:
    1
    Y'all this is still happening. How is this not a huge bug priority??

    2019.4.22f1
     
  34. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide steps to reproduce.
     
  35. amiwhi01

    amiwhi01

    Joined:
    Apr 9, 2021
    Posts:
    1
    Shockingly it is still happening, Reproducing it is as simple as choosing a folder as a build path (it was the Desktop for IOS app buildd in my case -_-) and all the content is YEETed . ):
     
  36. NatsuD_123

    NatsuD_123

    Joined:
    Feb 19, 2019
    Posts:
    18
    Same happened to me just 2 hours ago, my months of hard work and efforts wasted just like that!!!????
    Can anyone here tell me any recovery software for MacOS to recover this data?
    Using unity version 2020.3.2f1
     
  37. NatsuD_123

    NatsuD_123

    Joined:
    Feb 19, 2019
    Posts:
    18
    Please help anyone? I need a recovery software that recovers this type of wiped data which never went through trash bin for mac
     
  38. magister_yoda_

    magister_yoda_

    Joined:
    Mar 27, 2016
    Posts:
    32
    Any update, guys? I've lost a dozen of my projects, when selected the folder to build new project in it
     
  39. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, what is YEETed? So it deleted the contents of your Desktop folder? You may be making assumptions on the simple steps to reproduce, I don't see the issue but want to help. What version of MacOS, what version of Unity, are you building to an XCode project, or Build and Run?
     
  40. telhahuzeyfa

    telhahuzeyfa

    Joined:
    Oct 21, 2021
    Posts:
    1
    Same happened to me here was anyone able to fix this issue?
     
  41. tosturan

    tosturan

    Joined:
    Apr 15, 2015
    Posts:
    10
    Its just happened to me and I lost all my desktop again. I am saying again because this is my second case. I want to reproduce it here clearly.

    I am using MacOS BigSur version 11.5.2
    And Unity Version is 2020.3.2f1
    I created a separate folder to built in my project root folder and build here successfully My IOS project. after I sent it to appstore I delete the Xcode project folder for some storage problems. And I tried to build again, its automatically pointed on my desktop. (I think its because couldn't found my older build folder.) I didn't realized its my desktop and pressed build. After a few seconds, build thrower an error and its was about a file.IO exception as below. After this error, it tried to clean all of failed build files but it doesn't matter is it desktop ?. And result is, its wiped all of my desktop files with failed build files.

    And it is interesting that when I try to build again on wiped desktop. its asking the folder is exist do you want to replace it ? ‍





    Code (CSharp):
    1. UnauthorizedAccessException: Access to the path "/Users/onurigdi/Desktop" is denied.
    2. System.IO.Directory.Delete (System.String path) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    3. System.IO.Directory.RecursiveDelete (System.String path) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    4. System.IO.Directory.Delete (System.String path, System.Boolean recursive) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
    5. UnityEditor.iOS.PostProcessiPhonePlayer.UpdateInstallLocation (UnityEditor.iOS.PostProcessiPhonePlayer+ProjectPaths paths, UnityEditor.iOS.PostProcessiPhonePlayer+BuildSettings bs, UnityEditor.iOS.PostProcessiPhonePlayer+IncludedFileList includedFiles, UnityEditor.Build.Reporting.BuildReport buildReport) (at /Users/bokken/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:1460)
    6. UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.PostProcessiPhonePlayer+BuildSettings bs, UnityEditor.iOS.PostProcessiPhonePlayer+ProjectPaths paths, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport buildReport) (at /Users/bokken/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:859)
    7. UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.PostProcessorSettings postProcessorSettings, UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/BuildPostProcessor.cs:663)
    8. UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/ExtensionModule.cs:45)
    9. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    10. UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/bokken/buildslave/unity/build/PlatformDependent/iPhonePlayer/Extensions/Common/ExtensionModule.cs:49)
    11. UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:29)
    12. UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:337)
    13. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
    14.  
     
  42. Dev_Sebas

    Dev_Sebas

    Joined:
    Jul 10, 2014
    Posts:
    19
    Hello,

    I just lost my entire desktop on macOS using v2020.3.24f1, a very bad result, I'm really sad with all this situation, personal data and projects, client projects, I'm still trying to get into the new reality, plus I had no backup.

    Sebastião
     
  43. DangerDaren

    DangerDaren

    Joined:
    Dec 15, 2016
    Posts:
    3
    Same just happened to me. On Mac 12.5, using Unity 2020.3.17f1 (LTS), when it asked me where to save the iOS build, I chose the Desktop thinking it would create a folder there with the build files in it (like it does for everything else). Instead Unity gave me a build error in the console. I then tried to build to my documents folder. It said there was already a build there (no there wasn't). I hit replace. Same error in console. I looked at my desktop--every file and every folder on my desktop was gone. Not in the trash, simply gone forever. So I looked in my documents folder. Same there too.

    Beyond unacceptable that an LTS build would wipe out all contents of these folders. Worse yet, I never heard a word about this until it happened to me. On the issue tracker, no Unity reps are responding to the comments, and I can't comment there because it says I need to log in, and when I log in, I get redirected, and when I go back, it wants me to log in again. Rinse and repeat. Intentional?

    Don't let people download this version of Unity. It will destroy everything.

    Unity, how do you intend to make this right?
     
  44. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    This is the only solution:

    I'm sorry you've had this issue. Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.

    Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

    You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

    As far as configuring Unity to play nice with git, keep this in mind:

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

    Here's how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up an appropriate .gitignore file for Unity3D:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    Generally setting Unity up (includes above .gitignore concepts):

    https://thoughtbot.com/blog/how-to-git-with-unity

    It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It's simply ridiculous not to back up.

    "Use source control or you will be really sad sooner or later." - StarManta on the Unity3D forum boards