Flutter - Disk Full Error - A Document Being Saved by xcdevice - macos

I'm running into an issue where my iMac, with over 100G free, gets Disk Full Error after running Flutter for an hour or so.
When I reboot I get dozens folders in my Trash "Recovered Files" that are around 2G each.
The issue is actually described fairly well here (with screenshots): https://github.com/flutter/flutter/issues/56270
However, the moderator closed every comment as "off topic" (seems like several people are having this problem). So I figured it may be a good idea to bring this here to see if anyone else has found a solution for this?
I'm running VSCode and when I run Flutter Doctor I'm 100% compliant. Using the latest Flutter/Dart/MacOS/Xcode/Android Studio versions. I am primarily building my Flutter app to macOS platform (desktop).
I tried the suggestions in the above issue post and none of these worked for me (re-installing cocoa pods, re-installing Xcode, re-installing Android Studio).

I actually ran into this issue about a week ago. The comment linked to had put me on the right track, where they mentioned it only happens when they have an iOS device attached to their machine.
If you see something like this error in your VSCode output log when launching your app, then it's likely the same issue.
Failed _shouldMakeReadyForDevelopment
If you have a device attached and it's locked, I believe something in the Flutter env attempts a connection over and over causing these files to fill up.
However, this happened to me once even when I didn't attach a device and I found out it was because I had "wirelessly" attached a device in Xcode when I was doing iOS development for another project. So just sitting at my desk with my iPhone nearby was enough to cause it to try to connect over and over again, even if it wasn't attached.
I removed my iPhone from Xcode's wireless device list and that seems to fix it.

Can confirm, running flutter with an attached ios device eats disk space.
This is happening to myself and another developer on my team. I lost 200 GB of disk space yesterday. It's a frustrating productivity killer.
I am using the latest flutter
flutter doctor reports everything as fine
xcrun --find simctl is fine
Using Android studio 3.6.3
Latest patched Catalina 10.15.4
This morning I opened the Android Studio IDE with an android device and an ios device connected. I opened a get info window on my hard drive and left it open. Then I did nothing but watch the info window. No builds or anything. Over the course of a couple minutes, I watched 7 GB disappear.
I shut down the IDE and the loss stopped. I reopened the IDE with only the android device attached. I waited and watched for a few minutes. No loss of disk space.
Then I reopened the IDE with just an ipad attached and the losses started again. Then I unplugged the ipad and left the IDE open and the losses stopped.

Same here but happens also when just running Android Emulator.
This needs to be fixed A.S.A.P - its a dealbreaker!

When the problem happens and the disk runs full, my system slows down so much I can hardly do a thing. To free up disk space and get operational again quickly, there's two options:
Restart. Then the cache files are either deleted or end up in "Recovered Files" in Trash, as described by #william-t, from where you can delete them.
Directly delete the cache files in "TemporaryItems" (for me that's below /private/var/folders/bc/gw57z9dn4rn2v6df7306k9sh0000gn/T)
I know this is not a solution to the root cause of the issue, and it still helps a lot, as long as there's no true fix...

Related

iOS destination simulators missing

I began typing up this issue and before I submitted it I solved the problem, but since it cost me all morning to resolve and I've seen it before, I figured I'd post it to help others out if they should run into the same issue.
I lost all the destination simulators in a single XCode project save for MacCatalyst and any physical devices. The cause was turning on Mac Catalyst. It's not quite that simple since I am using two different development computers running different version of MacOS. I was quite careful to not have the project open on the two different systems at the same time since that has caused other minor issues issues in the past as well.
I did some work on the second system to resolve issues with MacCatalyst, then closed that and returned to the original computer and discovered all the simulators were missing from the destination drop down. They're there under Windows -> Devices and I can add others but they never show up on the drop down. Other projects work fine.
I'll provide the solution below.
After trying restoring the project file and restoring XCode and deselecting Mac Catalyst all to no avail. I tried de-selecting iPhone and/or iPad and magically the simulators re-appeared. That's all it took.

On Starting mac and running xcode simulator Consume around 500MB Internet Data

For Past 4 week i observer when i run my Xcode application on simulator on first time simulator launch it consume around 500MB internet data.
This is not project specific issue. Every time when i shutdown and start the mac and run Xcode as soon as simulator open it will consume same amount of Data.
Can any one help me What is the issue?? or any background service run??
Xcode version: 11.6 (11E708)
simulator: 13.6
OSX: 10.15.6
Please help me unnecessary every time my Internet Data is consume i have to fix this
This issue is still persist after updating to xcode 11.7
Thanks For #Rado for suggesting the https://apple.stackexchange.com/.
After posting the question on https://apple.stackexchange.com/ i fond the answer.
Orginal Answer: Xcode simulator constantly download something
Answer:
rename the file com.apple.nsurlsessiond(Dont delete) in
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/UserEventPlugins/com.apple.nsurlsessiond.plugin/
to something -com.apple.nsurlsessiond
and also the file nsurlsessiond(Dont delete) in
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/libexec/
to something -nsurlsessiond
Apps with admob works perfectly also no problem with safari
If you don't need an internet connection for testing you application, you could simply disable the network.
You could run wireshark and see what it is actually doing, or at least see where it is connecting to.
I used tripmode firewall don't give simulator internet access only give when you need it.
Works fine but when you forget to turn it off and start the simulator next time, you feel horrible :(

Xcode freezes on "fetching app store configuration"

I have mac os mojave and xcode Version 10.1 (10B61). I try build unity3D game. I can successfully build it to iphone 5S device. But when I try submit up to App Store it is not working.
What exactly happens:
On step "fetching app store configuration" xcode freezes. In active monitor I see it as unresponsible application (or something like it). And XCode take almost all free RAM (4.5GB). After sometime (around 20 minutes) mac restart (I have problem with iMac, it restart when use too much RAM, I don't think it related to xcode)
Actually, if I wait long enough (more then 15 minutes) it is start working.
XCode require a lot of RAM + SWAP
Here's an answer for someone who stumbles upon this later, I just want to share what helped me. I also ran into the same problem while trying to distribute a Unity-built game with Xcode (also contains pods).
I work on a MacBook Air 2013 with only 4GB of RAM, so whenever I do anything with Xcode, I first close everything other than Xcode, Finder and Activity Monitor. As soon as I start whatever it is that usually freezes Xcode, I switch to Activity Monitor and track what's happening with the memory.
In the case of freezing while "Fetching App Store Configuration...", the problem appeared to be RAM, more precisely SWAP. I did not have enough memory available on my hard drive, which Xcode tried to use for SWAP and just... well, failed. So I cleaned up my hard drive and finally it went through very smoothly, but it occupied about 9GB of RAM at its peak (5.4GB in SWAP).
So just try to have enough memory available to feed the beast, observe what's happening in Activity Monitor and you should be good.

Xcode simulator with react-native takes to long

I'm now running Mavericks and the latest Xcode on a mid 2009 MPB. There is no problem creating the AwesomeProject and then building with Xcode. The problem starts once the simulator comes up. I see the white Powered by React Native screen and then after it goes away it takes a very long time and finally the Packager gives me the following output:
Error: ENOENT, open '/Users/SM/AwesomeProject/AwesomeProject.xcodeproj/project.xcworkspace/xcuserdata/SM.xcuserdatad/.dat2864.046'
at Error (native)
[3:15:07 PM] <START> request:/index.ios.bundle
[3:15:07 PM] <START> find dependencies
[3:15:10 PM] <START> find dependencies
This is followed by the big red screen!
Xcode also notifies me that it got disconnected from the simulator. The one warning I do see in Xcode is:
"Applications using launch screen files and targeting iOS 7.1 and earlier need to also include a launch image in an asset catalog."
How can I finally complete the Getting Started test and experience React Native?
The red screen only has two options on it which I'm not able to use, its likely just the result of not being able to run the Simulator on my machine:
Bottom line I do not have enough RAM, only 4GB. After investigating it looks like I need to upgrade or get a new Mac at some point in the future. Its been a max frustrating day for me to say the least.
Here is what Activity Monitor tells me about my machine:
That is how my machine looks without Xcode and the Simulator running! There are two upgrade options if I want to keep going now. Double my RAM and optionally get a SSD. Does anyone know if this will be enough to get the Simulator working?
I did see this link saying that adding more RAM helped:
http://iphonedevsdk.com/forum/iphone-sdk-development/120512-how-much-ram-needed-desirable-on-an-xcode-build-machine.html
UPDATE
After the upgrade to a 500GB SSD, more RAM and a clean install of Mavericks things are working swell. I highly recommend this as a way to get more life out of a older MBP. Thanks to Memory Express and the Apple Store for all the tips and sweet deals.

XCode "verifying application" step taking ages

The "verifying application" step of the build process in fully updated XCode 4.6 (and previously 4.5) often takes upwards of two minutes on my machine. Coworkers building the same application on similar computers have this step take only a couple seconds. My machine used to, as well, but does not anymore, for the past few months.
Does anyone know what could be causing this and how I can fix it?
Update your device to the latest version of iOS, 6.1.
Had the same issue, fixed after updating my iPad3.
Try rebooting your device.
I had the same problem using XCode 4.5.1 and an iPad 6.0.1, but didn't want to update at the time. In additional to a long 'Verifying Application' step, I noticed that copying resources over was also slower. After that, I disconnected the iPad and tried to delete my App, but discovered that even the device's delete alertview took several moments. So, obviously, for me, this was a device issue, and after performing a shutdown / restart of the device, xcode performed up to previously normal speeds.

Resources