Sample Header Ad - 728x90

Ask Different (Apple)

Q&A for power users of Apple hardware and software

Latest Questions

0 votes
0 answers
9 views
How to compile C++ program on macOS?
My `macOS` version is: ``` $ uname -a Darwin nanxiaos-MacBook-Pro.local 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8112 arm64 ``` I wrote a simple `C++` program: ``` $ cat foo.cc #include int main() { return 0; } ``` But the compiler can'...
My macOS version is:
$ uname -a
Darwin nanxiaos-MacBook-Pro.local 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8112 arm64
I wrote a simple C++ program:
$ cat foo.cc
#include 

int main() {
    return 0;
}
But the compiler can't find the related header files:
$ c++ foo.cc
foo.cc:1:10: fatal error: 'vector' file not found
    1 | #include 
      |          ^~~~~~~~
1 error generated.
Per my understanding, if there is a C++ compiler installed, the related header files and libraries should be installed as well. So how to compile C++ program on macOS?
Nan Xiao (523 rep)
Aug 6, 2025, 06:32 AM
1 votes
0 answers
294 views
Is there anywhere to find iOS API diffs any more?
Up through iOS 16 it looks like there were a couple of web sites that had some documentation about iOS API changes (e.g. http://codeworkshop.net/objc-diff/sdkdiffs/) and for IOS 11 and earlier Apple had official pages. I'm trying to figure out if there have been any public API changes between iOS 18...
Up through iOS 16 it looks like there were a couple of web sites that had some documentation about iOS API changes (e.g. http://codeworkshop.net/objc-diff/sdkdiffs/) and for IOS 11 and earlier Apple had official pages. I'm trying to figure out if there have been any public API changes between iOS 18.4 and 18.5, and Apple's release notes have not been very good for this. I prefer first party documentation, but in absence of that any documentation to review would be welcome. Is anything like that available for recent releases?
Greg (153 rep)
Jun 5, 2025, 09:09 PM • Last activity: Jul 22, 2025, 06:36 PM
6 votes
3 answers
757 views
How to clear application data for an iOS app installed on an Apple Silicon Mac?
Macs with Apple Silicon chips (M1/M2/etc.) can install iOS apps from the App Store. When an iOS app is **uninstalled**, its metadata is not deleted, and is reused if the app is reinstalled. This makes it impossible to have a fresh install. I am testing apps with TestFlight and it's very annoying. Is...
Macs with Apple Silicon chips (M1/M2/etc.) can install iOS apps from the App Store. When an iOS app is **uninstalled**, its metadata is not deleted, and is reused if the app is reinstalled. This makes it impossible to have a fresh install. I am testing apps with TestFlight and it's very annoying. Is there a way to clear application data for an iOS app installed on macOS?
Gabriel R. (593 rep)
May 4, 2025, 10:59 AM • Last activity: Jul 7, 2025, 12:27 PM
26 votes
2 answers
9243 views
What replaces x86 intrinsics for C when Apple ditches Intel CPUs for their own chips?
There are whole industries founded on the use of Intel Intrinsics for CPU parallelisation (with SIMD). For example, the community of Lattice QCD physicists depend on that for boost in the efficiency of lattice simulations. Intel-based macs can be and are routinely used by such professionals to do th...
There are whole industries founded on the use of Intel Intrinsics for CPU parallelisation (with SIMD). For example, the community of Lattice QCD physicists depend on that for boost in the efficiency of lattice simulations. Intel-based macs can be and are routinely used by such professionals to do their job. However, there are rumours about Apple replacing Intel CPU with ARM cpus in future Macs. Will these professionals have to replace Macs with other Intel-based computers, or are there alternatives to Intel Intrinsics for C that are supported on ARM-based CPUs?
Nanashi No Gombe (389 rep)
May 8, 2019, 12:38 PM • Last activity: Jul 7, 2025, 04:59 AM
6 votes
3 answers
24894 views
Minimum required specs of a Mac for iOS App development
I'm planing to develop an app with React Native for Android and iOS. I need to buy a Mac to run Xcode for iOS app development. I do not have a high budget, which is why I would prefer to buy a (used) Mac with the minimum required specifications that is able to run the latest version of Xcode and iPh...
I'm planing to develop an app with React Native for Android and iOS. I need to buy a Mac to run Xcode for iOS app development. I do not have a high budget, which is why I would prefer to buy a (used) Mac with the minimum required specifications that is able to run the latest version of Xcode and iPhone simulator. The app I want to develop is mostly running in the background, so there will be no heavy graphics or computations. I know this has been asked before, but it's been a few years since then, that's why I ask again. I'm happy about any comments about RAM, Processor, manufacturing year or anything else. Edit (November 2019): Just wanted to give future visitors an update: I spent a few hours to test macinacloud, however since it felt pretty slow and a bit overcomplicated, in the end I decided to get a used Mac Mini from late 2014 with 8 GB RAM. In general I am very happy with it, everything works fine (not super fast, but not too slow either). Sometimes I am hitting the limits (for example when running an iOS simulator and having too many other programs running at the same time), however I am always able to just close the ones I am not using right now and get everything to run fluently again. Thanks for the advice everyone, I hope this can help some other iOS-developement-beginners :)
markuscosinus (163 rep)
May 2, 2019, 10:12 PM • Last activity: Jun 26, 2025, 10:21 AM
1 votes
0 answers
56 views
Automating Removal of macOS Quarantine Attribute from VS Code Debug Binaries
I'm developing on macOS and using Visual Studio Code (VS Code) for debugging applications. When I run or debug my code, VS Code often creates temporary executable binaries in my project's debug output directory. macOS automatically applies the `com.apple.quarantine` extended attribute to these newly...
I'm developing on macOS and using Visual Studio Code (VS Code) for debugging applications. When I run or debug my code, VS Code often creates temporary executable binaries in my project's debug output directory. macOS automatically applies the com.apple.quarantine extended attribute to these newly created binaries, likely because they are being generated by an application that might have been downloaded. This results in the usual macOS security prompt ("is an app downloaded from the internet...") the first time I try to run or debug them after a fresh build. I am aware that I can manually remove this attribute using the terminal command:
xattr -d com.apple.quarantine /path/to/my/debug/binary
As seen in this existing Stack Exchange answer: [https://apple.stackexchange.com/a/436677/434175](https://apple.stackexchange.com/a/436677/434175) However, I'm looking for a way to **automate this process within VS Code** or whitelisting in some apple settings so that I don't have to manually run this command every time a new debug binary is created within these project directories. **My questions are:** * Does VS Code have any built-in settings or features that can automatically handle the removal of the com.apple.quarantine attribute for temporary debug binaries it generates on macOS? * Are there any specific VS Code tasks or build configurations that I can set up to run a command (like the xattr command) automatically after the build process for debug targets? * Are there any relevant VS Code extensions that might provide this functionality? * Are there any other recommended approaches within the VS Code ecosystem to streamline the debugging experience on macOS and avoid these quarantine prompts for locally built binaries? I'm hoping to find a solution that integrates well with the macOS VS Code workflow and avoids the need for manual intervention each time I build and debug.
Tiger Kaovilai (11 rep)
Apr 9, 2025, 08:30 PM
-1 votes
1 answers
52 views
How do I ask Macports to install a dependency package from local source?
So I know how to do that with 'brew' on my OSX 10.11.6 but "How do I ask Macports to install a dependency package locally?" And I don't take 'No, this is NOT allowed' for an answer. There is a number of reasons as to why 'allowing local source' to be incorporated into 'macport' maintained system is...
So I know how to do that with 'brew' on my OSX 10.11.6 but "How do I ask Macports to install a dependency package locally?" And I don't take 'No, this is NOT allowed' for an answer. There is a number of reasons as to why 'allowing local source' to be incorporated into 'macport' maintained system is important The most promising tip I reviewed so far is from this previous post: #1 credited to Lothar Haeger on the Macports mailing On my system, I am running MacFUSE 4.10.0. Installed via Native Apple .pkg installation. Current MacPorts only goes so far as osxfuse @3.8.3 and somehow it FAILED at fetching it. I need to get Macports to know this latest version of MacFUSE. And my original failed port task is to install 'sudo port install android-file-transfer-linux', it calls osxfuse and broke at that point...
allthingsgo (11 rep)
Mar 23, 2025, 12:13 PM • Last activity: Mar 23, 2025, 05:29 PM
2 votes
2 answers
171 views
Can you export SF Symbols into a list?
As a Product Owner without access to a Mac or the SF Symbols application, is there any way for my developer to export a list (preferably icon and name) to provide to me? We are looking to select certain SF symbols (version 6) for our application and I need to be able to see them all.
As a Product Owner without access to a Mac or the SF Symbols application, is there any way for my developer to export a list (preferably icon and name) to provide to me? We are looking to select certain SF symbols (version 6) for our application and I need to be able to see them all.
Mike (253 rep)
Jan 31, 2025, 08:07 AM • Last activity: Feb 27, 2025, 01:27 PM
36 votes
4 answers
48864 views
Homebrew installed libraries, how do I use them?
I'm a bit confused. I've installed a bunch of libraries (e.g. `vtk`, `gsl`,...) that I need for a c++ project for school. I used homebrew to install them (luckily there were formulas available). My question is, does Homebrew link these into `/usr/include` or something comparable? Or is this somethin...
I'm a bit confused. I've installed a bunch of libraries (e.g. vtk, gsl,...) that I need for a c++ project for school. I used homebrew to install them (luckily there were formulas available). My question is, does Homebrew link these into /usr/include or something comparable? Or is this something I would need to do manually? Homebrew usually does this kind of stuff for executables, yet I can't seem the find the libraries anywhere other than in the /usr/local/Cellar/... directories. I have a bunch of libraries installed so I can't simply use -L/... for each of them.
romeovs (4453 rep)
Feb 17, 2012, 08:17 AM • Last activity: Feb 1, 2025, 06:59 PM
11 votes
3 answers
948 views
Displaying difference between APFS snapshots
## Problem APFS is amazing... and infuriating with its lack of tools available. What I'm trying to do is simply an equivalent of `btrfs send --no-data -p /snapshots/parent /snapshots/child` ## My investigation 1. Most of the google-fu returns usages of `tmutil` - `tmutil` is able to `listlocalsnapsh...
## Problem APFS is amazing... and infuriating with its lack of tools available. What I'm trying to do is simply an equivalent of btrfs send --no-data -p /snapshots/parent /snapshots/child ## My investigation 1. Most of the google-fu returns usages of tmutil - tmutil is able to listlocalsnapshots / deletelocalsnapshots / localsnapshot (create) - tmutil compare doesn't accept 2 snapshots - tmutil compare EXISTING_SNAPSHOT returns cryptic & undocumented *Must specify a snapshot root when performing a machine comparison.* - tmutil calculatedrift doesn't seem to be related to APFS snapshots - tmutil contains some undocumented options, but nothing related to snapshots - Snapshot created by tmutil have hardcoded com.apple.TimeMachine.YYYY-MM-DD-HHMMSS.local naming format 2. diskutil contains limited snapshots support - diskutil deleteSnapshot works as intended - diskutil listSnapshots list snapshots with sizes and some metadata (unlike tmutil) - No facility for creating snapshots 3. Kernel contains fs_snapshot_* syscalls - The documentation is almost non-existent, but [a single man page is available](https://github.com/apple/darwin-xnu/blob/master/bsd/man/man2/fs_snapshot_create.2) - All usual operations (fs_snapshot_delete / fs_snapshot_list / fs_snapshot_create / fs_snapshot_mount) are supported - GitHub ahl/apfs [hosts a small utility](https://github.com/ahl/apfs/blob/master/snapUtil.c) which demonstrates the syscalls usage - fs_snapshot_list list **only** com.apple.TimeMachine.* snapshots - Any write operations (e.g. fs_snapshot_create) end up with application being killed with fs_snapshot_create: Operation not permitted (probably due to documented in the man reason: "require an additional entitlement") 4. Commercial app, Carbon Copy Cloner, is able to manipulate snapshots - For obvious reasons they don't disclose how they do that ;) ## Help? ;) Is there any method of getting a diff between two snapshots? Any documentation how they can be managed? The only naïve approach which because of speed is not feasible is running rsync between r/o mounted snapshots... but this is just stupid.
kiler129 (350 rep)
Mar 30, 2020, 02:37 AM • Last activity: Jan 8, 2025, 06:44 AM
1 votes
0 answers
50 views
Xcode doesn't show all symbol names in backtrace when Unit Testing
When I add breakpoint into the unit test, it stops properly, however the items in backtrace shows as `0x1...` (for functions from within the application under test). It does that in when i type `bt` into lldb command line too - See the screenshot, the selected item on the left-hand side and lldb out...
When I add breakpoint into the unit test, it stops properly, however the items in backtrace shows as 0x1... (for functions from within the application under test). It does that in when i type bt into lldb command line too - See the screenshot, the selected item on the left-hand side and lldb output at the bottom. It also completely fails to stop on any breakpoints set within the app. Therefore I believe the lldb doesn't have the dsym file of the app loaded. Is there any way to make Xcode load that automatically/manually? I do have the Debug executable checked in the Test build scheme, some/most of the tests also pass successfully. This is what i can see: Xcode Test when stopped on a breakpoint How can I get Xcode to show a symbolicated backtrace for apps I build?
LetynSOFT (111 rep)
Dec 13, 2024, 02:38 PM • Last activity: Dec 13, 2024, 04:28 PM
11 votes
2 answers
4284 views
XCode : How to use cmd + x to either cut the current line (if no text is selected) or cut the selected text
Pressing `cmd + x` without selecting text in other IDEs, cuts the complete line. Same goes for `cmd + c` which copies, instead of cutting. Otherwise, if some text is selected, only that region is cut. How do I do this in XCode? I added the following in the `IDETextKeyBindingSet.plist` to add cutting...
Pressing cmd + x without selecting text in other IDEs, cuts the complete line. Same goes for cmd + c which copies, instead of cutting. Otherwise, if some text is selected, only that region is cut. How do I do this in XCode? I added the following in the IDETextKeyBindingSet.plist to add cutting line and copying line functionality : My Custom Commands Cut Current Line selectLine:, cut: Copy Current Line selectLine:, copy: But obviously binding these to cmd + x (or c) doesn't allow cutting/copying selected region. I understand I can set it to some other keybinding. But, as a force of habit, cmd + x (or c) suits better. Is there any way to do this? Maybe an extension? [PS I asked the same question on StackOverflow, but realised, this is more apt place]
Saurabh Shrivastava (211 rep)
Sep 26, 2018, 08:16 AM • Last activity: Oct 28, 2024, 12:09 PM
1 votes
0 answers
164 views
Definitive way to enable ESC-key-like functionality for Obsidian on iPhone
Has anyone provided a good solution to the lack of an escape key on iPhone yet, for vim mode? I feel like this needs a definitive solution, and I’d be willing to work on it if nobody has, yet. Not an external keyboard. Just a plugin that gives a good way to enter the escape character, like a special...
Has anyone provided a good solution to the lack of an escape key on iPhone yet, for vim mode? I feel like this needs a definitive solution, and I’d be willing to work on it if nobody has, yet. Not an external keyboard. Just a plugin that gives a good way to enter the escape character, like a special button above the keyboard, or a special character sequence that gets remapped to the ESC key code, etc. What strategy would be the best solution for implementing this, if writing an Obsidian plugin? Like, the most natural way to work within the confines of iOS, and not a kind of awkward workaround.
Julius Hamilton (385 rep)
Aug 13, 2024, 02:22 PM • Last activity: Oct 27, 2024, 01:49 PM
11 votes
1 answers
2449 views
Why does my iPhone 16 Pro have iOS 18.0 but I can’t find a way to activate developer mode anywhere?
I just upgraded to an iPhone 16 Pro and it has iOS 18.0. I don't see the developer mode option anywhere! I've seen some people saying I have to fully reset my iPhone, and others saying I need to download some apps. I don't want to do the former, and the latter seems shady. Am I missing something? Is...
I just upgraded to an iPhone 16 Pro and it has iOS 18.0. I don't see the developer mode option anywhere! I've seen some people saying I have to fully reset my iPhone, and others saying I need to download some apps. I don't want to do the former, and the latter seems shady. Am I missing something? Isn't there a straight forward way of activating developer mode on iOS 18?
onzinsky (351 rep)
Oct 5, 2024, 09:08 AM • Last activity: Oct 6, 2024, 01:30 AM
5 votes
2 answers
3809 views
Make shortcut to enable/disable JavaScript with Safari 17.0
Safari 16.xx had an option `Disable JavaScript` in menu bar>Developers. I had a shortcut to simply enable/disable JavaScript with an easy shortcut. With Safari 17 Apple redesigned the developers section in Safari. The option to enable/disable JavaScript from the menu bar doesn't exist any more. Ther...
Safari 16.xx had an option Disable JavaScript in menu bar>Developers. I had a shortcut to simply enable/disable JavaScript with an easy shortcut. With Safari 17 Apple redesigned the developers section in Safari. The option to enable/disable JavaScript from the menu bar doesn't exist any more. Therefore, the shortcut doesn't work any more. Now, you can only enable/disable JavaScript within Safari preferences>Security>Enable JavaScript. Does anyone has an idea, how to receive the old behavior: enable/disable JavaScript with a simple shortcut?
David (290 rep)
Oct 8, 2023, 03:26 PM • Last activity: Sep 9, 2024, 03:15 AM
0 votes
0 answers
44 views
Can I modify my zip so iOS won't auto unpack it on download?
I maintain a free tool to produce books in DAISY format for the blind. One of the more widely-used DAISY reader programs is Dolphin EasyReader which has an iOS version. When "side-loading" a book into EasyReader (rather than obtaining it from a library listing), the user needs to point EasyReader at...
I maintain a free tool to produce books in DAISY format for the blind. One of the more widely-used DAISY reader programs is Dolphin EasyReader which has an iOS version. When "side-loading" a book into EasyReader (rather than obtaining it from a library listing), the user needs to point EasyReader at a ZIP file (with .zip extension) containing the DAISY book. Pointing EasyReader at an unpacked folder does not work. When blind users download a DAISY book produced by my tool, if they're on iOS, their device automatically unpacks the zip file into a folder. That causes confusion, because EasyReader needs to be given the *non*-unpacked .zip file. Currently, I add a file called 0000.txt containing my message about how if they're having trouble launching it in EasyReader then they should go up one level and find the original .zip file rather than the unpacked folder. But this was (a) hard to write without it looking like I'm disrespecting their operating system, (b) even harder to write in lots of different languages other than English and (c) still requires the user to take extra steps. I know Apple devices can be configured on the user side not to auto unpack .zip files, but rather than tell my users to change their settings, I'd much rather set something on my side if possible. Is there *anything* I can do to the zip file that says "hey iOS, if you're seeing this, please don't auto unpack this particular zip file" (but without actually corrupting the zip file because EasyReader still needs to unpack it)? (I'm unsure from the user reports whether the auto extraction is being performed by Safari or by Files. Either way, I'd like to stop it because in this particular case it's not helping. Unfortunately it doesn't seem to be an option to change the extension as .zip is required by most DAISY readers.)
Silas S. Brown (146 rep)
Aug 14, 2024, 06:32 PM
8 votes
2 answers
490 views
Custom macOS application bundle requires Rosetta even through it shouldn't
Since there is currently no [DrJava](http://www.drjava.org/) application bundle for macOS, I thought I could be the one to make it because I want to use it anyway. From just searching on the internet I made the following application bundle: ``` - DrJava.app - MacOS DrJava # this is a shell script th...
Since there is currently no [DrJava](http://www.drjava.org/) application bundle for macOS, I thought I could be the one to make it because I want to use it anyway. From just searching on the internet I made the following application bundle:
- DrJava.app
  - MacOS
    DrJava # this is a shell script that runs java -jar drjava.jar
    drjava.jar
  - Resources
    DrJavaIcon.png
    DrJavaSearchIcon.png
  Info.plist
And my Info.plist looks like:
CFBundleName
      DrJava
      CFBundleExecutable
      DrJava
      CFBundleIcon
      DrJavaIcon.png
The issue with this is that when I try to run the app, it tells me that I need to install Rosetta to do so. However, this is simply not true. I can run ./DrJava and it will run perfectly fine without rosetta. My current guess is that there's a key in Info.plist that will indicate the architectures that are compatible with this bundle. But I haven't been able to find any such thing. PS: Due to personal reasons, I don't want to make an Apple ID. As such I'm not trying to not install Xcode for as long as possible. I understand that this will make things more difficult, but I am committed.
octagonalhuman (101 rep)
Dec 18, 2022, 02:13 AM • Last activity: Aug 5, 2024, 09:01 PM
3061 votes
8 answers
2588485 views
Why am I getting an “invalid active developer path” when attempting to use Git after upgrading to macOS Sequoia?
After upgrading to macOS Sequoia, I tried to run `git` from Terminal but it kept giving me the following error: `xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun`. How do I fix it?
After upgrading to macOS Sequoia, I tried to run git from Terminal but it kept giving me the following error: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun. How do I fix it?
onin (67665 rep)
Sep 24, 2016, 07:09 PM • Last activity: Jun 15, 2024, 03:56 PM
1 votes
1 answers
43 views
Apple programming-libraries & software: What's the meaning of the prefix "Core"?
Many Apple-libraries got this Prefix "Core", like for example "Core Location", "Core Data", "Core Graphics", "Core Storage". **What's the meaning of "Core ..."? Where does it come from?**
Many Apple-libraries got this Prefix "Core", like for example "Core Location", "Core Data", "Core Graphics", "Core Storage". **What's the meaning of "Core ..."? Where does it come from?**
mizech (1265 rep)
Jun 9, 2024, 09:36 AM • Last activity: Jun 9, 2024, 03:39 PM
44 votes
8 answers
98142 views
How to send an email from command line?
How to send an email from command line or script? I want to be able to run the script programmatically by passing the receiver and the message.
How to send an email from command line or script? I want to be able to run the script programmatically by passing the receiver and the message.
michelemarcon (679 rep)
Apr 19, 2011, 09:57 AM • Last activity: May 10, 2024, 07:23 AM
Showing page 1 of 20 total questions