Questions tagged [xcode]
Xcode is Apple's integrated development environment (IDE). USAGE NOTE: Use this tag only for questions about the Xcode IDE itself, and not for general Mac or iOS programming topics. Use [cocoa] for Mac programming questions, and [cocoa-touch] or [iOS] or [Swift] for iOS programming questions.
159,748
questions
3472
votes
41
answers
1.5m
views
Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools")
I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13).
This morning I navigated to my work's ...
1601
votes
30
answers
961k
views
Transport security has blocked a cleartext HTTP
What setting do I need to put in my info.plist to enable HTTP mode as per the following error message?
Transport security has blocked a cleartext HTTP (http://) resource
load since it is insecure....
1478
votes
10
answers
353k
views
How can I "add existing frameworks" in Xcode 4?
I can't find the good old "Add existing frameworks" option. How do I do this?
We're talking about Xcode 4 DP2 (in the context of iPhone development, as far as it matters...).
1373
votes
18
answers
341k
views
How can I disable ARC for a single file in a project?
I am using ARC successfully in my project. However, I have encountered a few files (e.g., in unit tests and mock objects) where the rules of ARC are a little more fragile right now. I recall hearing ...
1155
votes
37
answers
573k
views
How can I change the name of an iOS app in Xcode?
I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since it's nearly finished. How can I do this?
1033
votes
101
answers
803k
views
Xcode 10 Error: Multiple commands produce
error: Multiple commands produce '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist':
1) Target '...
1009
votes
30
answers
643k
views
xcode-select active developer directory error
Saw the following error when running an npm install which required node-gyp... but could be triggered by anything which requires xcode-select.
xcode-select: error: tool 'xcodebuild' requires Xcode, ...
980
votes
1
answer
2.5m
views
How to download Xcode DMG or XIP file?
Where does the Mac App Store download the files to under Lion? I need the DMG file in order to repair something in my system, but how can I access that file?
962
votes
21
answers
341k
views
Git ignore file for Xcode projects
Which files should I include in .gitignore when using Git in conjunction with Xcode?
925
votes
66
answers
786k
views
Xcode building for iOS Simulator, but linking in an object file built for iOS, for architecture 'arm64'
I am trying to get a large (and working on Xcode 11!) project building in Xcode 12 (beta 5) to prepare for iOS 14. The codebase was previously in Objective-C, but now it contains both Objective-C and ...
909
votes
25
answers
555k
views
Xcode error "Could not find Developer Disk Image"
When attempting to run a build on a connected iOS device in Xcode I get the error:
Could not find Developer Disk Image
I saw that there was a public beta for Xcode, so I installed it.
One of the ...
879
votes
19
answers
351k
views
#ifdef replacement in the Swift language
In C/C++/Objective C you can define a macro using compiler preprocessors.
Moreover, you can include/exclude some parts of code using compiler preprocessors.
#ifdef DEBUG
// Debug-only code
#endif
...
857
votes
11
answers
172k
views
Xcode 7 error: "Missing iOS Distribution signing identity for ..."
I tried to upload my App to iTunes Connect resp. AppStore and got the following error:
Failed to locate or generate matching signing assets
Xcode attempted to locate or generate matching signing ...
793
votes
14
answers
145k
views
Xcode process launch failed: Security
I have been developing an app for 1 or 2 weeks now and just yesterday I have updated my iPhone 5S to the iOS 8 GM. Everything worked fine and I could test on my device as well until I deleted the app ...
769
votes
14
answers
237k
views
Hide strange unwanted Xcode logs
When using the Xcode 8+ and creating a new blank project, the following logs appear when running the application:
2016-06-13 16:33:34.406093 TestiOS10[8209:100611] bundleid: com.appc.TestiOS10, ...
744
votes
19
answers
298k
views
How do I see which version of Swift I'm using?
I just created a new Swift project within Xcode. I am wondering which version of Swift it's using.
How can I see, in Xcode or the terminal, what version of Swift I am using inside my project?
710
votes
45
answers
196k
views
This action could not be completed. Try Again (-22421)
I am trying to upload an Apple TV App to the App Store for testing purposes, but I got the issue:
This Action could not be completed. Try Again (-22421)
as in the below image:
So what can I do?
707
votes
7
answers
186k
views
Version vs build in Xcode
I have an app that I developed with Xcode 3 and recently started editing with Xcode 4. In the target summary I have the iOS application target form with fields: identifier, version, build, devices, ...
702
votes
12
answers
284k
views
How do I completely rename an Xcode project (i.e. inclusive of folders)?
I have a project named XXX. I want to rename this project to YYY.
Note that XXX is an extremely common term (for e.g. "data", or simply "project"), and thus a simple RegEx search-...
680
votes
9
answers
238k
views
Xcode Product -> Archive disabled
I have been archiving for ad hoc distribution fine for many months and suddenly today I cannot do so as the Archive menu item is disabled. I have not changed anything. I went through the provisioning ...
639
votes
52
answers
235k
views
Xcode 6 Bug: Unknown class in Interface Builder file
I upgraded to Xcode 6 beta 4 and now my App continuously crashes with the message
Unknown class X in Interface Builder file.
It crashes because supposedly Xcode can't find my custom classes that I ...
630
votes
19
answers
111k
views
Do Swift-based applications work on OS X 10.9/iOS 7 and lower?
Will Swift-based applications work on OS X 10.9 (Mavericks)/iOS 7 and lower?
For example, I have a machine running OS X 10.8 (Mountain Lion), and I am wondering if an application I write in Swift will ...
625
votes
21
answers
215k
views
How can I indent multiple lines in Xcode?
When I select multiple lines of code and want to indent them as usual with TAB key, it just deletes them all. I come from Eclipse where I always did it that way. How's that done in Xcode? I hope not ...
617
votes
4
answers
152k
views
Can I delete data from the iOS DeviceSupport directory?
After going through and cleaning my disk with old things that I didn't need anymore, I came across the iOS DeviceSupport folder in ~/Library/Developer/Xcode which was taking nearly 20 GB.
A similar ...
614
votes
21
answers
396k
views
Giving UIView rounded corners
My login view has a subview which has a UIActivityView and a UILabel saying "Signing In…". This subview has corners which aren't rounded. How can I make them round?
Is there any way to do it inside ...
598
votes
23
answers
567k
views
How to remove CocoaPods from a project?
What's the right way of removing CocoaPods from a project? I want to remove the whole CocoaPod. Due to some limitations imposed by my client I can't use it. I need to have just one xcodeproj instead ...
594
votes
23
answers
780k
views
How to update Xcode from command line
I am trying to update Xcode from the command line. Initially I tried running:
xcode-select --install
which resulted in this message:
xcode-select: error: command line tools are already installed, ...
564
votes
32
answers
350k
views
‘ld: warning: directory not found for option’
When I'm building my Xcode 4 apps I'm getting this warning:
ld: warning: directory not found for option '-L/Users/frenck/Downloads/apz/../../../Downloads/Google Analytics SDK/Library'
ld: warning: ...
555
votes
16
answers
782k
views
How to install Xcode Command Line Tools
How do I get the command-line build tools installed with the current Xcode/Mac OS X v10.8 (Mountain Lion) or later?
Unlike Xcode there is no installer, it's just a bundle.
It looks like all the ...
554
votes
6
answers
215k
views
Where do I find the line number in the Xcode editor?
In Xcode 3, the line number of the current cursor location was displayed. I don't see this in Xcode 4. Is there a setting that will turn it on? Or a keypress that will give it to me?
551
votes
5
answers
157k
views
Xcode Project vs. Xcode Workspace - Differences
I am trying to understand how the whole ecosystem of iOS works.
Until now, I could find an answer for most of my question (and trust me, there have been a lots of them), but for this one, there seems ...
546
votes
88
answers
765k
views
Getting error "No such module" using Xcode, but the framework is there
I'm currently coding in Swift, and I've got an error:
No such module Social
But I don't understand, because the module is in my project, declared in "Linked frameworks and Libraries" and in "...
531
votes
20
answers
309k
views
Take screenshots in the iOS simulator
I want to take a screenshot of my iOS application when it is running in the simulator, and save the screenshot on my Mac. How can I do this?
524
votes
7
answers
208k
views
Is it okay to delete the macOS Xcode CoreSimulator devices folder?
My ~/Library/Developer/CoreSimulator/Devices folder is 26 GB.
Is it safe to just delete all the content? Will those files be automatically regenerated?
524
votes
12
answers
283k
views
Missing Compliance status in TestFlight
When I added my latest build for internal testing with TestFlight, I saw that it had a "Missing Compliance" status.
Is this a major problem? Why does this appear? How can I resolve this ...
523
votes
14
answers
241k
views
How can I set the title of a UIButton as left-aligned?
I need to display an email address on the left side of a UIButton, but it is being positioned to the centre.
Is there any way to set the alignment to the left side of a UIButton?
This is my current ...
514
votes
8
answers
157k
views
iPad Multitasking support requires these orientations
I'm trying to submit my universal iOS 9 apps to Apple (built with Xcode 7 GM) but I receive this error message for the bundle in iTunes Connect, just when I select Submit for Review:
Invalid Bundle. ...
505
votes
26
answers
151k
views
Xcode warning: "Multiple build commands for output file"
I am getting an error like this:
[WARN]Warning: Multiple build commands for output file /Developer/B/Be/build/Release-iphonesimulator/BB.app/no.png
[WARN]Warning: Multiple build commands for output ...
504
votes
16
answers
141k
views
Codesign error: Provisioning profile cannot be found after deleting expired profile
Tried to rebuild an app that was working just yesterday. Got a message that a profile had expired, so I removed it from the iPod and from iTunes. When I chose a new profile (one with an * in the ...
496
votes
12
answers
218k
views
"Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." when using GCC
While attempting to compile my C program, running the following command:
gcc pthread.c -o pthread
Returns:
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via ...
490
votes
4
answers
94k
views
Ignore Xcode warnings when using Cocoapods
I use quite a lot third party libraries which have many warnings in it, after the latest Xcode updates. (for example the Facebook SDK pod)
Now all these warnings are shown in my Xcode on the place I ...
488
votes
43
answers
285k
views
Fixing Xcode 9 issue: "iPhone is busy: Preparing debugger support for iPhone"
I'm looking for more information on the message below. Xcode 9 seems to be hanging for a couple minutes already...
How can I tell Xcode 9 to quickly recognize my previously used device updated to iOS ...
480
votes
14
answers
156k
views
This certificate has an invalid issuer Apple Push Services
I have created certificate to enable Push Services in my app, but every time I try to add certificate in my Keychain, after adding certificate it shows me following error:
This certificate has an ...
471
votes
23
answers
208k
views
Cocoapods Warning - CocoaPods did not set the base configuration of your project because because your project already has a custom config set
After I execute a pod install at the base of my project, I get the following error:
CocoaPods did not set the base configuration of your project because because your project already has a custom ...
471
votes
4
answers
131k
views
Xcode 4 - "Archive" is greyed out?
I would like to archive my application, but the Archive option is greyed out. What could cause this?
468
votes
59
answers
268k
views
dyld: Library not loaded: @rpath/libswiftCore.dylib
I am trying to run a Swift app on my iPhone 4s. It works fine on the simulator, and my friend can successfully run it on his iPhone 4s. I have iOS 8 and the official release of Xcode 6.
I have tried
...
464
votes
34
answers
227k
views
Codesign wants to access key "access" in your keychain, I put in my login password but keeps asking me
I'm trying to learn to load apps on my iPhone from Xcode. When I do I keep getting "Codesign wants to access key "access" in your keychain, I put I my login password but it keeps popping up over and ...
461
votes
9
answers
217k
views
Provisioning Profiles menu item missing from Xcode 5
After spending a whole day installing a fresh copy of Mac OS X v10.8 (Mountain Lion), Xcode 5, fixing provisioning profiles, certificates, creating new ones, I finally managed to get my ...
461
votes
7
answers
108k
views
How do I set up NSZombieEnabled in Xcode 4?
How do I set up NSZombieEnabled and CFZombieLevel for my executable in Xcode 4?
460
votes
20
answers
223k
views
How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?
Wireless debugging was recently added as a feature in Xcode 9, iOS 11, and tvOS 11. Apple TV 4K doesn't have a USB port, so it requires wireless debugging. How do you perform this wireless debugging ...