Application's iCloud drive folder doesn't show in macOS - macos

I have an app that needs to store video files in it's own container folder in iCloud Drive. I have tried suggestions from most forums and I still couldn't resolve this issue.
These are the things I did to setup a cloud container for my app -
Added iCloud capability. Selected 'iCloud Documents' for Services and selected the appropriate iCloud container that I had created through my developer account.
Added the following entry in Info.plist
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.com.TeamName.AppName</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerName</key>
<string>AppName</string>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
</dict>
</dict>
These are the values in the entitlement file
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.TeamName.AppName</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.com.TeamName.AppName</string>
</array>
Have tried with new bundle identifiers and cloud containers.
Have tried updating the Version and the Build value
The app folder is created at '/Users/{user}/Library/Mobile\ Documents/iCloud~com~TeamName~AppName/Documents' and I can see the files I've written to it.
I can find these files at iCloud -> Manage Storage -> AppName on my iPhone too.
Will 'NSUbiquitousContainerIsDocumentScopePublic' be accepted as true only when an app is released on the Appstore? Or it's just that I'm missing something here?

Same here, I followed every tip I could find here and on other websites, but still the folder / files are not showing up visibly.
Problem: ubiquitous container works, files can be read and written, but are not showing up in macOS Finder, nor in the Files app on iOS devices.
macOS 11.5, iOS 14.7, Xcode 12.5.1
I have tried:
everything stated here: https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/FileProvider.html
everything stated here: https://developer.apple.com/library/archive/qa/qa1893/_index.html
every variation of info.plist values for NSUbiquitousContainers (eg. both the container id and my bundle id)
every variation of info.plist values for NSUbiquitousContainerIsDocumentScopePublic
every variation of info.plist values for NSUbiquitousContainerName
every variation of info.plist values for NSUbiquitousContainerSupportedFolderLevels
creating new containers
changing the apps' version and build numbers, including only increasing CFBundleShortVersionString.
changing the apps' bundle identifier
deleting and reinstalling the app
reboots of used devices
switching off/on iCloud drive for the user on all devices
It is driving me crazy. Who can help?

Related

macOS Granting full-disk access to sandboxed app not working

I'm experimenting with full-disk access and can't make it working. Here is list of steps I did:
Sandbox is turned ON. In fact the entitlements file looks like:
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
I created archive of the app and tried to distribute it using boths Developer ID or Development methods
I placed the binary of my app to /Applications folder
I went to System Preferences -> Security & Privacy -> Privacy -> Full Disk Access and added access to my app in /Applications folder
Of course I'm NOT attached to the app with Xcode
I'm testing it in Xcode 11 and on Catalina. It's dummy app, opening NSOpenPanel to let user select archives to decompress and tries to decompress it in the same directory.
In fact it's not about NSOpenPanel, the question is:
What is necessary to do to make sandboxed app using full-disk access?
Any hints? Am I doing anything wrong?
Here is solution found for iTerm2 (it is worth read how solution was found). It just adds this to application plist:
<key>NSSystemAdministrationUsageDescription</key>
<string>I want to read all your files</string>
Documentation is a bit fuzzy.
Sadly this solution doesn't work for launchctld daemons (this is what I need). I think daemons are an exception since the do not see UI at all.
But for regular applications it should work like a charm (didn't test it yet).

Can't deploy to iPad when I add iCloud entitlement

Using Xcode and Visual Studio for Mac:
In Xcode, I can make, deploy and run an out-of-the-box HelloWorld app to my provisioned iPad.
Also in Xcode, I can add iCloud to the same app (via entitlements), and it deploys and runs on my iPad.
In VS for Mac, I can make and deploy a blank Xamarin Forms HelloWorld app and it runs on my iPad.
However, if I add iCloud to the entitlements.plist for the Xamarin forms app, it won't deploy to my iPad.
I get the following for #4:
ApplicationVerificationFailed: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.tlZMLz/extracted/HelloWorldV.iOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)
error MT1006: Could not install the application '/Users/Huber/Projects/HelloWorldV/iOS/bin/iPhone/Debug/device-builds/ipad5.3-11.1.1/HelloWorldV.iOS.app' on the device 'Denny's iPad': Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).
Application could not be uploaded to the device.
The entitlements.plist file that Xamarin generates is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.DennyHuber.HelloWorldV</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
</dict>
</plist>
I have Key-Value Storage and iCloud Documents both checked.
Can anyone help?
Thanks,
Denny Huber
You need to go to developer.apple.com and regenerate provisioning profile with new entitlements. After that, I advise you to manually delete all provisions, because sometimes it still tries to sign with an old one.
The provisions located in ~/Library/MobileDevice/Provisioning Profiles
After that go to Xcode, Setting -> Accounts -> Select your program, and press Download Manual Profiles.
After that clean the project and try to build again.

Info.plist may not contain the UIRequiredDeviceCapabilities key

When I try to upload my iOS + apple watch app to iTunes using Application Loader, I get the error message
ERROR ITMS-90595: "Unsupported Key. The Info.plist of bundle Watchless.app/Watch/WatchlessWatchApp.app/PlugIns/WatchlessWatchApp Extension.appex may not contain the UIRequiredDeviceCapabilities key."
Info.plist contains
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>healthkit</string>
</array>
which I think is absolutely necessary because both, watch app and iOS app depend heavily on HealthKit.
The entry is generated when I turn on the HealthKit capability of the watch extension target.
I am running out of ideas what to change.
Using XCode 7.2, Application Loader 3.4
UIRequiredDeviceCapabilities are just your way of saying "I don't want to be installed on device without this functionality".
Removing this will not affect your Watch extension using HealthKit.
Just remove the UIRequiredDeviceCapabilities from the plist in your extension and it should be fine.

iOS Device Orientation settings in project.pbxproj

I'm developing an Hybrid iOS application using Cordova (http://cordova.apache.org/).
I need to tweak the device orientation settings manually from the XCode project with Cordova hooks.
I was able to customise the deployment target and the targeted device family with IPHONEOS_DEPLOYMENT_TARGET and TARGETED_DEVICE_FAMILY fields in project.pbxproj respectively, however, can't seem to find how to change orientation settings from there.
I applied the same process that I used to discover the above fields:
Take a copy of project.pbxproj.
Modify the settings from within XCode.
Take another copy of the updated project.pbxproj.
Doing a diff between them.
However it didn't reveal any information for orientation settings change.
Are those settings saved somewhere else?
Finally found the answer.
Orientation settings are found in <project-name>-Info.plist XML file:
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>

Invalid Mac App Store Validation using iCloud Entitlements

I've been trying to simply validate an app for the Mac App Store. I was able to submit the iOS version without a hitch.
At this point in time i've configure the App ID in the dev portal to a unique iCloud identifier, so that eliminates the possibility that this is a shared ICID problem (iCloud ID).
I've recreated certificates, App ID, iCloud container, and distribution provisioning profiles.
*After days of troubleshooting, i've narrowed the issue down. If I assign the iCloud container to the App ID, validation fails. If I un-assign it, validation passes.
I have opened several tickets with Apple over the course of the week, but I haven't had a response so i'm hoping SO can help.
The errors reported by the validation tool:
My App ID: com.proj-build.cocoa-notes
My iCloud Container ID: iCloud.com.proj-build.cocoa-notes
The prefixed iCloud in the iCloud Container ID confuses me. My iOS app does not specify the prefix in the entitlements file (using a different container ID) and it was validated. Prefix or no prefix on Mac does not work.
Any ideas what I could be doing wrong?
Entitlements configuration below
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>$(TeamIdentifierPrefix)com.proj-build.cocoa-notes</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.print</key>
<true/>
</dict>
</plist>
It looks like your app ID and provisioning profile are misconfigured. The iCloud containers (those that match iCloud.*) are a Mac OS X 10.10 Yosemite feature. You'll need to log in to the developer center and remove that, but keep the 10.9 (and previous) iCloud entitlement. Then regenerate the provisioning profile and use the new one.

Resources