Has anyone else run into this and found a workaround? Xcode 13b1, 3, and 4 are unable to prepare my device for development after I updated it today to 14.7.1. Xcode 12.5.1 is able to.
After churning for several minutes, it always ends up saying
Failed to prepare device for development.
I've rebooted the device and my Mac a few times each now.
There's at least one other report of this issue:
https://stackoverflow.com/questions/68549513/xcode-doesn-t-support-phone-s-ios-14-7-1
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I just got an M1 MacBook Pro. I'm trying to build one of my macOS projects for Apple Silicon, but it only gives me "My Mac (Rosetta)" as a run destination (or "Any Mac (Intel)"), even though I've set the build archs to universal.
Googling is no help.
My app has a utility window that can live anywhere on screen, including over the menu bar, or in the top region of a screen with a notch when the main screen is not the built-in display.
If I drag the window into these areas, it sits there just fine. I have drag handlers in a subclass of NSWindow that call -setFrame: (yeah, this is Obj-C code).
If the screen gets reconfigured, my code tries to remember where the window was, and calls -setFrame: to put it back there. But in this case, macOS moves my window down out of the menu bar/notch area at the top of the screen.
Is there any way to prevent this behavior?
Is there a way I can set my own app to be the default web browser on macOS? The System Preferences->General UI for choosing the default web browser doesn't have an obvious way to set an arbitrary app. Is there a way to configure my app so that macOS recognizes it as an option for this list?
How do I handle URLs in a SwiftUI app? The only thing I can find is to put onOpenURL in my App's WindowGroup view content, but that makes a new window for every URL that gets handled.
We have some HTML content embedded in our app. These live in two top-level folders. These folders have been localized, and so live in Resources/en.lproj/HelpContent and Resources/fr.lproj/HelpContent (for example). Similarly, we have a bunch of localized .storyboard files.Xcode 8 builds this just fine. Xcode 9b6 complains:duplicate output file
'/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent' on task: CpResource
/Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp
/Resources/fr.lproj/HelpContent
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent (in target 'MyApp')unable to build node:
'/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent' (node is produced by multiple commands; e.g.,
'b1132708c20f997e752faabcee01d49c82a500833121dcd848c3954357d9f7b1:
CpResource
/Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp
/Resources/en.lproj/HelpContent
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent' and
'b1132708c20f997e752faabcee01d49c82a500833121dcd848c3954357d9f7b1:
CpResource
/Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp
/Resources/fr.lproj/HelpContent
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-
fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/
HelpContent')The Files & Groups list shows it correctly (e.g. "HelpContent" with "HelpContent (English)" and "HelpContent (French)" as sub-folders. The folders only show up once in the Copy Bundle Resources phase.But the build stops almost immediately on this error.
In this talk , at 12:00, the speaker refers to code associated with this talk. But I can't find it anywhere.
Is it available?
altool seemed to be working correctly, but then failed after upload finished:
$ xcrun altool --upload-package ../exports/OurApp.ipa --type ios --apple-id <apple-id> --bundle-id <bundle-id> --bundle-version 291 --bundle-short-version-string "3.1.5" --apiKey <api-key> --apiIssuer <issuer> --show-progress
Getting list of providers...
Beginning delivery...
Analyzing package…
Requesting app information…
Requesting asset description upload id…
Sending analysis to the App Store…
Waiting for response…
Requesting upload instructions from the App Store…
Preparing to upload package to the App Store…
Uploading package to the App Store…
**status code 401, auth issue.
*** Error: *** status code 401, auth issue.
*** Error: Error uploading '../exports/OurApp.ipa'.
*** Error: Unable to authenticate. (-19209)
Note that --list-providers seems to work just fine with the same credentials:
$ xcrun altool --list-providers --apiKey <key> --apiIssuer <issuer>
Getting list of providers...
ProviderName ProviderShortname PublicID WWDRTeamID
------------ ----------------- ------------------------------------ ----------
Whatnot Inc. <redacted> <redacted> <redacted>
@eskimo?
I've developed a specialized web server in Swift using Vapor. I want to set it up to run reliably on macOS using a LaunchDaemon. It should start at boot and be restarted if it crashes. I'm having trouble finding a good guide to the latest flavor of launchctl, and how to use system domains.
This is my 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>Debug</key>
<true/>
<key>Label</key>
<string>com.latencyzero.FurnaceController</string>
<key>Program</key>
<string>/Users/rmann/Desktop/Run</string>
<key>ProgramArguments</key>
<array>
<string>serve</string>
<string>--hostname</string>
<string>0.0.0.0</string>
<string>--port</string>
<string>80</string>
</array>
<key>KeepAlive</key>
<true/>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>http</string>
<key>SockType</key>
<string>tcp</string>
<key>SockFamily</key>
<string>IPv4</string>
</dict>
</dict>
</plist>
And I'm trying to invoke it like this:
$ sudo enable system/com.latencyzero.FurnaceController
But nothing happens. If I try kickstart, I get an error:
$ sudo launchctl kickstart -p system/com.latencyzero.FurnaceController
Could not find service "com.latencyzero.FurnaceController" in domain for system
$ sudo launchctl kickstart -p uid/501/com.latencyzero.FurnaceController
Unrecognized target specifier.
Usage: launchctl kickstart [-k] [-p] <service-target>
-k Terminates the service if it is already running.
-p Prints the PID of the service that was started.
-s Starts the service suspended so that a debugger may attach.
<service-target> takes a form of <domain-target>/<service-id>.
Please refer to `man launchctl` for explanation of the <domain-target> specifiers.
Bootstrap also doesn't work as I'd expect:
$ sudo launchctl bootstrap system/com.latencyzero.FurnaceController
Usage: launchctl bootstrap <domain-target> [service-path, service-path2, ...]
<service-target> takes a form of <domain-target>/<service-id>.
Please refer to `man launchctl` for explanation of the <domain-target> specifiers.
The plist is in /Library/LaunchDaemons/com.latencyzero.FurnaceController.plist
I'd rather not have to launch this in a user domain, as I'm handing this app off to my client, and the fewer customization needed, the better.
I've got a Game @StateObject in my app that's passed to my main ContentView. I'm trying to figure out how best create a SCNSceneRendererDelegate instance that has a reference to the Game state, and then pass that to the SceneView inside my ContentView.
I'm trying to do it like this, but obviously this doesn't work because self isn't available at init time:
struct
ContentView : View
{
let game : Game
var scene = SCNScene(named: "art.scnassets/ship.scn")
var cameraNode : SCNNode? { self.scene?.rootNode.childNode(withName: "camera", recursively: false) }
var rendererDelegate = RendererDelegate(game: self.game) // Cannot find 'self' in scope
var
body: some View
{
SceneView(scene: self.scene,
pointOfView: self.cameraNode,
delegate: self.rendererDelegate)
}
}
The intent is that in my renderer delegate, I'll update my game's simulation state. Because my game state is an ObservableObject, everything else (I have a bunch of SwiftUI) should update.
The Xcode console logs an identifier indicating the current thread that's running when a message is print()ed from Swift. Some more complex logging systems (e.g. swift-log and console-kit) don't provide that information, and I'm trying to write a logging back-end for swift-log that will.
Thing is, I don't see any way to get the current queue name in Swift. I tried
dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)
But I get "cannot convert value of type '()' to expected argument type 'DispatchQueue?'". Passing nil instead results in "'dispatch_queue_get_label' has been replaced by property 'DispatchQueue.label'".
This is not an unreasonable thing to want to do, and it poses no safety concerns.
I'm not sure why, but it seems my Xcode project is trying to build for x86 (on my M1 Mac), even though both Debug and Release configurations have ONLY_ACTIVE_ARCH = YES. It's clearly trying to build for x86, as evidenced by the -target x86_64-apple-macos13.0 in the invocation. But I can't figure out why.
The full link stage output:
Ld /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Products/Debug/MyProject.app/Contents/MacOS/MyProject normal (in target 'MyProject' from project 'MyProject')
cd /Users/me/Projects/MyProject
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos13.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -L/Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/EagerLinkingTBDs -L/Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Products/Debug -L/opt/homebrew/opt/llvm/lib -F/Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/EagerLinkingTBDs -F/Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Products/Debug -filelist /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/MyProject.build/Debug/MyProject.build/Objects-normal/x86_64/MyProject.LinkFileList -dead_strip -Xlinker -object_path_lto -Xlinker /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/MyProject.build/Debug/MyProject.build/Objects-normal/x86_64/MyProject_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -framework Cocoa -lcurses -lLLVMAnalysis -lLLVMBitReader -lLLVMCodeGen -lLLVMCore -lLLVMExecutionEngine -lLLVMMC -lLLVMObject -lLLVMRuntimeDyld -lLLVMScalarOpts -lLLVMSelectionDAG -lLLVMSupport -lLLVMTarget -lLLVMTransformUtils -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lz -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/MyProject.build/Debug/MyProject.build/Objects-normal/x86_64/MyProject_dependency_info.dat -o /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Products/Debug/MyProject.app/Contents/MacOS/MyProject
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMAnalysis.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMBitReader.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMCore.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMExecutionEngine.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMCodeGen.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMMC.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMRuntimeDyld.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMObject.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMX86Info.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMTarget.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMSupport.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMScalarOpts.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMSelectionDAG.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMTransformUtils.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMX86CodeGen.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMX86Desc.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: in '/opt/homebrew/opt/llvm/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I change the ARCHS to just arm64, then it builds fine.
When stepping through code in the Xcode debugger, hovering over a variable in the context causes a little popover to appear, displaying the value of that variable.
Is there any way to disable this behavior? I find it gets in the way and I never use it.
I have a SwiftUI app made up of two types of window. If I hold the option key while clicking in the close box of one window, it closes all the app windows.
I want to change that behavior to just close all the windows of a particular type (or use any other criteria, for that matter). Is this even possible?
I'm using Settings to implement the preferences in macOS, with a TabView. Runs fine, but in Xcode preview, it renders the buttons differently. Clearly Settings is applying some kind of button style (or TabView knows it needs to change), but how can I get this to work in a preview? I can't preview Settings directly.