Cloud and Local Storage

RSS for tag

Store data locally or in the cloud.

Posts under Cloud and Local Storage tag

23 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to Clear System Data on Mac
How do I clear my system data on my macbook as it is taking up a huge portion of my storage? I have already tried checking if my cache folder in ~/library was too big but it is only 7.42 GB. Also, I checked if time machine was on to find snapshots but it seems I have had it off for a while now and I didn't know. Could this be causing issues and should I have it on from now on? Please help I need more storage.
0
0
28
3h
Bricked com.apple.homekit.config CloudKit container
How did the issue (probably) occur? The issue appeared in January 2024 after setting up a new Apple TV 4K (tvOS 16.X and updated to latest tvOS after setup) or a new Apple Watch Ultra 2 (watchOS 10.X and updated after setup). Both devices were set up using my personal iCloud and both were set up to use HomeKit. I suspect the issue is related to the creation of a new Home that was subsequently shared to a family member (see below). How did I notice the issue? From the week that followed, I noticed that my iPhone 15 Pro Max tends to get really hot in standby and that the battery drops significantly in the space of a couple standby hours. (Worst case I’ve experienced is about ~80% drop in 4 hours standby) Apple Watch also has huge drops in battery life. Again, to give some perspective: I wear my AW for sleep tracking, sometimes AW will drop ~5% throughout the night, sometimes ~60% (and turn off if it was charged below 60%, making me lose my sleep tracking). My iPad Pro occasionally loses ~30-50% charge over night in standby. I went to the Battery section of the Settings app on my iPhone and iPad and could notice that about 50-75% of the time (over 24h that is), Home Accessories is running in the background. I could not confirm this on Apple Watch as the battery section of Settings does not show per app usage, however clear drops in battery percentage are noticeable from the graph. What's the issue? Seeing the issue arise on three of my four portable Apple devices, I decided to go check on my MacBook Pro M1 Max in Activity Monitor if the same behaviour was to be seen. I quickly realised that the Home Daemon (homed) is permanently running in background at (unusual) high usage. It is the top entry in CPU usage and Uptime. Going into the Console app I can see that the homed daemon on macOS is throwing 3x-5x batches of the same 5 error messages each second. The errors are the following: In the same Console app, connecting to my iPhone and my iPad, I can see the exact same errors occurring at approximately the same rate. What is the issue in technical terms? My CloudKit HomeKit config (com.apple.homekit.config) container is bricked and returns an internal server error The homed/cloudd daemons do not have a backoff policy and retry fetching the CloudKit database instantly on failure. This leads to an infinite loop of network requests going out and draining my battery on all devices massively. How did I try to solve the issue? All these measures were unsuccessful: Restarting all devices All devices are on the latest version Deleting the Home app where possible Turning off Home, Keychain and iCloud Drive in iCloud settings Signing out of iCloud and signing in again Using the HomeKit Reset mobileconfig profile where possible (http://appldnld.apple.com/iOSProfiles/HomeKitReset.mobileconfig) Use the previously mentioned reset profile in combination with a HomeKit Architecture downgrade (http://appldnld.apple.com/iOSProfiles/KeepLegacyHome.mobileconfig) On macOS, delete ~/Library/HomeKit Sending sysdiags using the Feedback Assistant (FB13529370, still open) Manually revoking all (pending and accepted) home invitations and deleting all homes from the Home app Removing all Apple TVs and HomePods from my iCloud account Reseting and repairing Apple Watch Disabled Advanced Data Protection on iCloud Logging out of all my devices’ iCloud, use the reset profile, wait 20min, login to iCloud, the issue reappears in the console (while no other devices are logged in) Changing Apple ID password and choose to log out all devices, log in again into a single device, use the reset profile, wait 20min, and the issue reappears in the console To be absolutely sure it is an iCloud issue and not a local misconfiguration (that could be solved by resetting all my devices), I took an older iPhone 12 Pro and set it up as a new device with no apps/account/data, just a blank installation of iOS. As one would expect, the issue is not present and the Console app does not show any errors. As soon as I log into my iCloud account, the Home daemon homed throws the same 5 errors over and over and the battery draining issue magically appears. This confirms my theory that it is indeed an iCloud issue on the server-side and not a client-side issue. Reseting my devices would not help fix the issue as demonstrated by a blank iOS installation on a separate iPhone 12 Pro getting the same error just by logging into my iCloud account. I’ve had an Apple Support case for over five months, it has been (unsuccessfully) escalated twice to engineering. While many basic troubleshooting steps have been taken, nothing helped. Also, while the Apple Support agent is really trying their best to help me, they understand the symptoms of the problem but not the root cause which I tried explaining multiple times. Essentially we’re sticking to the Apple Support instructions they have, and doing basic diagnostics and battery troubleshooting even though I technically understand and can explain the issue to a CloudKit engineer. We even proceeded to do a fresh install of macOS on a separate volume and took diagnostics before and after login in with my Apple ID. They were able to confirm that there is indeed a massive battery drain issue related to my account. The case is still open but is currently leading nowhere, I'm just told to keep my devices updated... How Apple can fix the issue: Investigating the internal server error and fixing the record(s) or the CoreData entity that is throwing the problem Implementing a client-side backoff policy for internal server errors coming from iCloud. Quite trivially by reseting my com.apple.homekit.config container Also worth mentioning: I don’t use a VPN or any Proxy I’m fine with losing all my HomeKit-related data on my iCloud account. At this point I just want the issue to disappear and to have useable battery life on all my devices. I’m giving my consent to the immediate and irrevocable deletion of all my past and present HomeKit-related data.
1
0
167
3d
Core Data error: SQLITE_IOERR_SHMOPEN; what is this?
Hi, when setting up our Core Data stack in our iOS app (manually, with a NSManagedObjectModel/Context & NSPersistentStoreCoordinator) we have reports a rare bug we haven't been able to reproduce. Occasionally when adding a persistent store we get a NSCocoaErrorDomain 256 error (NSFileReadUnknownError) with NSSQLiteErrorDomain=4618 in the user info. That's SQLITE_IOERR_SHMOPEN , which the SQLite docs describe this way: I/O error within the xShmMap method on the sqlite3_io_methods object while trying to open a new shared memory segment It seems to specifically /not/ be a SQLITE_FULL error. Do you know what type of issue can cause this? Or where/how I can start tracking this down?
1
0
81
21h
Webview localStorage gets cleared if navigate away from page on iOS
I'm experiencing an issue with WKWebView and localStorage. I've set up a standard WKWebView with the configuration: configuration.websiteDataStore = WKWebsiteDataStore.default() Everything works fine in the emulator (iOS 16.x, 17.0), but on my iPhone 13 running iOS 17.4, I encounter a problem. When I set a localStorage value on my local HTML page, navigate to another URL within the webview, and then return to the original page, the localStorage is cleared. This behavior is new and wasn't happening before. Has anyone else encountered this or have any suggestions on how to fix it? The localstorage should be persistent as it always has been.
0
0
276
3w
CloudKit + CloudSave for Unity not building in Xcode
I'm trying to integrate the option to the player to save their data in the cloud, I integrate the CloudKit, change some stuff to make it work and build in Xcode to my phone. But when I try to integrate the CloudSave, 50 unnasigned symbols jump,like this one: Undefined symbol: _CKContainer_Default I managed to fix them by updating the recommended settings for Xcode. But then 4 more errors appear: Sandbox: il2cpp(12538) deny(1) file-read-data /Users/Username/Test Apple Kit 2022/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/il2cpp So, don't let me build and I've looked everywhere but no one seems to had this same error
1
0
214
May ’24
Apple cloud storage issue after 17.4.1 IOS upgrade
Hello Everyone, This is regarding recent upgrade issue on my iPhone. I am still struggling to get access to my iCloud storage data for iMessages, Notes with password, Health related stats, etc. I would like to explain chronology of the entire event. There was a recent IOS 17.4.1 update came on April 07th, 2024. I clicked on the update but nothing happened then suddenly my phone passcode wasn’t working. I restarted my phone then the phone was not even accepting my face id. I went to the Apple store. Apple support team have requested me to reset (erase entire data) iPhone which I had already done on next day. I had no others options actually. My phone passcode was not working in reality due to iso update because I haven’t changed my passcode since more than a year. It is also not due to iPhone screen issue which apple team was saying to me initially. Unfortunately, my Apple ID credentials wasn’t working after phone reset so I had to put my Apple ID on recovery mode which took almost 15days to recover even though process is automated as per apple support team which they can’t reduce it. I understand that they are doing for privacy reason but who wants such privacy when even owner can’t access his own account for 15days. I offered them to verify my personal details such as email ID, phone number, passport number and any other details which they can use to expedite the process but they didn’t help on this. At end of the recovery (after 15days), they used same details i.e. my email ID and SMS on my registered number to verify. I don’t understand their logic but if they can take 2-3 business working days for same process then it makes sense to wait rather than 15days. After I regained access to my apple id, I have restored everything using my iCloud storage. I observed that few applications such as contacts, WhatsApp, etc. are restored properly but some of the applications such as iMessage, Notes (specifically locked notes), health data were not restored. iMessage are not synchronizing with iCloud storage when I tried to do it manually too in setting >> apple id>> iCloud >> show all >> messages in iCloud >> sync now. Nothing happens after clicking on it. Locked notes are still showing an error message “Can’t view Note. ‘This note can’t be viewed because encryption key wasn’t found in iCloud keychain. Resetting your end-to-end encrypted data can cause this’”. I have never used custom password to lock note instead I was using Face ID earlier to lock or unlock some of notes. All these things are happening because it is asking for old iPhone passcode to connect with iCloud storage while resetting my iPhone. I am trying to enter all the previous passcodes. a. When I entered correct passcode, then there is no error but still applications are not synchronizing with iCloud storage. b. When I enter incorrect passcodes (multiple passcodes but one at a time) then it gives an error “Verification failed”. It means it is detecting correct passcode as per above point. There is some issue with passcode synchronization with iCloud storage. I have opened a case with apple support team but meanwhile If any one of you had faced similar problem, then kindly suggest ways to me so I will regain access to some important personal information which are present in my iCloud storage. I would like to inform everyone that don’t rely completely on single brand or product. Take multiple backups may be on personal laptops, SSDs, etc. I learnt a lesson that even apple products, software & services are not reliable so think before buying costly products just for sake of brand name.
1
0
419
Apr ’24
UserDefaults value is sometimes returning incorrect value
We use UserDefaults in our app to identify if we already showed a particular UI to the user (so that it will not be shown to the user again). Our logic goes something like: if !UserDefaults.standard.alreadyShownToUser { showUI() UserDefaults.standard.alreadyShownToUser = true } But there are users who see this particular screen again when they open the app. The screen does not show up for a few days, and then suddenly, it shows up again. Our theory is that this might have something to do with iOS Prewarming. So we updated our code to add another check: if UIApplication.shared.isProtectedDataAvailable && !UserDefaults.standard.alreadyShownToUser However, it does NOT seem to work / mitigate the issue at all. We also added logs to check the value of UIApplication.shared.isProtectedDataAvailable and the value of the UserDefaults variable. We expected that if: UIApplication.shared.isProtectedDataAvailable is false, then the UserDefaults value should also be false. But in our logs, we can see that UIApplication.shared.isProtectedDataAvailable is false, but UserDefaults still returned true. Which led me to think that UserDefaults is not affected by Prewarming. Now, I'm back from the start. What's causing our UserDefaults to have different value? We also do not have anywhere else in the app that sets the value of UserDefaults.standard.alreadyShownToUser to false. The only time it should have that value is when the user installs the app for the first time. I appreciate any help that can lead me to fix this issue. Thank you!
4
0
369
Apr ’24
SwiftData not syncing with iCloud
Hello everyone, I followed this (https://www.hackingwithswift.com/quick-start/swiftdata/how-to-sync-swiftdata-with-icloud) guide from Paul Hudson on how to sync swiftdata with iCloud. I tried it on my device directly and it worked exactly as I would expect. Now I tried the same version of the app on another device installed through TestFlight external tester group. It no longer works. When deleting the app, the alert reads "Deleting this app will also delete its data, but any documents or data will be stored in iCloud will not be deleted" so the app should have said something in iCloud. When looking in Settings -> Your Name -> iCloud -> Manage Account Storage, on the working device I can see around 300 KB saved in iCloud, on the other device my app is not listed. Both have a fast and working internet connection, almost fully charged, low data mode turned off, running 17.4.1, Background modes enabled, Mobile data enabled, more than enough unused iCloud storage and plenty of time to sync. I was streaming the logs from the Cloudkit dashboard but nothing appeared there. The data saved neither syncs to another device of the same apple id nor reappears after app removal. The model Container is initialized without any configuration, the only relationship is optional and every value has a default value. There is A LOT of log noise when launching the app and I am unable to get any meaningful information from that. I can only get the log from the device where it is working as expected. I have triple checked that it is exactly the same app version and no debug conditions anywhere. I have absolutely no idea what is causing this. Thanks for any help :)
1
0
659
Mar ’24
So in ios 17, I stored the login information in NSUserDefaults, and I opened the App again and the login information disappeared
In the system of iOS17, I store the login information through NSUserDefaults, but after the application is closed, I open it again, and the information stored in NSUserDefaults does not exist. I have not found the specific reason. I did not find this problem in the system before ios 17. This issue only appeared after iOS 17.
2
0
520
Feb ’24
local doc save and iCloud data in same app
I have app that is using container for small settings data and iCloud for larger storage, but I also want to be able to save to local documents folder. When I do that the url that is created is not local docs, but: path: file:///var/mobile/Containers/Data/Application/85A8B8C9-C0C3-4843-A74C-5A951F593790/Documents/Dialog08:45,%2022%20Feb%202024 Here is code using to save to local docs folder. func saveDataToFile(data: String) { //file will be datetimedialog let formatter = DateFormatter() formatter.dateFormat = "HH:mm, d MMM y" var dateTime = Date.getCurrentDate() dateTime = formatter.string(from: Date.now) var saveFilename = "Dialog" saveFilename.append(dateTime) let path = getDocumentsDirectory().appendingPathComponent(saveFilename) print("path: \(path)") // let fileURL = URL(fileURLWithPath: data, relativeTo: path) do { try data.write(to: path, atomically: true, encoding: String.Encoding.utf8) } catch { print(error.localizedDescription) } } func getDocumentsDirectory() -> URL { let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) return paths[0] }
1
0
354
Feb ’24
Is it possible to not overwrite certain files when updating (upgrading) an app on iOS?
Hello! I'm in the process of creating an app for iOS. A part of the app relies on data that is collected as the user uses the app. This data is then stored in a .CSV file for easy storage, retrieval, and a small size even if it grows larger than expected. The data is really simple and easy to traverse, however it won't be stored on a remote database, and only locally on the user's device. I've read that updating the app doesn't overwrite the data of the current version, but instead places the new version of the app in a new directory entirely while the other, older version is then deleted. Is it possible to mark certain files to be transferred and not replaced entirely? I'd like to know if it's possible or not before I make the mistake and learn the hard way 😅 Also I'm open to any alternative ways to store such data that people may suggest! Thanks a lot in advance! Help is much appreciated Jack
2
0
467
Dec ’23
UserDefaults not saving only on iOS 17
Hello. I'm experiencing some issues with my iOS application. We distribute our app through an enterprise plan, and our app is almost 8 years old. We've noticed that on iOS 17 devices, our UserDefaults files are not being saved in the Preferences folder. I've conducted research on this issue, and everywhere I looked, it indicated that the system should handle this saving process. Does anyone know what changes have been made in iOS 17 that prevent us from saving data in UserDefaults? I've tested it with a new app, and it worked perfectly fine. Below are screenshots of the 'Preferences' folder on iOS 17 and 16.
6
2
1.1k
Nov ’23
Can you force Messages to offload old, stuck attachments on macOS?
It appears that some attachments get stuck and aren't offloaded like they are on iOS. I have 200-300 attachments, all dated 5/3/2021 (perhaps that's when I last formatted this Mac and downloaded from iCloud), and then it keeps 1-10 attachments from every month after that. I don't want to delete the attachments because I want them to stay in iCloud. Is there a terminal command to offload or set the maximum space Messages may use or something? Signing out and signing back in does nothing. They stay on the hard drive. Messages on my phone with the same synced conversations stay around 21GB.
0
0
481
Oct ’23
Does restoring an iCloud backup on a new device install ad-hoc apps?
When using the "Quick Start" function on a new device, apps are downloaded from the App Store, and the app data itself is restored from an iTunes or iCloud backup. What I would like to know is if the same behavior applies to apps installed through Ad-Hoc. More specifically, I'm trying to test how my app handles being restored on a new device, since it has some inner counter-measures to avoid this for security purposes. (For example, I'm marking several files as "do not back up") Note: My app exists on the App Store, but I'd like to test a newer version which isn't available on the App Store yet. My testing process is as follows: Install the current version of my app through Ad-Hoc on device A. Perform a back up (enable it and wait for the device to finish) Use Quick Start on device B. Once the setup has finished, install the new version of my app using Ad-Hoc on device B. Some things I'm unsure about are, I've read some old articles stating that the app data (not the app itself) from ad-hoc apps is actually backed up by iCloud and can be restored on a new device. (Is this still true?) Will Quick Start on device B attempt to install the App Store version of my app? I assume installing the App Store version on device A will trigger "Quick Start" to automatically install the App Store version on device B (along with the backed up data). Can I just install the new version through Ad-Hoc on device B without affecting the app's backed up installed data? Will Quick Start still install the App Store version on device B if I first download the App Store version on device A and overwrite it with the Ad-Hoc version? Thanks for any information you can provide.
0
0
479
Oct ’23
Integrating SwiftUI with a Complex PHP & MySQL Database - Seeking Advice
I am working on an ambitious project where I need to integrate a complex database system written in PHP and MySQL with a SwiftUI app. The current system involves 78 tables with intricate connections, and I've attempted to map out the data using Vapor, but I found the task to be overwhelming. My Attempts: Reverse Engineering: I tried to reverse engineer the database to understand its structure, but the sheer complexity has made it a challenging endeavor. Using Vapor: I hoped that Vapor might help me map out the data, but it turned out to be an impossible task due to the database's intricacies. What I Want to Achieve: I need to perform CRUD (Create, Read, Update, Delete) operations on this existing PHP and MySQL database using a SwiftUI app. My Questions: SwiftUI Integration: Should I build a SwiftUI app and then work on the integration? If so, what would be the best approach? Data Management: Would dumping the data into CloudKit or Firebase be a suitable step? Or are there better solutions that I might explore? Existing Tools or Libraries: Are there any tools or libraries that might simplify this task, considering the complexity of the existing system? I appreciate any insights or suggestions from those who have tackled similar challenges. Your expertise would be invaluable in guiding me through this project. Thank you in advance!
0
0
562
Aug ’23