Hi,
You're here because your project has issues related to Xcode Previews or Swift Previews. The issue you're experiencing may be the result of any of the following:
An error in your SwiftUI app, Xcode previews, or on-device previews.
A configuration error in your Xcode project, including any third-party dependencies or packages.
A system issue in the operating system, SwiftUI, or in Xcode Previews.
Based on your request, I need more information about your SwiftUI app when rendering Xcode Previews or on-device previews. Specifically, I’ll need the diagnostics Swift Previews generates to make sure I understand the error encountered by the preview system. Please create a report in Feedback Assistant to share the details requested in the instructions below.
For issues with macOS, Mac Catalyst, on-device iOS, or on-device visionOS previews, perform the following steps to gather diagnostics:
Download and install the Swift Previews logging profile for your device.
Reproduce the error while previewing on device, taking note of the timestamp when the error occurred.
Attach the Previews diagnostics, sysdiagnose from your Mac, a sysdiagnose from the previewing iOS or visionOS device.
For issues with Xcode Previews, perform the following steps to gather diagnostics:
Download and install the Swift Previews logging profile for your device.
Reproduce the error in Xcode Previews, if you haven’t already done so.
If an error banner appears in the canvas, click the "Diagnostics" button within the banner, then go to Step 5; otherwise, continue to Step 4.
If the error banner is missing, navigate to the menu in Xcode: Editor > Canvas > Diagnostics
In the presented sheet, click the "Generate Report" button.
Attach a zip file containing the diagnostic report to your bug report (it will be named something like previews-diagnostics-0123456789.zip).
Submitting your feedback
Before you submit to Feedback Assistant, please confirm the following information is included in your feedback:
with the Swift Previews logging profile installed, attach the sysdiagnose logs gathered after reproducing the issue
the Previews diagnostics generated by Xcode
timestamp identifying when the issue was reproduced
focused sample Xcode project that reproduces the issue (if applicable)
screenshots or videos of the error (optional)
Please include all requested information to prevent delays in my investigation.
After your submission to Feedback Assistant is complete, please respond to your original Forums post with the Feedback ID. Once received, I can begin my investigation and determine if this issue is caused by an error within your SwiftUI app, a configuration issue within your Xcode project, or an underlying issue in the operating system, SwiftUI, in Xcode Previews, or on-device previews.
Cheers,
Paris X Pinkney | WWDR | DTS Engineer
Dive into the vast array of tools, services, and support available to developers.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello Apple Developer Team,
I have been trying to request a correction to my tax invoice for my Apple Developer Program purchase, but I have been continuously redirected between Apple Developer Support and Apple Store Online, with no resolution to my issue.
Issue Details:
Tax Invoice No.: 0015056100
Problem: The company name is incorrect, and the Tax ID is missing.
Correction Requested:
Company Name: Bluebik Vulcan Company Limited (Head Office)
Tax ID: 0105565196514
Address: No.199 S-OASIS Building, 11th Floor, Unit no. 1103-1106, Vibhavadi Rangsit Road, Chomphon, Chatuchak, Bangkok, Thailand 10900
What Happened:
I initially contacted Apple Developer Support, but they informed me that they do not handle invoice modifications and asked me to contact Apple Store Online.
When I contacted Apple Store Online, they redirected me back to Developer Support.
This back-and-forth has been going on for days, and no one has taken responsibility for my request.
I need urgent assistance to resolve this issue. Could someone from Apple clarify which team is responsible for invoice modifications and escalate this matter?
I have a Case ID for my request and can provide additional details if needed.
Looking forward to a resolution as soon as possible.
Best regards,
Pornthep Jaroen-ngam | Non
Technical Consultant, Associate Director
Bluebik Vulcan Company Limited
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
Developer Tools
Developer Program
From last week all crash for watchOS has been broken.
The latest version 15.22.1 missing all stack trace and showing weird as attached.
All the crashes for previous versions totally disappeared.
The following function could run several hundred times with no problem but will occasionally cause a EXC_BAD_ACCESS (SIGBUS). The last time it was a KERN_PROTECTION_FAILURE perhaps meaning it is trying to write to a read only memory but previously it was KERN_INVALID_ADDRESS. I have tried debugging tools to no avail. Can anyone see any reason why the following function could be causing this. Just in case the function is a red herring the only other thing that was running is a AVQueuePlayer that contains 11 tracks, but the crash happens mid song making it unlikely.
The function includes running other functions so below is all related functions that happen as a result of a swipe gesture.
func completeLeft() {
let add1 = Int(tiles[Square - (squares2move + 2)].name ?? "0") ?? 0
let add2 = Int(currentNode.name ?? "0") ?? 0
let add = add1 + add2
if add.isMultiple(of: 9) == false {
if squares2move == 0 {
self.moveinprogress = 0
return
}
moveLeft1()
}
if add.isMultiple(of: 9) {
squares2move += 1
moveLeft2()
}
func moveLeft1() {
var duration = TimeInterval(0.1)
duration = Double(squares2move) * duration
self.soundEffect = "swipe"
self.playEffects(Volume: self.effectsVolume)
let move = SKAction.move(to: positions[Square - (squares2move + 1)], duration: duration)
currentNode.run(move, completion: {
self.tiles[Square - (squares2move + 1)].name = self.currentNode.name
self.tiles[Square - 1].name = ""
self.currentNode.position = self.positions[Square - (squares2move + 1)]
self.newNumber()
})
}
func moveLeft2() {
var duration = TimeInterval(0.1)
duration = Double(squares2move) * duration
self.soundEffect = "swipe"
self.playEffects(Volume: self.effectsVolume)
let move = SKAction.move(to: positions[Square - (squares2move + 1)], duration: duration)
currentNode.zPosition = currentNode.zPosition - 1
currentNode.run(move, completion: {
self.currentNode.position = self.positions[Square - (squares2move + 1)]
self.tiles[Square - 1].name = ""
self.currentNode.name = "\(add)"
self.tiles[Square - (squares2move + 1)].name = "\(add)"
if add > self.score {
self.score = add
}
if add >
self.currentgoal {
self.levelComplete()}
else {
self.playEffects2(soundEffect: "Tink", Volume: self.effectsVolume, Type: "caf")}
if self.currentNode.childNode(withName: "Label") == nil {
self.currentNode.texture = SKTexture(imageNamed: "0.png")
let Label = SKLabelNode(fontNamed: "CHALKBOARDSE-BOLD")
Label.text = "\(add)"
Label.name = "Label"
let numberofdigits = Label.text!.count
if numberofdigits == 1 {
Label.fontSize = 45 * self.hR}
if numberofdigits == 2 {
Label.fontSize = 40 * self.hR}
if numberofdigits == 3 {
Label.fontSize = 32 * self.hR}
if numberofdigits == 4 {
Label.fontSize = 25 * self.hR}
Label.horizontalAlignmentMode = .center
Label.verticalAlignmentMode = .center
Label.fontColor = .systemBlue
Label.zPosition = 2
self.currentNode.addChild(Label)
self.currentNode.zPosition = self.currentNode.zPosition + 1
var nodes = self.nodes(at: self.positions[Square - (squares2move + 1)])
nodes = nodes.filter { $0.name != "Tile" }
nodes = nodes.filter { $0 != self.currentNode }
nodes = nodes.filter { $0 != self.currentNode.childNode(withName: "Label") }
for v in nodes {
v.removeFromParent()}
}
else {
let Lbl = self.currentNode.childNode(withName: "Label") as? SKLabelNode
Lbl!.text = "\(add)"
let numberofdigits = Lbl!.text!.count
if numberofdigits == 1 {
Lbl!.fontSize = 45 * self.hR}
if numberofdigits == 2 {
Lbl!.fontSize = 40 * self.hR}
if numberofdigits == 3 {
Lbl!.fontSize = 32 * self.hR}
if numberofdigits == 4 {
Lbl!.fontSize = 25 * self.hR}
self.currentNode.zPosition = self.currentNode.zPosition + 1
var nodes = self.nodes(at: self.positions[Square - (squares2move + 1)])
nodes = nodes.filter { $0.name != "Tile" }
nodes = nodes.filter { $0 != self.currentNode }
nodes = nodes.filter { $0 != self.currentNode.childNode(withName: "Label")
}
for v in nodes {
v.removeFromParent()}
}
self.moveinprogress = 0
})
}
}
func moveLeft() {
var duration = TimeInterval(0.1)
duration = Double(squares2move) * duration
self.soundEffect = "swipe"
self.playEffects(Volume: self.effectsVolume)
let move = SKAction.move(to: positions[Square - (squares2move + 1)], duration: duration)
currentNode.run(move, completion: {
self.tiles[Square - (squares2move + 1)].name = self.currentNode.name
self.tiles[Square - 1].name = ""
self.currentNode.position = self.positions[Square - (squares2move + 1)]
self.newNumber()
})
}
Topic:
Developer Tools & Services
SubTopic:
Xcode
We had a work card attached to our developer's account.
team ID 924RUYJZ34
dev ID 8771bf7b-31a9-4602-baae-02580fe5b6c4
Funds are debited from this card in other services, there are no problems with it, the amount in the account is sufficient.
Our membership subscription did not renew automatically. The applications are blocked. We can't renew our subscription, there's no Renew button anywhere.
There is no way to extend it on any device, web version, or anywhere else. We can't even cancel and re-arrange it, all the functions don't work.
Please help us, how can we renew our subscription?!
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
Subscriptions
Developer Program
I have a Unity application in which I'm implementing a GameCenter login with PlayFab. I fetch the items and use them in the PlayFab request, which returns me the error 'Authentication failed. Signature does not match the authentication request data'. I've reproduced the request using Insomnia with the same results. I have this exact same flow implemented in another application, which works normally.
I'm positive that the PlayFab verification is correct, and there's indeed an issue with the data being sent, but I can't find any information about this kind of situation anywhere, and I don't know how to either reproduce the verification myself, or how to inspect the data to check for issues.
I have reviewed my app's data on AppstoreConnect and have filled every form, document, and even its store page. I've also checked it's bundle identifier settings to make sure it had all the permissions necessary, which seems to be only GameCenter.
I fetch the authentication items through this code
try
{
Debug.Log("Fetching authentication items");
var fetchItemsResponse = await GKLocalPlayer.Local.FetchItems();
PlayFabGameCenterLogin(fetchItemsResponse);
}
catch (Exception ex)
{
Debug.Log("Error fetching authentication items: " + ex.Message);
OnLoginFailure();
}
Which is then sent to this method to start the login request
static void PlayFabGameCenterLogin(GKIdentityVerificationResponse authenticationItems)
{
var request = new LoginWithGameCenterRequest();
request.CreateAccount = true;
request.PlayerId = GKLocalPlayer.Local.GamePlayerId;
request.InfoRequestParameters = new GetPlayerCombinedInfoRequestParams
{
GetUserAccountInfo = true
};
if (authenticationItems != null)
{
request.PublicKeyUrl = authenticationItems.PublicKeyUrl;
request.Salt = Convert.ToBase64String(authenticationItems.GetSalt());
request.Signature = Convert.ToBase64String(authenticationItems.GetSignature());
request.Timestamp = authenticationItems.Timestamp.ToString();
}
else
Debug.Log("Playfab Login with no authentication items");
// Login
PlayFabClientAPI.LoginWithGameCenter(request, OnLoginSuccess, (e) =>
{
I'm on
Unity 2022.3.10f1
Apple.Core 3.1.3
Apple.GameKit 2.2.2
Xcode 16.2
I need information on what could be the cause of this, if it's a SDK issue, a lack of filling information somewhere, if it's some data compatibility issue (maybe data on the app that's not the same on the appstoreconnect or developer?), or if it's possible to verify the authentication data manually to investigate.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
GameKit
Games
App Store Connect API
Developer Program
The 'view' and 'modifier' were displayed on my particular project, but it is no longer displayed.
I don't know which shortcut key was hidden.
What should I do to display it again?
Topic:
Developer Tools & Services
SubTopic:
Xcode
I'm attempting to create a proof of concept of a static library, distributed as an XCFramework, which has two local XCFramework dependencies.
The reason for this is because I'm working to provide a single statically linked library to a customer, instead of providing them with the static library plus the two dependencies.
The Issue
With a fairly simple example project, I'm not able to access any code from the static library without the complier throwing a "No such module" error and saying that it cannot find one of the dependent modules.
Project Layout
I have an example project that has some example targets with basic example code.
Example Project on Github
Target: FrameworkA
Mach-0 Type: Dynamic
Build Mergable Library: Yes
Skip Install: No
Build Libraries For Distribution: Yes
Target: FrameworkB
Mach-0 Type: Dynamic
Build Mergable Library: Yes
Skip Install: No
Build Libraries For Distribution: Yes
XCFrameworks are being generated from these two targets using Apple's recommendations. I've verified that the mergable metadata is present in both framework's Info.plist files.
Each exposes a single struct which will return an example String.
Finally I have my SDK target:
Target: ExampleKit
Mach-0 Type: Static
Build Mergable Library: No
Create Merged Binary: Manual
Skip Install: No
Build Libraries For Distribution: Yes
The two .xcframework files are in the Target's folder structure as well. The "Link Binary With Libraries" build phase includes them and they're Required.
Inside of the ExampleKit target, I have a single public struct which has two static properties which return the example strings from FrameworkA and FrameworkB.
I then have another script which generates an XCFramework from this target.
Expectations
Based on Apple's documentation and the "Meet Mergable Libraries" WWDC session I would expect that I could make a simple iOS app, link the ExampleKit.xcframework, import ExampleKit inside of a file, and be able to access the single public struct present in ExampleKit. Unfortunately, all I get is "No such module FrameworkA".
I would expect that FrameworkA and FrameworkB would have been merged into ExampleKit? I'm really unsure of where to go from here in debugging this. And more importantly, is this even a possible thing to do?
I tried to monitor the device's network status with Network framework code below.
let networkMonitor = NWPathMonitor(requiredInterfaceType: .cellular)
networkMonitor.pathUpdateHandler = { [weak self] path in
if path.status == .satisfied {
print("Cellular Satisfied")
} else {
print("Cellular Unsatisfied")
}
}
When I run the app in my iPhone(iOS 15.5) and turn cellular on/off, iPhone suddenly loses connection with XCode.
Lost connection to the debugger on “...'s iPhone”.
Domain: IDEDebugSessionErrorDomain
Code: 12
Recovery Suggestion: Restore the connection to “...'s iPhone” and run “...” again, or if “...” is still running, you can attach to it by selecting Debug > Attach to Process > ....
User Info: {
DVTErrorCreationDateKey = "2022-06-23 02:16:30 +0000";
IDERunOperationFailingWorker = DBGLLDBLauncher;
}
Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
"device_model" = "iPhone13,2";
"device_osBuild" = "15.5 (19F77)";
"device_platform" = "com.apple.platform.iphoneos";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 2;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 5861;
"operation_errorCode" = 12;
"operation_errorDomain" = IDEDebugSessionErrorDomain;
"operation_errorWorker" = DBGLLDBLauncher;
"operation_name" = IDEiPhoneRunOperationWorkerGroup;
"param_consoleMode" = 0;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 5;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.iphoneos";
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 0;
"param_launcher_substyle" = 0;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_runnable_swiftVersion" = "5.6";
"param_runnable_type" = 2;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphoneos15.4";
"sdk_osVersion" = "15.4";
"sdk_variant" = iphoneos;
}
In my opinion, it seems like an error of XCode. Plz let me know if there's any solution.
Also, there's a similar issue here : https://developer.apple.com/forums/thread/681459
Have been trying to enroll in the Apple developer program, but every time after filling out all the forms and agreeing to the agreements, I'm being prompted with, "We are unable to process your request" repeatedly.
I wanted to know what is the issue and how to fix it so I can properly enroll in the developer program
Hello,
I recently received feedback from two users that they charged twice after entering their password when trying to initiate payment on the app. I checked my front-end and back-end codes, both of which only initiate one order, but I don't know why the user deducts two payments after entering the password.
I hope everyone can help me analyze this problem and how it came about?
Additionally, I wonder if there is a possibility that the system may prompt the user to enter their password again due to network issues, resulting in the deduction of two payments. But the user told us that they only entered the password once (I don't know if the user lied).
I am unable to find how the problem arose. I hope you can help me analyze how to solve this problem?
If you also encounter such a problem, can you teach me how to solve it?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
StoreKit
App Store Connect
In-App Purchase
Apple Pay
use https://api.development.push.apple.com/3/device/98bf6345fc85248dd74eb8a1ac2d18150b5e4299efe5229dd52de7f1c154a33d Push notification was successful, but the phone did not receive the message. What is the reason?
In Xcode Version 16.2 (16C5032a) - and previous versions too, the download container in the Devices & Simulators functionality no longer works.
It will start downloading the container, however it will also:
show NO download progress
fail to download the whole container (the downloaded container is missing whole directories, eg. AppData/Library is missing - where my application stores the CoreData db)
show no errors
This was tested with the XCode version stated above (and previous versions) and with iPhone XR (18.1.1 - MR42CN/A) and with iPad (17.7.2 - MR7F2FD/A).
How can I debug this issue / make the Xcode download the whole container?
Running on Mac mini 15.1.1 (24B91).
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hi.
I have a xcframework that has a dependency on 'RxSwift' and 'RxCocoa'. I deployed it using SPM by embedding it in a Swift Package.
However when I import swift package into another project, I keep getting the following error:
"Missing required module 'RxCocoaRuntime"
How can I fix this?
Below are the steps to reproduce the error.
Steps
Create Xcode proejct, make a dependency on 'RxSwift' and 'RxCocoa' (no matter doing it through tuist or cocoapods)
Create XCFramework from that proejct. (I used commands below)
xcodebuild archive \
-workspace SimpleFramework.xcworkspace \
-scheme "SimpleFramework" \
-destination "generic/platform=iOS" \
-archivePath "./SimpleFramework-iphoneos.xcarchive" \
-sdk iphoneos \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive \
-workspace SimpleFramework.xcworkspace \
-scheme "SimpleFramework" \
-archivePath "./SimpleFramework-iphonesimulator.xcarchive" \
-sdk "iphonesimulator" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild -create-xcframework \
-framework "./SimpleFramework-iphoneos.xcarchive/Products/Library/Frameworks/SimpleFramework.framework" \
-framework "./SimpleFramework-iphonesimulator.xcarchive/Products/Library/Frameworks/SimpleFramework.framework" \
-output "./SimpleFramework.xcframework"
Embed in Swift Package, and deploy.
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "SimplePackage",
platforms: [.iOS(.v16)],
products: [
.library(
name: "SimplePackage",
targets: ["SimplePackage"]),
],
dependencies: [
.package(url: "https://github.com/ReactiveX/RxSwift", from: "6.8.0")
],
targets: [
.binaryTarget(
name: "SimpleFramework",
path: "Sources/SimpleFramework.xcframework"
),
.target(
name: "SimplePackage",
dependencies: [
"SimpleFramework",
"RxSwift",
.product(name: "RxCocoa", package: "RxSwift")
]
)
]
)
Download Swift Package in another project and import module.
I resolved this by removing dependencies from the Swift Package, downloading package in another project, and fetching dependencies by cocoapods.
Thist works, but I don't want to use another dependency manager while using SPM.
Development Environment
CPU : Apple M4 Max
MacOS : Sequoia 15.3
Xcode : 16.2
I developed my app on xcode, and it builds fine for xcode on simulator. However, when I transferred the swiftpm file to my ipad, the playground failed to build with only the error message "Build failed", while preview on playgrounds works fine.
I am not sure what the cause of the error is, if anyone has any tips that would be greatly appreciated. Thank you.
I recently purchased an Apple Developer Account on March 01, 2025. Upon completing the purchase, I received a confirmation message stating that my account would be activated within 48 hours. However, it has now been more than ten days, and my account still remains inactive. I didn't recieve any further email regarding apple developer account enrollment.
Two days ago, I sent email and discuss my issue but still there is no response from apple team
what should I do?
I am converting a project to expo and have created a new expo project. I have migrated most of the react-native code but need to add a native module. I added it using npx create-expo-module expo-settings --local
The name of the module DataRetrieval.
So far so good but I need a package SwiftCSV. I added it as a dependency to Pods and did a npx pod-install but when I try to import SwiftCSV as a subproject, it is not found. So I tried adding to the DataRetrieval podspec an s.dependency 'SwiftCSV'. I then get an error that there is a redefining of symbols. I am able to include this in a regular Swift file but not in the sub-module under expo. What am I missing about how to not only add a native module but to add dependencies and include it in my project?
Thanks,
Ray
Topic:
Developer Tools & Services
SubTopic:
General
Hi All,
I have an App on AppStore, recently the minimum supported version of the app was changed from iOS 12 to iOS 14.
Post that the TestFlight builds are crashing on launch.
If we revert the minimum supported iOS version to 12, the crash no longer happens.
This project is using cocoapods, and from the crash logs it seems the issue with with PLCrashReporter framework.
"EXC_CRASH" Termination reason: DYLD 9 weak-def symbol not found '__ZN7plcrash3PL_5async15dwarf_cfa_stateljiE10push_stateEv'.
This issue is happening only on TestFlight builds where the minimum supported version is 14.0
Any pointer to a solution is welcome.
I am currently developing a No-Sandbox application.
What I want to achieve is to use AuthorizationCopyRights in a No-Sandbox application to elevate to root, then register SMAppService.daemon after elevation, and finally call the registered daemon from within the No-Sandbox application.
Implementation Details
Here is the Plist that I am registering with SMAppService:
<?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>com.example.agent</string>
<key>BundleProgram</key>
<string>/usr/local/bin/test</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/test</string>
<string>login</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Code that successfully performs privilege escalation (a helper tool popup appears)
private func registerSMAppServiceDaemon() -> Bool {
let service = SMAppService.daemon(plistName: "com.example.plist")
do {
try service.register()
print("Successfully registered \(service)")
return true
} catch {
print("Unable to register \(error)")
return false
}
}
private func levelUpRoot() -> Bool {
var authRef: AuthorizationRef?
let status = AuthorizationCreate(nil, nil, [], &authRef)
if status != errAuthorizationSuccess {
return false
}
let rightName = kSMRightBlessPrivilegedHelper
return rightName.withCString { cStringName -> Bool in
var authItem = AuthorizationItem(
name: cStringName,
valueLength: 0,
value: nil,
flags: 0
)
return withUnsafeMutablePointer(to: &authItem) { authItemPointer -> Bool in
var authRights = AuthorizationRights(count: 1, items: authItemPointer)
let authFlags: AuthorizationFlags = [.interactionAllowed, .preAuthorize, .extendRights]
let status = AuthorizationCopyRights(authRef!, &authRights, nil, authFlags, nil)
if status == errAuthorizationSuccess {
if !registerSMAppServiceDaemon() {
return false
}
return true
}
return false
}
}
}
Error Details
Unable to register Error Domain=SMAppServiceErrorDomain Code=1 "Operation not permitted" UserInfo={NSLocalizedFailureReason=Operation not permitted}
The likely cause of this error is that /usr/local/bin/test is being bundled.
However, based on my understanding, since this is a non-sandboxed application, the binary should be accessible as long as it is run as root.
Trying
post as mentioned in the response, placing the test binary under Contents/Resources/ allows SMAppService to successfully register it. However, executing the binary results in a different error.
Here is the plist at that time.
<?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>com.example.agent</string>
<key>BundleProgram</key>
<string>Contents/Resources/test</string>
<key>ProgramArguments</key>
<array>
<string>Contents/Resources/test</string>
<string>login</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Here is the function at that time.
private func executeBin() {
let bundle = Bundle.main
if let binaryPath = bundle.path(forResource: "test", ofType: nil) {
print(binaryPath)
let task = Process()
task.executableURL = URL(fileURLWithPath: binaryPath)
task.arguments = ["login"]
let pipe = Pipe()
task.standardOutput = pipe
task.standardError = pipe
do {
try task.run()
let outputData = pipe.fileHandleForReading.readDataToEndOfFile()
if let output = String(data: outputData, encoding: .utf8) {
print("Binary output: \(output)")
}
task.waitUntilExit()
if task.terminationStatus == 0 {
print("Binary executed successfully")
} else {
print("Binary execution failed with status: \(task.terminationStatus)")
}
} catch {
print("Error executing binary: \(error)")
}
} else {
print("Binary not found in the app bundle")
}
}
Executed After Error
Binary output:
Binary execution failed with status: 5
Are there any other ways to execute a specific binary as root when using AuthorizationCopyRights?
For example, by preparing a Helper Tool?
Context:
I recently encountered an issue while trying to enroll in the Apple Developer Program with my personal Apple ID, and I need guidance on how to resolve it.
A few months ago, I helped a client set up an Apple Developer account because they didn’t have an iPhone, Mac, or even an Apple ID. To assist them, I created an Apple ID for them and used my iPhone (via the Apple Developer app) to enroll their account in the Apple Developer Program.
Now that the project is complete, I have removed myself from their Apple Developer account and given them full control over the app. However, when I tried to enroll my personal Apple ID in the Developer Program, I was unable to do so. After contacting Apple Support, I was informed that my phone number is still recognized as the trusted device for my client’s Apple ID, preventing me from enrolling in the Developer Program under my own account.
Additional Issues:
When I checked my Apple ID subscription list on account.apple.com, I noticed that the Apple Developer Program Membership is still listed under my personal Apple ID. However, when my client logs into their Apple ID subscription list, the Apple Developer subscription does NOT appear under their account.
Even though the Apple Developer Program subscription is listed under my Apple ID, I cannot access the Apple Developer portal (developer.apple.com/account) to manage my account, enroll, or create apps.
However, my client CAN still access the Developer portal and create/manage apps, even though the subscription is NOT in their Apple ID subscription list.
Problems:
My phone number is still a trusted device for my client’s Apple ID, blocking me from enrolling my own Developer account.
The Developer Program subscription appears under my Apple ID instead of my client’s, even though my client is the one using the Developer account.
I cannot access Apple Developer features, while my client can—even though the subscription is technically under my Apple ID.
Questions:
How can I unlink my phone number and device from my client’s Apple ID so I can enroll in the Apple Developer Program?
Why does the Developer Program subscription appear under my Apple ID instead of my client’s, and how can I fix this?
Why can’t I access the Developer portal, even though the subscription is listed under my Apple ID?
Has anyone faced a similar issue, and if so, how was it resolved?
Any advice or guidance would be greatly appreciated! Thanks in advance.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program