Quick update : I have asked for an update on the original issue FB7786750. Apple has all the sys diag they've asked for and how to reproduce this issue (with their own sample).
I appreciate the initial effort - https://developer.apple.com/forums/thread/651533?answerId=616505022#616505022 but it's been 3 months since then and there's apparently no communication on this topic.
Post
Replies
Boosts
Views
Activity
After reading this answer - https://stackoverflow.com/a/55269607, it seems that's the correct behavior and the traces for a scheme's run script won't appear in the Build logs of a project inside Xcode (and rather in stdErr).
However I still can get the same result for a Swift package build (maybe . So my original question still stands : how do you add a build script for a Swift package (for things like SwiftLint, Sourcery, etc.) ?
Using a simple script with an echo command, I confirmed (what I already knew!) that, for the same project :
a target's "Build Phases" run script gets triggered (i.e. normal behavior)
a scheme's "Build Pre-actions" (or Post-actions) run script will NOT be triggered
Type a script or drag a script file from your workspace to insert its path.
echo "warning: RUN SCRIPT in ACTION"
For the target's "Build Phases" run script I see the following in the Build Report Navigator (i.e. I know the script is running) :
Showing Recent Messages
...
write-file /somepath/CoreLocation-Redux-deixbbxleyyndwgicetkzwybusoj/Build/Intermediates.noindex/CoreLocation-Redux.build/Debug-iphoneos/CoreLocation-Redux\ \(iOS\).build/Script-8E1070E4252F51F600F35D59.sh
PhaseScriptExecution Run\ Script /somepath/CoreLocation-Redux-deixbbxleyyndwgicetkzwybusoj/Build/Intermediates.noindex/CoreLocation-Redux.build/Debug-iphoneos/CoreLocation-Redux\ (iOS).build/Script-8E1070E4252F51F600F35D59.sh (in target 'CoreLocation-Redux (iOS)' from project 'CoreLocation-Redux')
.....
/bin/sh -c /somepath/CoreLocation-Redux-deixbbxleyyndwgicetkzwybusoj/Build/Intermediates.noindex/CoreLocation-Redux.build/Debug-iphoneos/CoreLocation-Redux\\\ \\\(iOS\\\).build/Script-8E1070E4252F51F600F35D59.sh
warning: RUN SCRIPT in ACTION
There's nothing for the scheme's pre or post actions run scripts. Bug ?
This is for :
Xcode version 12.2 beta 2 (12B5025f) macOS Catalina version 10.15.7 (19H2)
This is a major blocker for any sort of development using "Sign In With Apple". An update would be really appreciated on FB7786750. Thanks.
Thanks for the response.
Unfortunately, it doesn't : "Compiling failed : circular reference".
I even tried to replace all the 'View' references with 'SwiftUI.View', but that brought me back to the previous error.
I guess I am gonna have to rename my module... Luckily that's something I can control.
Also submitted FB7875260 to address the related issues that @KINGandKONG highlighted in one of the replies.
Did another test with Xcode 12 beta 2 :
Xcode Version 12.0 beta 2 (12A6163b)
Simulator Version 12.0 (940.9.1)
SimulatorKit 597.8
CoreSimulator 725.10 Same issue
Sure. Here's the FB number : FB7786750. I have attached the requested files to the issue.
As mentioned, you can use the "Juice" app - https://developer.apple.com/documentation/authenticationservices/implementing_user_authentication_with_sign_in_with_apple, run it in the simulator with Xcode 12 Beta.
From experimenting with "Sign In With Apple" :Error Code -7030 is usually provided if there are no valid credential provided (like an empty string). And this will result in the completion block of `getCredentialState(forUserID:)` returning an error and a `.notFound`However the simulators seems to have a bug where they will always return -7001 whether you provide a valid identifier or not. So I wouldn't rely on them just yet for debugging.
Also filed FB7499453 since there's been no traction on this.
After a little digging, I created an account on my MacBook for this Sandbox test user and configured 2FA once I logged in. This allowed me to have 2FA turned on in the simulator.I can now use "Sign In With Apple" for this sandbox user.So to summarize the steps : 1) create sandbox user in App Store Connect2) go to icloud.com to accept the "Terms & Conditions"3) create a local account on your Mac (or if you have a spare phone, you can probably do step 4 via the phone) and use that sandbox ID when asked about the Apple ID.4) from your local account, on the Mac, configure 2FA (turn it on) in : System Preferences -> Apple ID -> Password & Security (use a valid phone number to receive text messages)5) go back to your regular account and, from Xcode, start the simulator and configure the Apple ID as that sanbox user's ID. The 2FA setting should show that it's turned on.At that point you should be able to use "Sign In With Apple ID" from within the simulator. It's pretty tedious, but it works for me.
What issues are you having with the sandbox test users ?I can create them and log them in to the simulator devices (using their iCloud accounts). Unfortunately it seems that "Sign In With Apple" is requiring 2-factor authorization to be turned on and I haven't managed to do that with a sandbox test account.Wish Apple Support would have a doc on testing "Sign In With Apple" using sandbox accounts. This is just not functional enough at this point to even do simple beta testing...