XPC is a a low-level (libSystem) interprocess communication mechanism that is based on serialized property lists.

XPC Documentation

Pinned Posts

Posts under XPC tag

93 Posts
Sort by:
Post not yet marked as solved
13 Replies
7.7k Views
Hi All,I am unable to set environment variable DYLD_LIBRARY_PATH using launchctl command on El Captian. The below are the commands$ launchctl setenv DYLD_LIBRARY_PATH /Path/to/my/dynamic/libraries$ launchctl getenv DYLD_LIBRARY_PATHThe getenv does not print the path, it returns empty.Thanks,Rashmi
Posted
by
Post marked as solved
2 Replies
507 Views
On OS X, I'm looking for a command line which would show the known path of a bundleIdentifier from Launch Services point of view.If there're several bundles with same id, my app keep looking for a trashed one, or copied, and it's hard to troubleshoot without a command like "launchctl .... mybundleId"In swift, I've found: let launchdPathToHelper = NSWorkspace.sharedWorkspace().absolutePathForAppBundleWithIdentifier(bundleIdHelper)This helps me and gives me the answer, but sure there's a command line for that.Thanks!
Posted
by
Post not yet marked as solved
6 Replies
39k Views
i want to sideload kodi on apple tv gen4. i need a free developer account to do so.is this possible? If so, how?Thank you.
Posted
by
Post not yet marked as solved
12 Replies
13k Views
Hi,What is the recommended and most compatible way to set the PATH and other environment variables globally? I would like:- A method that works from Yosemite and later versions of the OS- It should work for both GUI + command line applications.- It should work for both local shell and also remote SSH shells- It should work with System Integrity Protection enabledHere's some of the things I've tried:- Setting the variables in ~/.bash_profile - this only seems to apply to command line apps.- Editing /etc/paths and /etc/paths.d/ - this only seems to apply to command line apps.- It seems possible to set some environment variables globally using launchctl and a plist. E.g.Create file: /Library/LaunchAgents/myvars.plist<?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>Label</key> <string>myvars</string> <key>ProgramArguments</key> <array> <string>/bin/launchctl</string> <string>setenv</string> <string>MYVAR</string> <string>/Users/me/whereever</string> </array> <key>RunAtLoad</key> <true/></dict></plist>And load with: launchctl load /Library/LaunchAgents/myvars.plistThis seems to work ok for environment variables other than PATH, for GUI and local shells, but not ssh. It has one other slight issue, in that it doesn't seem to work for applications that are reopened at login, if "Reopen windows when logging back in" is checked- The "launchctl config" command seems to allow PATH to be set (after a reboot) for GUI apps, but it doesn't appear to work for the terminal. E.g:sudo launchctl config user path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/me/mydirAny other others?Thanks.
Posted
by
Post not yet marked as solved
2 Replies
1.9k Views
Hello,our app is in the App Store since August 18th 2015. It worked very well since then. But in the last couple of weeks, we got negative ratings in the App Store claiming the app is freezing. Moreover, the app seems to slow down the whole device once it froze. We couldn't reproduce the issue until the beginning of the year. Since then we experienced the same bahavior once in a while, while developing further features.Detailed description:While deploying the debug version from Xcode to a device, the app sporadically freezes at the launch screen. The debug log shows an appropriate start of the app and doesn't show any errors, exceptions or other suspicious output. What we can see is, that 'applicationDidEnterBackground:' is called before the app freezes. The app doesn't crash and the launch screen is displayed forever. The watchdog deamon doesn't kill the hanging process either. Furthermore the home button doesn't respond to inputs. The device can be recovered by killing the process with Xcode, then we see a black screen. After that, the home button can be pressed twice to remove the app from the recent apps.Environment:We experience these issues on iPhone 6 and iPhone 6s Plus with iOS 10.2.1 and 11.2.2 respectively. But we get user reports from various devices and iOS versions. We couldn't reproduce the issue on an iPhone 5 with iOS 9.3.5.We currently use Xcode 9.2 for development.Expected bahavior:We'd expect either a crash with related log entries or the watchdog deamon to kill the hanging application.I know this is not much info, but I hope anybody can help.Kind regardsPeter
Posted
by
Post not yet marked as solved
17 Replies
8.9k Views
is there any public API or Method to get resident size of current process of game like Debug Gauges to Monitor Memory?As far as i know someone use XCode instrument -> show the Debuger navigator -> Memory to get it, before i have found some API to get itfrom internet,but a big differece bettween with the result of XCode Debuger navigator .the first method like this: struct mach_task_basic_info info; mach_msg_type_number_t count = MACH_TASK_BASIC_INFO_COUNT; if (task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)& info, &count) == KERN_SUCCESS) { int32_t _pss = (int32_t)info.resident_size / (1024 * 1024); }another method like this: task_vm_info_data_t vmInfo; mach_msg_type_number_t count = TASK_VM_INFO_COUNT; kern_return_t kernelReturn = task_info(mach_task_self(), TASK_VM_INFO, (task_info_t) &vmInfo, &count); if(kernelReturn == KERN_SUCCESS) { int32_t _pss = (int32_t) vmInfo.phys_footprint / (1024 * 1024); }someone discuss:https://github.com/aozhimin/iOS-Monitor-Platform/issues/5a big differnece bettween the result of the first method and the result of XCode Debug navigator instrument, info.resident_size will not increase When the memory is allocated continuously,but xcode Debug navigator will increase.but a little difference bettween the result of the second method and the result of XCode Debug navigator instrument when use game test,but application app will same with it. so i want to know how XCode Debug navigator to calculate Memory or how to get resident size of current process more precise,any idea will help me,thanks in advance!
Posted
by
Post not yet marked as solved
22 Replies
6.7k Views
An application I am working on (Mostly swift 4.2 with sprinklings of C and C++) appears to be leaking mach ports when run on Mojave and currently has 3,600 open after running for 12 hours. I am just looking at the 'Ports' field in Activity Monitor to see this.The same binary running on Sierra is using about 500 ports.The application is quite complex, making extensive use of DispatchQueue() and also has an associated privileged helper.Unfortunately, I have been unable to create a simple test case that demonstrates the behaviour.I have done a lot of searching to find out what may be causing the problem and come up with zilch. Is there any debugging tool (i.e. Instruments plugin maybe) that might help to narrow down where the allocation/leakage is coming from. I have seen the results of the tests on google Chrome from a few years back but I'm not keen to start building, installing and debugging kernel extensions to track this problem down.
Posted
by
Post marked as solved
7 Replies
1.7k Views
I am currently building a sandboxed app that also contains:Finder Sync Extension (sandboxed)XPC Service (sandboxed)The XPC Service exists to facilitate communication between the host app and the Finder Sync extension.So far, I have succesfully established an NSXPCConnection from the host app to the XPC service and was able to invoke a method on the XPC service from the host app. However, when I try to create a similar connection upon instantiation of the principal class of the Finder Sync extension, I immediately receive an error saying that the connection to the service was invalidated. I have confirmed that the XPC service is running, but somehow the connection is still invalidated immediately. I am also using the exact same service name when establishing the connection from the host app and when doing the same thing from the Finder Sync Extension.What could be the reason that the NSXPCConnection is invalidated immediately?Is there some kind of sandbox restriction at play here?Is communicating throught an XPC Service the recommended IPC architecture for a sandboxed app to communicate with an embedded Finder Sync Extension?
Posted
by
Post not yet marked as solved
3 Replies
1.5k Views
I am trying to figure out how to programatically install a per-user launchd agent - I have an executable Swift script I wrote and I need macOS to enforce it always be running. I found the SMJobBless sample code which I could play with to see how this works, but it hasn't been updated since it was last built with Xcode 4.6. As you can imagine it doesn't compile in Xcode 10. I was able to get it to build by upgrading to the recommended project settings, increasing the deployment target, and selecting my team for the two targets. Following the ReadMe I need to run ./SMJobBlessUtil.py setreq to configure the Info.plists appropriately. These instructions are out of date but eskimo was kind enough to provide updated instructions here to find the .app url. But when I do this and run the command I receive the following output:MacBook:SMJobBless Jordan$ ./SMJobBlessUtil.py setreq /Users/Jordan/Library/Developer/Xcode/DerivedData/SMJobBless-dffakkidazmiowcishyrborysygm/Build/Products/Debug/SMJobBlessApp.app SMJobBlessApp/SMJobBlessApp-Info.plist SMJobBlessHelper/SMJobBlessHelper-Info.plist Traceback (most recent call last): File "./SMJobBlessUtil.py", line 424, in main() File "./SMJobBlessUtil.py", line 418, in main setreq(appArgs[1], appArgs[2], appArgs[3:]) File "./SMJobBlessUtil.py", line 360, in setreq appToolDict[bundleID] = toolNameToReqMap[bundleID] KeyError: '$(PRODUCT_BUNDLE_IDENTIFIER)'It would seem this python script isn't able to work with the newer project structures, not surprisingly. I wasn't able to find any other information on how to accomplish this task in the modern days. So could you please explain how to go about this? 🙂I have an executable .swift file and a .plist that works when loaded from ~/Library/LaunchAgents/ ready to be added to an existing Xcode project. Thanks!
Posted
by
Post not yet marked as solved
16 Replies
26k Views
Previously discussed in beta:https://forums.developer.apple.com/message/330295This process stops responding every day it seems, I'm running 10.14.3 (18D109)When the process hangs, its Open Files and Ports include the following:txt /Library/Preferences/Logging/.plist-cache.ZP6RP0OT txt /private/var/db/timezone/tz/2018i.1.0/icutz/icutz44l.dat txt /usr/share/icu/icudt62l.dat txt /private/var/folders/35/dgpwsg457w17gs77hssnrbnw0000gn/0/com.apple.LaunchServices-231-v2.csstoreThose are not open when the service is running (before it hangs)Would like to know how frequently this hangs for everyone else and get steps to troubleshoot if possible.
Posted
by
Post not yet marked as solved
10 Replies
1.7k Views
This is new Catalina behavior. The file access error described below never happened on Mojave and High Sierra.My sandboxed Mac App store app includes a sandboxed XPC helper service in its app bundle.The XPC helper service has the standard entitlements: com.apple.security.app-sandbox and com.apple.security.inheritThe host app creates a document file in its own sandbox container's Caches directory. After the save operation completes,it invokes a method on the XPC service, sending the document's URL. That method on the XPC service tries to open and read the document file at that URL.Error Received: The file couldn’t be opened because you don’t have permission to view it. Permission denied.So then I tried an experiment where the user would select a folder for the XPC service to put files using NSSavePanel.The document was then written there by the host app.XPC service could not open the file either. The file couldn’t be opened because you don’t have permission to view it. Permission denied.In both instances, the XPC service did not "inherit" the sandbox state of its host app. This violates the com.apple.security.inherit entitlement.The radar report is: FB7450619
Posted
by
Post marked as solved
1 Replies
1.2k Views
Hi!I have a launchd agent that requires Screen Recording permissions in Catalina.Below is the simple example:#!/bin/bash /usr/sbin/screencapture $FILEIf the script is run from a terminal, permissions are required for Terminal.appBut if the script is launched from launchd, the User prompt doesn't appear.I found some workarounds to get it:1.#!/bin/sh /usr/sbin/screencapture $FILE2.#!/bin/bash exec /usr/sbin/screencapture $FILENow in Catalina, Sh is just a wrapper (man sh), which "re-execing" scripts in one of the supported shells.In the first case, permissions are requested for Sh.In the second case, "exec" causes User prompt for Bash.If the script runs another script that launches screen capture, then "exec" helps only if it used in the first script, and the second script uses a different shell:#!/bin/bash exec secondScript.sh ... #!/bin/zsh /usr/sbin/screencapture $FILEOther options for changing the shebang or "exec" position do not cause User prompt.I also have a launchd agent in Mojave that requires Accessibility permissions. It contains a startup sequence of scripts and the target app. Permissions are required for the first script (by name, not for shell), and TCC.db contains csreq of this script, which means that only this script has permissions.In Catalina, the permissions required by this script are saved in TCC.db as permissions for shell, which means that ANY shell script can now use them.My questions are:Why only Catalina's /bin/sh or "exec" in the first script causes User prompt?Is there a proper way to get permissions without a workaround?Is there a way to get permissions only for my script (as in Mojave), not for shell?
Posted
by
Post not yet marked as solved
6 Replies
792 Views
For many versions of macOS I have shipped an application, EndpointService. EndpointService is installed in /Library/Application Support/Identity Finder. It runs as root, and is owned by root:wheel. It is controlled by a LaunchDaemon plist. After install, the newly installed version has always run without a problem without a rebooting the machine. Recently (I think starting in Mojave), EndpointService will not start until the machine is rebooted, then after that it runs normally. Without a reboot, running launchctl load fails to start the app, and even just doing a version check from the command line results in "Killed: 9". Is this a SIP problem? Is a reboot now required?Here is the com.identityfinder.launchdaemon.plist file:<?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>EnvironmentVariables</key><dict><key>LANG</key><string>C</string></dict><key>AbandonProcessGroup</key><true/><key>KeepAlive</key><true/><key>Label</key><string>com.identityfinder.launchdaemon</string><key>ProgramArguments</key><array><string>/Library/Application Support/Identity Finder/EndpointService</string><string>--launchd</string></array><key>StartInterval</key><integer>300</integer></dict></plist>Here's the listing:$ ls -ltotal 133136-rwxr-xr-x@ 1 root wheel 36519424 Jan 10 10:54 EndpointServiceIf I even try to just get the version, it won't start:$ /Library/Application\ Support/Identity\ Finder/EndpointService --versionKilled: 9
Posted
by
Post not yet marked as solved
0 Replies
2.5k Views
IMPORTANT This post is now retired in favour of official documentation, namely Signing a Daemon with a Restricted Entitlement. I’m going to leave the original post here just for the record, but you should consider the official documentation authoritative. Some APIs can be used from a daemon but require that the client have an entitlement that’s allowlisted by a provisioning profile. For example, the EndpointSecurity API can be called from daemon but requires that the daemon have the com.apple.developer.endpoint-security.client entitlement. macOS does not support this directly, but you can get things working by packaging your daemon in an app-like structure. Read this document to learn how to do this with Xcode. Note If the API you’re using supports system extensions, you can avoid all of this rigmarole by packaging your client as a system extension. System extensions support provisioning profiles directly, and Xcode will automatically do the right in that case. The basic idea here is to create an app target, rather than a command-line tool target, and then remove all of the app-specific stuff and replace it with your daemon code. The following example assumes Xcode 11.4 on macOS 10.15.4, but the technique should work on any version of Xcode or macOS. To start, create a new app target (File > New > Project > macOS > App). Set the language popup to Objective-C and the User Interface popup to Storyboard. Note This example uses Objective-C but this approach also works just fine with Swift. In the General tab of the target editor, make sure that the Bundle Identifier is set correctly. This is important because a provisioning profile is tied to an App ID and the bundle identifier is a key part of that App ID. Also set the App Icon > Source popup to “Don’t use asset catalogs”. Switch to the Signing & Capabilities tab and configure it appropriately. In this example I: Removed the App Sandbox capability — The App Sandbox is, as the name suggests, not appropriate for daemons. Added the Hardened Runtime capability — You’ll need this to notarise your product, so you might as well set it up front. Added a Keychain Sharing capability — This requires a provisioning profile, which is critical to this exercise. In the Project navigator, select the Info.plist and then delete all the app-specific items (NSPrincipalClass, NSMainStoryboardFile, NSSupportsSuddenTermination and NSSupportsAutomaticTermination). Also remove the AppDelegate.{h,m}, ViewController.{h,m}, Assets.xcassets, and Main.storyboard files. Replace the code in main.m with your daemon code. For this example I used: @import Foundation; int main(int argc, const char * argv[]) { @autoreleasepool { SecCodeRef me; OSStatus err = SecCodeCopySelf(kSecCSDefaultFlags, &me); assert(err == errSecSuccess); CFDictionaryRef infoCF; err = SecCodeCopySigningInformation(me, kSecCSDefaultFlags, &infoCF); assert(err == errSecSuccess); NSDictionary * info = CFBridgingRelease(infoCF); NSDictionary * entitlements = info[(__bridge NSString *) kSecCodeInfoEntitlementsDict]; NSLog(@"entitlements: %@", entitlements); } } This logs the current process’s entitlements, which is a good way to confirm that things are set up correctly. Build and run from Xcode. The program prints: 2020-02-26 09:21:31.142904+0000 DaemonInAppsClothing[7020:9340817] entitlements: { "com.apple.application-identifier" = "SKMME9E2Y8.com.example.apple-samplecode.DaemonInAppsClothing"; "com.apple.developer.team-identifier" = SKMME9E2Y8; "com.apple.security.get-task-allow" = 1; "keychain-access-groups" = ( "SKMME9E2Y8.com.example.apple-samplecode.DaemonInAppsClothing.shared" ); } Now add your daemon’s code to the project and call it from main.m. You can also replace main.m with a plain C or C++ main function if you wish. The final structure of your daemon should look something like this: % find DaemonInAppsClothing.app DaemonInAppsClothing.app DaemonInAppsClothing.app/Contents DaemonInAppsClothing.app/Contents/_CodeSignature DaemonInAppsClothing.app/Contents/_CodeSignature/CodeResources DaemonInAppsClothing.app/Contents/MacOS DaemonInAppsClothing.app/Contents/MacOS/DaemonInAppsClothing DaemonInAppsClothing.app/Contents/embedded.provisionprofile DaemonInAppsClothing.app/Contents/Info.plist DaemonInAppsClothing.app/Contents/PkgInfo Now modify your launchd property list file so that the Program property (or the first item of the ProgramArguments array) points to the executable within Contents/MacOS/. Finally, I should stress that you don’t have to build your daemon using Xcode; this is just an easy way to get started. If you’re using another build system, I recommend that you first use these instructions to create an example daemon, and then update your build system based on that. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" Change history: 26 Feb 2020 — Newly written today. 9 Apr 2020 — Changed the test app name as aide-memoire. Updated the Xcode and macOS versions. 26 Feb 2021 — Fixed the formatting. 8 Nov 2021 — Added a retirement notice.
Posted
by
Post not yet marked as solved
16 Replies
5.8k Views
Hi,A cross-platform plugin architecture we developed needs to load libraries at runtime from arbitrary locations (within our plugins).On MacOS, dynamic library loading fails to find/use a dependency that was already loaded, despite the library "install-name" matching. The same technique works on Linux for a library "SONAME" and on Windows based on the DLL filename, however, on Mac, it seems like the dependency is not resolved, unless it is also on a path of library locations (eg. DYLD_LIBRARY_PATH).Am I missing the proper technique to achieve the desired behavior? Is this the expected behavior on Mac or an issue in dlopen resolving dependencies?For example:dlopen(/Users/craig/KayakSDK/Plugins/ca.digitalrapids.CommonMedia/bin/OS_X/libCommonMedia.dylib, 1): Library not loaded: libKayakNative.dylib Referenced from: /Users/craig/KayakSDK/Plugins/ca.digitalrapids.CommonMedia/bin/OS_X/libCommonMedia.dylib Reason: image not foundBut libKayakNative.dylib had already been loaded and has the expected "install-name".$ otool -D Plugins/ca.digitalrapids.KayakCore/bin/OS_X/libKayakNative.dylibPlugins/ca.digitalrapids.KayakCore/bin/OS_X/libKayakNative.dylib:libKayakNative.dylibSo why doesn't dlopen utilize the already loaded libKayakNative.dylib ? That's how SONAME on Linux works and the DLL name on Windows.If DYLD_LIBRARY_PATH specifies the folders within the plugins, then everything does load and execute fine. But this is far from ideal, as DYLD_LIBRARY_PATH would need to be configured ahead of launch, and cannot be modified at runtime by the application. If there was a way to modify DYLD_LIBRARY_PATH (or an equivalent) at runtime, that would work for us too.Thanks, any info is appreciated,Craig
Posted
by
Post not yet marked as solved
1 Replies
2.2k Views
I'm trying to get my macOS app running natively on the Apple Silicon DTK and it's going fine so far. Unfortunately it makes use of a third party library which isn't (and probably won't ever be) available in form of a Universal Binary. This should be no problem, though, because I've been using that library via XPC before and the documentation clearly states that mixed architectures are supported as long as they are out-of-process. So I went ahead and configured Xcode's build settings as follows for the x86-only XPC target: ARCHS: x86_64 VALID_ARCHS: x86_64 The main app and also the XPC compile fine. But when running the app it fails to launch the XPC with the following error in the console: oah error: /var/db/oah/e089a6709d38c1a085254c76a7cb592fcceddb3f234a4aa318bb4ec25fe40d27/a37f39d2b061393d7731233ae89d90cd87c97f4edeeb46a78ad791/ c43ac96d2b/my.xpcBundleID.aot: unable to mmap __TEXT: 1 Does anyone know what's going on here?
Posted
by
Post not yet marked as solved
4 Replies
4.4k Views
Hello! I am using macOS Catalina, Xcode 11. I just started working on app development and this is my first project. Every time i try to simulate the code the program crashes and it gives me thread 1 signal SIGTERM error. My code is very simple, I don't think i have an error there. I am really stuck, I tried to run different projects but it doesn’t work on any of them. Please, can someone help me fix this error? Thanks in advance!
Posted
by
Post not yet marked as solved
7 Replies
1.1k Views
I have a requirement to download and install a required package before starting the actual task in a MAC application. and the downloaded package is coming from the private server through https API, I tried to run mount process for the file but it fails for .dmg formate. let task = Process.launchedProcess(launchPath: "/usr/bin/hdiutil", arguments: ["attach", "-verbose", "-debug", "-mountroot", "/dev/disk2","<path of downloaded file>"]) task.waitUntilExit() It says hdiutil: attach failed - Device not configured So I thought of asking the backend developer to provide .XIP, would that be a solution? Because I think that won't give any signing or permission issue. Any Suggestion?
Posted
by
Post not yet marked as solved
11 Replies
2.3k Views
What is Error Domain=com.apple.photos.error Code=46104 mean? This error appears when I try to create an album on iOS14. case: User first gives AddOnly authorization and then gives ReadWrite authorization. After I get the ReadWrite authorization, create an album. code reference: [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{     PHAssetCollectionChangeRequest *request = [PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle:albumName]  albumPlaceholder = [request placeholderForCreatedAssetCollection]; } completionHandler:^(BOOL success, NSError * _Nullable error) { // success is NO, error is "Error Domain=com.apple.photos.error Code=46104"  }]; The supplementary log information for the above question is as follows: 2020-08-17 11:28:19.470871+0800 XXXX[4255:1139139] CoreData: XPC: Unable to connect to server with options { NSXPCStoreServerEndpointFactory = "<PLXPCPhotoLibraryStoreEndpointFactory: 0x280ce8760>"; skipModelCheck = 1;} 2020-08-17 11:28:19.479533+0800 XXXX[4255:1139139] CoreData: XPC: Unable to load metadata: Error Domain=NSCocoaErrorDomain Code=134060 "关键数据出错。" UserInfo={Problem=Unable to send to server; failed after 8 attempts.} 2020-08-17 11:28:19.483149+0800 XXXXX[4255:1139139] [error] error: addPersistentStoreWithType:configuration:URL:options:error: returned error NSCocoaErrorDomain (134060) CoreData: error: addPersistentStoreWithType:configuration:URL:options:error: returned error NSCocoaErrorDomain (134060) CoreData: annotation: userInfo:CoreData: annotation: Problem : Unable to send to server; failed after 8 attempts. CoreData: annotation: storeType: NSXPCStoreCoreData: annotation: configuration: (null) CoreData: annotation: URL: file:///var/mobile/Media/PhotoData/Photos.sqlite CoreData: annotation: options: CoreData: annotation: NSXPCStoreServerEndpointFactory : <PLXPCPhotoLibraryStoreEndpointFactory: 0x280ce8760>CoreData: annotation: skipModelCheck : 1 2020-08-17 11:28:19.485049+0800 XXXXX[4255:1139139] [Generic] Failed to connect to XPC PhotoLibraryStore file:///var/mobile/Media/PhotoData/Photos.sqlite with options { NSXPCStoreServerEndpointFactory = "<PLXPCPhotoLibraryStoreEndpointFactory: 0x280ce8760>"; skipModelCheck = 1;}: Error Domain=NSCocoaErrorDomain Code=134060 "关键数据出错。" UserInfo={Problem=Unable to send to server; failed after 8 attempts.} 2020-08-17 11:28:19.485565+0800 XXXXX[4255:1139139] [Migration] Failed to configure PSC for library file:///var/mobile/Media/: Error Domain=NSCocoaErrorDomain Code=134060 "关键数据出错。" UserInfo={Problem=Unable to send to server; failed after 8 attempts.} 2020-08-17 11:28:19.485943+0800 XXXXX[4255:1139139] [LibraryBundle] Unable to create PLLibraryBundleLogInfo because PSC is nil There is another problem. When saving the video, if the AddOnly permission is taken first and then the ReadWrite permission is taken, the performChanges method will freeze for more than 10 seconds before calling the completionHandler. The following is the log information: [Generic] Failed to connect to XPC PhotoLibraryStore file:///var/mobile/Media/PhotoData/Photos.sqlite with options { NSXPCStoreServerEndpointFactory = "<PLXPCPhotoLibraryStoreEndpointFactory: 0x280700d00>"; These problems only occur during a cold launch when the AddOnly permission is taken first and then the ReadWrite permission is taken. Whether the app only takes the AddOnly permission, only takes the ReadWrite permission, or closes the app after authorization and reopens it will not happen.
Posted
by