Hi,
I'm working in unity and I've implemented Firebase Phone Number Authentication in it. Everything works fine when I directly install build from xCode. App Attest screen shows up, user receives OTP on their phone and login works. But when I download the same build from TestFlight, it gets stuck after the user sends OTP request.
I've added Push Notifications and App Attest in capabilities. I've also additionally added Remote Notifications.
In device log I see an error about mobile provisioning file but I've added that to my account also. Is this expected behavior that phone number authentication does not work on TestFlight? If yes, how can I get this approved from apple since they need to test it before approving it.
Thanks!
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am using ARKit with RealityKit to scan objects using LiDAR on iOS. I can generate an OBJ file from ARMeshAnchors, but I am missing the texture export (JPG + MTL).
What I Have So Far:
Successfully capturing mesh using ARMeshAnchor.
Converting mesh into MDLAsset and exporting .obj.
I need help generating the .jpg texture and linking it to the .mtl file.
private func exportScannedObject() {
guard
let camera = arView.session.currentFrame?.camera
else { return }
func convertToAsset(meshAnchors: [ARMeshAnchor]) -> MDLAsset? {
guard let device = MTLCreateSystemDefaultDevice() else {return nil}
let asset = MDLAsset()
for anchor in meshAnchors {
let mdlMesh = anchor.geometry.toMDLMesh(device: device, camera: camera, modelMatrix: anchor.transform)
// Apply a gray material to the mesh
let material = MDLMaterial(name: "GrayMaterial", scatteringFunction: MDLScatteringFunction())
material.setProperty(MDLMaterialProperty(name: "baseColor", semantic: .baseColor, float3: SIMD3(0.5, 0.5, 0.5))) // Gray color
if let submeshes = mdlMesh.submeshes as? [MDLSubmesh] {
for submesh in submeshes {
submesh.material = material
}
}
asset.add(mdlMesh)
}
return asset
}
func export(asset: MDLAsset) throws -> URL {
let directory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
let url = directory.appendingPathComponent("scaned.obj")
if MDLAsset.canExportFileExtension("obj") {
do {
try asset.export(to: url)
return url
} catch let error {
fatalError(error.localizedDescription)
}
} else {
fatalError("Can't export USD")
}
}
if let meshAnchors = arView.session.currentFrame?.anchors.compactMap({ $0 as? ARMeshAnchor }),
let asset = convertToAsset(meshAnchors: meshAnchors) {
do {
let url = try export(asset: asset)
showScanPreview(url)
} catch {
print("export error")
}
}
}
extension ARMeshGeometry {
func vertex(at index: UInt32) -> SIMD3<Float> {
assert(vertices.format == MTLVertexFormat.float3, "Expected three floats (twelve bytes) per vertex.")
let vertexPointer = vertices.buffer.contents().advanced(by: vertices.offset + (vertices.stride * Int(index)))
let vertex = vertexPointer.assumingMemoryBound(to: SIMD3<Float>.self).pointee
return vertex
}
// helps from StackOverflow:
// https://stackoverflow.com/questions/61063571/arkit-3-5-how-to-export-obj-from-new-ipad-pro-with-lidar
func toMDLMesh(device: MTLDevice, camera: ARCamera, modelMatrix: simd_float4x4) -> MDLMesh {
func convertVertexLocalToWorld() {
let verticesPointer = vertices.buffer.contents()
for vertexIndex in 0..<vertices.count {
let vertex = self.vertex(at: UInt32(vertexIndex))
var vertexLocalTransform = matrix_identity_float4x4
vertexLocalTransform.columns.3 = SIMD4<Float>(x: vertex.x, y: vertex.y, z: vertex.z, w: 1)
let vertexWorldPosition = (modelMatrix * vertexLocalTransform).columns.3
let vertexOffset = vertices.offset + vertices.stride * vertexIndex
let componentStride = vertices.stride / 3
verticesPointer.storeBytes(of: vertexWorldPosition.x, toByteOffset: vertexOffset, as: Float.self)
verticesPointer.storeBytes(of: vertexWorldPosition.y, toByteOffset: vertexOffset + componentStride, as: Float.self)
verticesPointer.storeBytes(of: vertexWorldPosition.z, toByteOffset: vertexOffset + (2 * componentStride), as: Float.self)
}
}
convertVertexLocalToWorld()
let allocator = MTKMeshBufferAllocator(device: device);
let data = Data.init(bytes: vertices.buffer.contents(), count: vertices.stride * vertices.count);
let vertexBuffer = allocator.newBuffer(with: data, type: .vertex);
let indexData = Data.init(bytes: faces.buffer.contents(), count: faces.bytesPerIndex * faces.count * faces.indexCountPerPrimitive);
let indexBuffer = allocator.newBuffer(with: indexData, type: .index);
let submesh = MDLSubmesh(indexBuffer: indexBuffer,
indexCount: faces.count * faces.indexCountPerPrimitive,
indexType: .uInt32,
geometryType: .triangles,
material: nil);
let vertexDescriptor = MDLVertexDescriptor();
vertexDescriptor.attributes[0] = MDLVertexAttribute(name: MDLVertexAttributePosition,
format: .float3,
offset: 0,
bufferIndex: 0);
vertexDescriptor.layouts[0] = MDLVertexBufferLayout(stride: vertices.stride);
let mesh = MDLMesh(vertexBuffer: vertexBuffer,
vertexCount: vertices.count,
descriptor: vertexDescriptor,
submeshes: [submesh])
return mesh
}
}
What I Need Help With:
How do I generate the JPG texture from the AR scene?
How do I save an MTL file linking the OBJ model to the texture?
How can I correctly apply the texture when viewing the OBJ in an external 3D viewer?
I appreciate any guidance, including sample code or resources! If you have a complete working solution, I’d love to discuss further via private channels.
Dear Developers, I am having some problems with Reality Composer Pro on Mac. Specifically, I don't understand how to manage some timeline functions. I have an object that has a double animation, an opening animation and a closing animation. On a first tap the object should open through animation 1, while on the second tap the object should close through animation 2. Only the two animations conflict. In addition, animation 1 does not stop at the last frame but returns the object to the position of frame 0. Do you have any solutions? Thank you all
升级到 Xcode 16.2 后,无法打开项目。
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hello,
Now we support Apple applications and we are building applications on Mac laptops with regular updates. Our goal is to build an iOS app entirely through the command line using xcodebuild and other tools from Xcode Command Line Tools on a server with _macOS Sonoma (14.6.1) without a graphical user interface (only the command line)!!!
We need to build and regularly update iOS applications on clients and our accounts and we are looking for a solution to fully automate the login process for these accounts. Our goal is to automate these processes on a server without involving a customer.
Here’s what I need help with building and signing the app: What are the proper commands to build and sign the app using xcodebuild and put this application in Apple Store?
Server has:
xcode-select -version
xcode-select version 2408.
xcodebuild -version
Xcode 16.1 Build version 16B40.
In the first step, the certificates have been added to the keychain. We have two keychains. We can check it by running the command:
security list-keychains:
` "/Users/ec2-user/Library/Keychains/login.keychain-db"
"/Library/Keychains/System.keychain".`
All certificates are kept in login.keychain-db.
We can check it:
security find-identity -p codesigning -v
Answer is: `'Some hash "Apple Distribution: Name. (TEAM ID)"'.`
Profision file is kept in /Users/ec2-user/Library/MobileDevice/Provisioning\ Profiles/.
In the first step, we have added a cordova platform with iOS 11 version.
Command is:
cordova platform add ios.
We tried to create a sign archive with automation but we couldn't do it because we got an error.
Our command is
xcodebuild \ -workspace "path/to/Packet-name Test.xcworkspace" \
-scheme "Packet-name Test" \
-sdk iphoneos \
-configuration Release \
-archivePath "./Packet-name Test.xcarchive" \ CODE_SIGN_STYLE=Automatic \
DEVELOPMENT_TEAM=XXXXXXXXXX \
-allowProvisioningUpdates \
archive
We get errors:
/Users/ec2-user/buildApps/MyNewApplication/packet-name.test/platforms/ios/Packet-name Test.xcodeproj: error: No Accounts: Add a new account in Accounts settings. (in target 'Packet-name Test' from project 'Packet-name Test')
/Users/ec2-user/buildApps/MyNewApplication/packet-name.test/platforms/ios/Packet-name Test.xcodeproj: error: No profiles for 'packet-name.test' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'packet-name.test'. (in target 'Packet-name Test' from project 'Packet-name Test')
We've read about this error so the decision is to create one-time passwords for this. Certainly last error is about a problem with login, but how we can fix it we don't know because we will be using different accounts for different applications. As a result, we have to use one-time passwords for different accounts.
We would appreciate detailed instructions, example commands, and references to documentation that might address this workflow.
Topic:
Developer Tools & Services
SubTopic:
Xcode
I would like a shortcut for deleting view in swiftui
VStack {
// long code
}
How to delete VStack with its ending curly bracket?
Thanks
in xcode i have select the developer team. but show some error that is here,
"Communication with Apple failed
Your team has no devices from which to generate a provisioning profile. Connect a device to use or manually add device IDs in Certificates, Identifiers & Profiles. https://developer.apple.com/account/"
and show this error also
"No profiles for 'com.kuntaldoshi.homeautomation' were found
Xcode couldn't find any iOS App Development provisioning profiles matching 'com.kuntaldoshi.homeautomation'."
I have tried all of the above options, cleaned cached data, restarted several times, did not work.
The tunnel connection failed while the system tried to connect to the device.
Domain: com.apple.dt.RemotePairingError
Code: 4
System Information
macOS Version 15.2 (Build 24C101)
Xcode 16.2 (23507) (Build 16C5032a)
iOs 18.1.1
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.
I’m trying to use the Vision framework in a Swift Playground to perform face detection on an image. The following code works perfectly when I run it in a regular Xcode project, but in an App Playground, I get the error:
Thread 12: EXC_BREAKPOINT (code=1, subcode=0x10321c2a8)
Here's the code:
import SwiftUI
import Vision
struct ContentView: View {
var body: some View {
VStack {
Text("Face Detection")
.font(.largeTitle)
.padding()
Image("me")
.resizable()
.aspectRatio(contentMode: .fit)
.onAppear {
detectFace()
}
}
}
func detectFace() {
guard let cgImage = UIImage(named: "me")?.cgImage else { return }
let request = VNDetectFaceRectanglesRequest { request, error in
if let results = request.results as? [VNFaceObservation] {
print("Detected \(results.count) face(s).")
for face in results {
print("Bounding Box: \(face.boundingBox)")
}
} else {
print("No faces detected.")
}
}
let handler = VNImageRequestHandler(cgImage: cgImage, options: [:])
do {
try handler.perform([request]) // This line causes the error.
} catch {
print("Failed to perform Vision request: \(error)")
}
}
}
The error occurs on this line:
try handler.perform([request])
Details:
This code runs fine in a normal Xcode project (.xcodeproj).
I'm using an App Playground instead (.swiftpm).
The image is being included in the .xcassets folder.
Is there any way I can mitigate this issue? Please do not recommend switching to .xcodeproj, as I am making a submission for Apple's Swift Student Challenge, and they require that I use .swiftpm.
Hey,
I wanted to create a Mac-OS application. Normally I only code iPhone apps. But as soon as I want to display anything on the preview, it loads, just as normal, and then the throbber/progress indicator disappears and the preview canvas stays gray like it used to be before. I also don't get any error messages. Only one time after trying different things I got one message saying: "Could not launch Preview Shell." and "Could not create FBSOpenApplicationService." I also searched for a few solutions and tried some but none of them seemed to work. In the DiagnosticReports were some files of the time but I didn't seem to find anything helpful in there and they don't appear when I reopen my project or switch from PreviewMode "My Mac" to "iPhone 16 Pro".
When I launch the app on a simulator it works perfectly fine but this is quite annoying.
Thanks for trying to help me!
I'm trying to transfer a CSV file to my iPhone 16 simulator to use for testing my application, but it keeps failing. See the image below.
That occurs when I try to drag the file into the simulator. I also tried to use the Share option for the file, but nothing happens with that. It doesn't transfer but it also doesn't fail. I'm assuming it's failing in the background.
Anyone know what I can do?
Hi, I'm developing an app and after I change the app icon it's appear this error. Why?
Previously I noticed, and it still does, that in the app settings it does not keep the LauncScreen.storyboard. In the drop-down menu it appears but as soon as I change screen it loses it.
I don't know what to do....
Thanks!
Since dragImage: is deprecated I am trying to update drag and drop with beginDraggingSessionWithItems:.
Drag work fine but I cannot get drop to work correctly.
In the code below change #ifndef to #ifdef (using dragImage:) make drop work as expected.
draggingEntered, draggingUpdated, draggingExited, draggingEnded are all called but NOT performDragOperation (which do the drop).
Uncommenting the line
[pb_item pasteboard:paste_board provideDataForType:@"LN_PboardType"];
cause an exceptionPreprocess: -[NSPasteboardItem pasteboard:provideDataForType:]: unrecognized selector sent to instance 0x600001e64240.
I also try add NSDraggingDestination, NSItemProviderWriting, NSPasteboardTypeOwner to @interface line without success.
What I am doing wrong ?
Any other method to do Drag and Drop (other than dragImage: and beginDraggingSessionWithItems:) ?
Where can I found an Obj-C project using beginDraggingSessionWithItems: for drag an drop ?
``@interface Enclosure : NSView <NSDraggingSource, NSPasteboardItemDataProvider>
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
[super setAutoresizesSubviews:YES];
[self registerForDraggedTypes:[NSArray arrayWithObjects:@"LN_PboardType", NSPasteboardTypeString, nil]];
}
return self;
}
- (BOOL)acceptsFirstMouse:(NSEvent *)event
{
return YES;
}
- (void)mouseDown:(NSEvent *)drag_event
{
NSImage *drag_image;
NSPoint drag_position;
NSRect dragging_rect;
NSPasteboard *paste_board;
NSDraggingItem *drag_item;
NSArray *items_array;
NSPasteboardItem *pb_item;
paste_board = [NSPasteboard pasteboardWithName:@"LN_PboardType"];
[paste_board declareTypes:[NSArray arrayWithObjects:@"LN_PboardType", NSPasteboardTypeString, nil] owner:self];
pb_item = [[NSPasteboardItem alloc] init];
[pb_item setDataProvider:self forTypes:[NSArray arrayWithObjects:@"LN_PboardType", NSPasteboardTypeString, nil]];
// [pb_item pasteboard:paste_board provideDataForType:@"LN_PboardType"];
drag_image = [ [NSImage imageNamed:@"drag.jpg"];
drag_position = [self convertPoint:[drag_event locationInWindow] fromView:nil];
drag_position.x -= drag_image.size.width/2;
drag_position.y -= drag_image.size.height/2;
#ifndef DEPRECATED
[self dragImage:drag_image at:drag_position offset:NSZeroSize event:drag_event pasteboard:paste_board source:self slideBack:YES];
#else
drag_item = [[NSDraggingItem alloc] initWithPasteboardWriter:pb_item];
dragging_rect = NSMakeRect(drag_position.x, drag_position.y, drag_image.size.width, drag_image.size.height);
[drag_item setDraggingFrame:dragging_rect contents:drag_image];
items_array = [NSArray arrayWithObject:drag_item];
[self beginDraggingSessionWithItems:items_array event:drag_event source:(id)self];
#endif
}
- (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context
{
if (disable_drag_and_drop)
return NSDragOperationNone;
switch (context)
{
case NSDraggingContextWithinApplication:
return NSDragOperationCopy;
case NSDraggingContextOutsideApplication:
return NSDragOperationMove;
}
return NSDragOperationNone;
}
…``
Topic:
Developer Tools & Services
SubTopic:
Xcode
I am trying to test this simulated Error.
The issue is, I can't get this to trigger through the simulatedError function.
Error will always end up as an unknown error
Example code snippet:
@available(iOS 17.0, *)
func testPurchase_InvalidQuantity() async throws {
// Arrange
testSession.clearTransactions()
testSession.resetToDefaultState()
let productID = "consumable_1"
try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase)
guard let product = await fetchProduct(identifier: productID) else {
XCTFail("Failed to fetch test product")
return
}
let option = Product.PurchaseOption.quantity(4)
let result = await manager.purchase(product: product, options: option)
switch result {
case .success:
XCTFail("Expected failure due to invalid quantity")
case .failure(let error):
print("Received error: \(error.localizedDescription)")
switch error {
case .purchaseError(let purchaseError):
XCTAssertEqual(purchaseError.code, StoreKitPurchaseError.invalidQuantity.code)
default:
XCTFail("Unexpected error: \(error)")
}
}
}
In the above code snippet, I have an Unexpected Error.
But if i remove try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase) I will receive a XCTFail in the success of my result.
So when I set the quantity to a -1, only then can I correctly receive an invalidQuantity.
Does anyone know why the try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase) would fail to work as directed? I have tests for all the generic errors for loadProducts API and the simulatedError works great for them
Just this error is coming again and again I just updated the Xcode today.
Thanks
Zipzy Games
Despite Xcode being the one and most used IDE for iOS, it is far from perfect. I have used many tools in my career and here are some features, that would make it much better or what I miss from other IDEs. I encourage others to chip in discussion and lets all hope, Apple starts to improve Xcode. Will put each issue in separate comment below.
Slow debugger: not sure what bloat Xcode has or what it is doing, but sometimes it can take more than 10 seconds from breakpoint firing to actually see values. Moreover when debugging SwiftUI or something objC I have to drill down to see value of property or use po and p command and hope it works. SwiftUI views and states are a big pain to debug, to see what is changing a value I have to always use didSet trick or some other black magic. Is it too hard to make it easier? Breakpoints with condition can take up to 1 minute to load and I have M1 Max MBP. Just tried cursor IDE few days ago and breakpoints are much faster and without too much bloat in variable inspector.
Topic:
Developer Tools & Services
SubTopic:
Xcode
I’d really appreciate the solution inhaling Xcode in windows or another alternative that can access an iOS apps sandbox
Topic:
Developer Tools & Services
SubTopic:
Xcode
I have a M2 macbook pro Which has storage problem. I work with react native and xcode. So I was wondering If I can keep react native projects in external hard drive that could run in xcode and also work with git. ??
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hi,
I need to access my private and public key that i have on my iPhone in folder that i named Keys. Directory is located On My IPhone. How can i access this directory? How do I know its path?
Please help.
Topic:
Developer Tools & Services
SubTopic:
Xcode