I have static libraries and headers of a C++ project that I believe are correctly built for iOS and iOS Simulator destinations. The C++ project is built via CMake with something like:
cmake dirName \
-G "Unix Makefiles" \
-B buildDir \
-DCMAKE_INSTALL_PREFIX=installDir \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_SYSTEM_PROCESSOR=arm64 \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) \
-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0
...
cmake --build buildDir --config Release --target install
I believe those are all the important parameters. This gives me a static library (.a) and headers that I believe should be compatible with arm64 iOS simulators, and I do this same thing for x86_64 architecture with simulators and for actual iOS non-simulator via the iphoneos SDK path.
I'm pretty sure this gives me the correct static lib and headers. Let's assume it does because I'm not able actually create the XCFramework to know if they're right. This does work with a macOS lib and headers, but I need iOS for this library. How do I package this into an XCFramework now?
This Apple developer articles says I should be a able to create an xcframework via xcodebuild -create-xcframework -library libName.a -headers include but when I try to do this with my my iOS arm64 simulator static lib I get:
error: binaries with multiple platforms are not supported '/Users/.../install/ios-arm64-simulator/libName.a
But, when I run: lips -info libName.a I get Non-fat file libName.a is architecture arm64, so, I'm not sure what to do here. Trying to extract arm64 from that static library also produces an error as it it is just an arm64 lib.
I'm not really sure what's going on, but from reading online this specific command, xcodebuild -create-xcframework is a consistent pain point in the process of trying to get an XCFramework, and the seemingly only workaround is to archive a framework project and then create the xcframework via xcodebuild -create-xcframework -archive MyFramework.xcarchive -framework[or -library].
However, how am I supposed to get this static lib and headers into a suitable xcodeproj so that I can archive it correctly? Everytime I try to copy the headers and static lib into the Framework xcodeproj and set what I believe are all the correct settings, my .xcarchive is always empty.
Does anyone have any advice here on how to get this to work?
The main impetus for trying to get this C++ static lib and headers into an XCFramework as that seems like the only valid way to link a 3rd party C++ lib to an SPM package and have the C++ package be interfaceable with Swift.
General
RSS for tagDive into the vast array of tools and services available to developers.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi, We are seeing the below error in our angular application where we use the custom elements. Can you please help us to resolve the issue?
[Error] TypeError: new.target does not define a custom element.
The same code works fine in other browsers.
Topic:
Developer Tools & Services
SubTopic:
General
Is it even possible or part of VisionOS?
Thanks,
Colin
It used to work for me (a few months, maybe a year ago). Right now when I run it there is no output (even though I granted it Bluetooth Capture permissions and have working RFCOMM communication in my program).
Versions:
PacketLogger 2024.03.18 (2024.03.18d1)
Sequoia 15.4.1
M2 chip
I just noticed that when you check the online documentation for Foundation using the delicious Objective-C flavor, some values are no more the expected ones:
https://developer.apple.com/documentation/foundation/filemanager/copyitem(at:to:)?language=objc#return-value
true if the item was copied successfully or the file manager’s delegate stopped the operation deliberately. Returns false if an error occurred.
Considering that a BOOL used to be YES or NO for the last quarter of a century, I have the following question:
[Q] What is the idea behind the disturbing changes of the Objective-C documentation?
(Copy pasted from FB17261080 that I submitted)
Hi:
Apple's SDK (libSystem.B.tbd) provides definition for multiple symbols(__unw_add_dynamic_fde / __unw_add_find_dynamic_unwind_sections ), but doesn't provide corresponding headers, available in LLVM upstream as libunwind_ext.h
We need such headers to write Exception-Enabled JIT Framework for macOS
The project at hand is quite complex, and the link content is especially.
I suddenly saw this warning again in recent days and wanted to inquire about when this deletion would be done, so that our team could make preparations and plan in advance.
辅助功能 | Apple Developer Documentation
In the illustration on this page related to "Prefer system-defined colors," Light is incorrectly translated as "细体". However, in the context of this article, translating it as "浅色" (light color) would be a more appropriate choice.
I'm finding developing for HomeKit using the iOS Simulator utterly confounding.
All of my home's actual HomeKit accessories show up fine when I run the HomeKit app I'm developing on my actual phone. But none show up when I run my app in the iOS Simulator.
Maybe that's how it's supposed to be? I decided to run the HomeKit Accessory Simulator in an attempt to get something to show up in the iOS Simulator, but the accessories I've created there don't show up in the Simulator either.
How do I get devices to show up in the iOS Simulator?
Thanks.
How to add speech recognition in + capability in Xcode there is no "Speech Recognition" in the list.
Ive been working on android studio and have my app put together and was gonna start thr apple process and everything I read says I'll need a Mac to do it. Can someone either point me in the right direction or could I send my code over and someone compile my code for me?
Topic:
Developer Tools & Services
SubTopic:
General
This example fails to compile on Sequoia 15.4 with Xcode 16.3 and the command line tools installed;
jacquesmenu@macstudio:C++Tests > cat pcount_test.cpp
// clang++ -std=c++17 -o IntWrapperTest IntWrapperTest.cpp
#include // std::string
#include // std::cout
#include // std::ostringstream
int main1 (int argc, char* argv[])
{
std::string theString = "Prière d'éviter";
std::cout << theString << ", size(): " << theString.size () << std::endl;
std::stringstream oss;
oss << theString << std::endl;
std::cout << oss.str () << ", pcount(): " << oss.pcount () << std::endl;
}
//_______________________________________________________________________________
// position in output stream
#include // std::ofstream
int main () {
std::ofstream outfile;
outfile.open ("test.txt");
outfile.write ("This is an apple",16);
long pos = outfile.tellp();
outfile.seekp (pos-7);
outfile.write (" sam",4);
outfile.close();
return 0;
}
jacquesmenu@macstudio:C++Tests > clang++ pcount_test.cpp
pcount_test.cpp:3:10: fatal error: 'string' file not found
3 | #include // std::string
| ^~~~~~~~
1 error generated.
The same occurs with iostrem if it is the first include mentioned.
Compiling in Xcode itself does not this problem, though.
This include is to be found here:
jacquesmenu@macstudio:C++Tests > xcode-select -p
/Applications/Xcode.app/Contents/Developer
jacquesmenu@macstudio:C++Tests > ls -sal /Applications/Xcode.app/Contents/Developer/**/string | grep MacOSX
72 -rw-r--r-- 10 root wheel 203802 Mar 8 06:17 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string
I have a Swift package with a test suite that contains some tests implemented with Swift Testing. Locally, they run quickly, but when I run them on Semaphore CI (https://semaphore.io), the first Swift Testing test to execute incurs a performance penalty.
I'm running the tests with xcodebuild on iOS Simulator:
xcodebuild test \
-scheme "Scheme" \
-workspace Workspace.xcworkspace \
-destination "platform=iOS Simulator,name=iPhone 16,OS=18.2"
The scheme is configured to use a test plan that has parallelization disabled.
Here's an excerpt from the output showing what I'm seeing:
Test Suite 'All tests' started at 2025-04-03 07:47:37.328.
◇ Test run started.
↳ Testing Library Version: 102 (arm64-apple-ios13.0-simulator)
◇ Iteration 1 started.
◇ Suite <redacted> started.
◇ Test foo() started.
✔ Test foo() passed after 23.063 seconds.
When foo() is not the first test it runs in under 100 ms.
The reason that I have parallelization disabled is that I was initially seeing all of the tests in this suite incur a performance hit. But now it's clear that there must be some startup cost.
Things I'm wondering:
What is this startup penalty?
Why don't I encounter it locally?
Why is it attributed to the first test? (this seems like a bug)
My wild guesses around 1 so far have been…
maybe some simulator clone is booting. I've tried to rule that out by disabling parallelization, but maybe there's still something there.
maybe swift testing is getting loaded lazily and there's some kind of dynamic linking cost
Thoughts on 2…
maybe there's some one-time penalty when using swift testing that I've already incurred locally but that has not yet been incurred in the CI image
Guidance welcome!
x-posted:
FB17102970 (Unexpected performance penalty attributed to first Swift Testing test)
https://forums.swift.org/t/first-swifttesting-test-always-slow/79066
When you have a mac, creating xcprivacy is pretty straightforward for your app, you simply use xcode, then select the sdks and target them and your privacy manifest is ready.
In the other hand, when you are using CI/CD solutions you might not use xcode direclty.
In that instance and if you are coding in flutter, you need to create your privacy manifest by hand.
I would like guidance how to write that file, I would it for a given third party SDK and where to put that file in the flutter project (just to be sure)
For example we choose the most important third party SDK manifest: FUTTER framework.
I keep getting errors about it for my app, got alot of builds get the INVALID BINARY error because of that, and my mails indicating me a problem with the manifest.
Please show me the source code of the manifest privacy for a project where a third party SDK is present (in particular: flutter sdk)
Thanks
Hi! I was wondering if anyone else encountered similar issues and what the solution ended up being.
We're encountering weird sign-in issues on our iOS version of our app. It seems like an uninstall and reinstall solves it, but the issue seems to only impact users who underwent the transfer process from one iOS device to another. What I am curious about:
What is copied over from one device to another in this process?
Is there a way outside of owning multiple test devices to replicate this flow?
Our current suspicion is that NSUserDefaults is not being cleared by our app on first start, and that stale data is copied over during this transfer process, breaking the sign-in until a re-install wipes everything properly.
Does it seem like we're on the right track with this assumption, or completely out to lunch?
What happen when a deprecated method is used in project submitted to Apple Store Connect ?
Generally the Apple documentation give the alternative like "Use ***: instead" but sometime the documentation do not suggest anything.
What to do when a such Warning happen ?
Hello everybody!
I would like some help to resolve the error "/usr/bin/openssl" x509 -noout.
I've tried different ways but it persists.
I'm using Delphi (Embarcadero) version 12, I've also tried with 11 and without success.
I use MacMini version 15.2.
What could be causing this error
Thank you in advance
Topic:
Developer Tools & Services
SubTopic:
General
Hi,
I'm producing a dylib that another developer is trying to link with an ffmpeg plugin, building on Sequoia (this was not an issue prior to upgrading the OS). The error is:
ld: Shared cache eligible dylib cannot link to ineligible dylib '@rpath/libme.dylib'. Remove link to ineligible dylib, fix its eligibility, or opt out of the shared cache using the build setting 'LD_SHARED_CACHE_ELIGIBLE=NO' (or linker flag '-not_for_dyld_shared_cache')
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So, simple question - how do I "fix my dylib's eligibility"? I can't seem to find much info about this online.
Thanks,
Jeff
This morning I installed podman on my new Apple laptop. It can be inited successfully but failed to start.
The error is: Error: Error Domain=VZErrorDomain Code=1 Description="Internal Virtualization error. The virtual machine failed to start." UserInfo={
NSLocalizedFailure = "Internal Virtualization error.";
NSLocalizedFailureReason = "The virtual machine failed to start.";
My new Mac laptop with the latest OS version: 15.3.1 and it is Apple M4 chip.
I verified that my Virtualization.framework is good by ls -l /System/Library/Frameworks/Virtualization.framework also my MacOS support virtualization because sysctl kern.hv_support returns kern.hv_support: 1.
I tried to install it on my old Apple laptop which is intel core, same OS version - everything is good.
How to fix this issue?
Hello, my app has a custom font for some UI elements. When building with XCODE to my local device, all works and looks great. When distributing with TestFlight, the font doesn't seem to apply!
Yes, I've included the .ttf in my Development assets, anyone else having this issue with the TestFlight Distribution of their app?