Build, test, and submit your app using Xcode, Apple's integrated development environment.

Posts under Xcode tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Xcode add header search path
Using XCode9, I have created a C-command line project and added an open source framework (gstreamer) in adddition to the corefoundation framework to my project.The C-program uses the header files from gstreamer which are not found by the compiler causing an error. I cannot see where I can add the header path to my project. I have checked the Framework and Xcode lists in the Header directory all header files.The following line causes the compiler error:#include <gst/gst.h>Asking for advice.gMichael
4
0
23k
Sep ’23
Can't type in input in Xcode 10.1 using C++
I'm new to Xcode and programming in general, and I'm having an issue with Xcode. After I made my code and built it successfully the first time, I can type in input in the bottom console no problem. But then I made a few tweaks and went ahead to build it again. It did successfully build but this time I can't type in anything in the bottom console. So I have to close Xcode and reopen it again everytime I want to make any tweaks and it's getting annoying. Would love to know how to fix this. Thank you in advance.
10
1
5k
Oct ’23
How do I downgrade the simulator in Xcode?
My app is working as expected in the simulator on iOS 12.1, but not on my iOS 11.x device, and it is just a layout issue. I'm not aware of any major changes in layout constraints from 11 to 12, so I'm perplexed... I upgraded an older device from iOS 10 to 12 and my app layout works on it, so it seems something changed between iOS 11 and 12 regarding layout, but I don't know what that is...How can I get a simulator running iOS 11.x to debug? I'll start debugging on my actual 11.x device, but I would also like to know how to get a simulator running older iOS versions? xcodebuild -showsdks says I only have 12.1 iphone/simulator 12.1 -- how do I run 11.x in the simulator, or older iOS versions in general in the simulator?
11
2
39k
Oct ’23
Need to capture user activity like call, text, and app usage without reading the content.
Reading sqlite databases in the OS library can be one option but does it require Jailbreaking?How does spyware like Cocospy work on iOS devices? Note: I'm going to capture data for R&D with user consent, visible running app and not as spyware running in the background.I'm new to iOS development and any leads, references will be much appreciated.
2
0
1.4k
Sep ’23
How do you chain CIFilter
In Apple's documentation it says this:"This method, though convenient, is inefficient if used multiple times in succession. Achieve better performance by chaining filters without asking for the outputs of individual filters."That confuses me though because I don't know how to link them together without getting the output. For example, this is my method to apply a TiltShift filter, based on the instructions from Apple's docs. When I perform the gradient filter, I have to take the outputImage of that to pass into the next filter. What's the right way to be doing this? override public var outputImage: CIImage? { guard let inputImage = inputImage else { return nil } let clamped = inputImage.clampedToExtent() let blurredImage = clamped.applyingGaussianBlur(sigma: inputRadius) var gradientParameters = [ "inputPoint0": CIVector(x: 0, y: 0.75 * inputImage.extent.height), "inputColor0": CIColor(red: 0, green: 1, blue: 0, alpha: 1), "inputPoint1": CIVector(x: 0, y: 0.5 * inputImage.extent.height), "inputColor1": CIColor(red: 0, green: 1, blue: 0, alpha: 0) ]; guard let gradientImage = ciImage(from: "CILinearGradient", parameters: gradientParameters) else { return nil } gradientParameters["inputPoint0"] = CIVector(x: 0, y: 0.25 * inputImage.extent.height) guard let backgroundGradientImage = ciImage(from: "CILinearGradient", parameters: gradientParameters) else { return nil } let maskParameters = [ kCIInputImageKey: gradientImage, kCIInputBackgroundImageKey: backgroundGradientImage ] guard let maskImage = ciImage(from: "CIAdditionCompositing", parameters: maskParameters) else { return nil } let combinedParameters = [ kCIInputImageKey: blurredImage, kCIInputBackgroundImageKey: clamped, kCIInputMaskImageKey: maskImage ] return ciImage(from: "CIBlendWithMask", parameters: combinedParameters) } private func ciImage(from filterName: String, parameters: [String: Any]) -> CIImage? { guard let filtered = CIFilter(name: filterName, parameters: parameters) else { return nil } return filtered.outputImage }
5
1
2.9k
Aug ’23
Cannot preview SwiftUI
I am running Catalina (10.15) with XCode11. After creating a new project and selecting the option to Use SwiftUI, the file opens, but i get an error message in the preview window;'Cannot preview in this file -- active scheme does not build this file. 'the info button says 'Select a scheme that builds a target which contains the current file, or add this file to a target that is built by the current scheme.'i've tried opening numerous new projects, with and without unit tests, but none of them allow it to be previewed. I did see on Twitter that I'm not alone in seeing this issue. Any ideas on steps to troubleshoot it? Thanks all.
21
1
47k
Aug ’23
Xcode 11 crashes when opening the project
I downloaded new XCode 11 today and when I am trying to open my project, XCode will always crash. Does anyone else experience this problem ? I have provided part of crash log. It's IDE related problem, but I would be really glad, someone has a solution to this.Crashed Thread: 25 Dispatch queue: ConcurrentQueue: -[IDEProvisioningMechanic _executeNextRepairIfNeeded]_block_invokeException Type: EXC_CRASH (SIGABRT)Exception Codes: 0x0000000000000000, 0x0000000000000000Exception Note: EXC_CORPSE_NOTIFYApplication Specific Information:ProductBuildVersion: 11A420aASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-14936/IDEFoundation/Provisioning/Mechanic/IDEProvisioningRepairStepGenerator.m:252Details: Didn't find a single primary certificate type from {()}Object: <IDEProvisioningRepairStepGenerator_Automatic: 0x7fdc55061ef0>Method: -_evaluateCertificatesWithSession:context:repairable:steps:userAction:error:Thread: <NSThread: 0x7fdc44944ca0>{number = 20, name = (null)}Hints: Backtrace: 0 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit) 1 _DVTAssertionHandler (in DVTFoundation) 2 _DVTAssertionFailureHandler (in DVTFoundation) 3 -[IDEProvisioningRepairStepGenerator_Automatic _evaluateCertificatesWithSession:context:repairable:steps:userAction:error:] (in IDEFoundation) 4 -[IDEProvisioningRepairStepGenerator_Automatic stepsWithSession:context:userAction:error:] (in IDEFoundation) 5 -[IDEProvisioningRepair execute] (in IDEFoundation) 6 __53-[IDEProvisioningMechanic _executeNextRepairIfNeeded]_block_invoke_2 (in IDEFoundation) 7 __DVT_CALLING_CLIENT_BLOCK__ (in DVTFoundation) 8 __DVTDispatchAsync_block_invoke (in DVTFoundation) 9 _dispatch_call_block_and_release (in libdispatch.dylib) 10 _dispatch_client_callout (in libdispatch.dylib) 11 _dispatch_continuation_pop (in libdispatch.dylib) 12 _dispatch_async_redirect_invoke (in libdispatch.dylib) 13 _dispatch_root_queue_drain (in libdispatch.dylib) 14 _dispatch_worker_thread2 (in libdispatch.dylib) 15 _pthread_wqthread (in libsystem_pthread.dylib) 16 start_wqthread (in libsystem_pthread.dylib)I have deleted caches in library, derivated data, even disabled automati signing, but none of these work, also /Library/Caches/com.apple.xbs does not exist. I have asked this question on SO - https://stackoverflow.com/questions/58052418/xcode-11-crashes-when-opening-the-project
34
0
35k
Aug ’23
Xcode 11 Command PhaseScriptExecution failed with a nonzero exit code
Running Mojave 10.14.6Xcode 11.0 (11A420a)iOS 13.1.2iPhone 6s PlusI cannot seem to find the solution here or on Stack Overflow.When compiling, I keep getting this error:Command PhaseScriptExecution failed with a nonzero exit codeI tried in XcodeXcode > Preferences > Accountssigning in and outI have created a new Dev Cert, Distribution Cert, new PUSH certs, new provisional profilesI have tried pod updatesI have tried changing the Build Phase info with chmod +xas recommended by this posthttps://forums.developer.apple.com/thread/122796?start=0&tstart=0I have tried rebooting my phone. I have tried rebooting the computer. rebooting xcode (obviously)Don't know what else to do.
43
4
228k
Oct ’23
Readme markdown not rendering in Xcode
In Xcode 11.1, I created a 'README.md' markdown file, but it always renders as its raw text (yet font size changes depending on header level). For example, in Xcode's editor I see:# AppName ## Version 1.0Where the first line is in a larger font size than the lines 3 and 4.Anyhow, if I open up a project from Apple (e.g. BuildingCustomViewsInSwiftUI), it's README renders correctly.If I paste my project's contents into Apple's sample project README, it then renders a-ok. The reverse though (taking the contents from Apple's sample and pasting into my project; even dragging in the original project) won't render it (I then see all the markup symbols such as #.I've checked every possible setting between the two projects and cannot figure out why this is happening. The type of file (markdown), encoding, etc. are identical.However, one item I have noticed is that in Apple's sample project, when I view the README.md file, the Editor | Minimap menu choice is disabled and unchecked. Whereas in my project, the menu choice is enabled. Toggling that on/off though has no effect in my project.Thus, there must be some reason why Apple's sample has the Minimap option disabled. And my guess is this is the reason why Apple's sample in then rendering the markdown file correctliy in the editor.Anyone know how to fix this?Note: I also viewed the contents of the various files under the .xcodeproj package and couldn't find anything useful (i.e.. I was hoping to find some settings difference regarding the readme file, but couldn't find any).
13
0
16k
Aug ’23
unable to boot the simulator launchd failed to respond
After I updated to Mac OS Catalina I'm no more able to run the simulator. I always get this: "Unable to boot the Simulator - launchd failed to respond".I'm runningMac OS 10.15 CatalinaXcode 10.3I can't update to Xcode 11 (anyway my collegue installed Xcode 11 and he's getting the same error too)I already try these:- Simulator/Hardware/Erase all contents and services... (the result was a black screen on simulator and nothing happened)- Delete all simulators and download them again- /private/tmp directorysudo mkdir /private/tmp sudo chmod 1777 /private/tmp- I tried thisxcrun simctl shutdown all xcrun simctl delete $(xcrun simctl list | grep -o '[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}' | xargs) xcrun simctl delete unavailableNothing seems working... The simulator looks working in the morning, than after few builds it stop working.Ideas?
21
3
50k
Oct ’23
Connecting Python 3.8 with Xcode 11
Hi. I have some trouble while on connecting latest Python 3.8 on the Xcode 11. I have been fighting with the problem almost couple of days, and I finally concluded I must get help from the masters. I'm new to Xcode and other programming stuff, please forgive me on being clumsy;)I first type on google Xcode, Python and read some posts about bringing Python on the Xcode. Though they're bit outdated (mostly on 2016, 2017) but still the format was similar, so I decided to follow them step by step.First, open the Xcode and create the new Project. Add product name 'pythons', and fill other blank below. On Build Tool, I pasted/Library/Frameworks/Python.framework/Versions/3.8/bin/python3which is the address of Python3 I found by typing 'which python3' on Terminal. Than I pressed Next, and create project folder on Desktop, checked on options: 'Source Control: Create Git repository on my Mac'.Secondly, create the new file. I went to 'File-New-File' at the menu and found 'Empty' template at 'macOS-Other' category. Click Next, save asFile.py, checked on 'Group: pythons, Targets: pythons'. And created the file at the folder 'pythons'.Third, edit scheme on the created file. I brought scheme edit page by 'Product-Scheme-Edit Scheme'. At the Info tab, I changed 'Exexutable' on 'other' choosing python38, which I made it newly by opening the Terminal on the '~bin' folder which I mentioned on Build Tool, and typing on Terminalln python3.8 python38By the procedure, I could choose python38 instead of python3, which was non-selectable with gray shade on it. Than I un-checked the 'Debug executable'.Move to Arguments tab and click + of 'Arguments Passed On Launch'. Than I typed in $(SRCROOT)/File.pyMove to Options tab, there is Working Directory option, and I checked on 'Use custom working directory' to the project path on Desktop.Finally, close the scheme editing page and write 'print("Hello world")' on the canvas. Run it.And there are errors, which I couldn't solve out./Library/Frameworks/Python.framework/Versions/3.8/bin/python38: can't open file '$(SRCROOT)/File.py': [Errno 2] No such file or directoryProgram ended with exit code: 2How can I solve this errors and get back on working Python with Xcode?Many people on the net say that build python with other tools such as pycharm, IDLE or other stuff, I guess I should. But I really want to know at least what was worng with the steps I took and just wanna see 'Hello world' on the output.Please help me.. This problem keeps tangling like an fishbone on my neck every time. Welcomes precise feedbacks. Thanks.
15
0
28k
Oct ’23
Errors running with ASAN when targeting iOS Devices
I'm unable to run my app with ASAN enabled when targeting a physical iOS device. Simulator targets do work. With Xcode 12 and an iPad mini 4 running iOS 14 beta 1 I get the following error during app launch ==750==ERROR: AddressSanitizer failed to allocate 0xffffffffff9fc000 (-6307840) bytes at address 2db624000 (errno: 22) ==750==ReserveShadowMemoryRange failed while trying to map 0xffffffffff9fc000 bytes. Perhaps you're using ulimit -v With Xcode 11.5 and an iPad Air 2 running OS 12.4.1 the error is ==2177==Unable to find a memory range after restricting VM. ==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/asanmac.cc:92 "((0 && "cannot place shadow after restricting vm")) != (0)" (0x0, 0x0) <empty stack>==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/../sanitizercommon/sanitizermallocmac.inc:143 "((!asaninitisrunning)) != (0)" (0x0, 0x0) warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available. AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report. (lldb) thread info -s thread #1: tid = 0x1076c2, 0x000000011531e984 libclangrt.asaniosdynamic.dylib`__asan::AsanDie() My coworker is able to use ASAN with the same App using iPad Pro 10.5, iPadOS 13.5.1, Xcode 11.5 Are there any configuration changes I need to make to be able to use ASAN on my devices?
10
1
7.3k
May ’24
Xcode Previews doesn't work when used in a package that imports other packages.
I keep getting a Xcode Previews error in Xcode 12 from a package that imports other packages. As soon as I remove the dependency I'm able to see the SwiftUI preview. I'm only able to use previews in packages that have no dependencies The error I get is: "LoadingError: failed to load library at path...Library not loaded " then it point to the dependency that it could not load in the current package. How can I access Xcode Previews from a package that depends on other packages?
32
20
18k
Sep ’23
Xcode 12 Framework: 'Double-quoted include in framework header, expected angle-bracketed instead'
I've got an iOS framework that I've had around for ages. It's a mixture of Objective-C and Swift. Since installing Xcode 12, I'm now getting a bunch of warnings of the type: 'Double-quoted include in framework header, expected angle-bracketed instead' If I go to the various source files and say change: #import "Place.h" to #import <VegasKit/Place.h> then I get an error saying it can't find the file. If I try this: #import <Place.h> then I get an error telling me to go back to double-quotes, i.e. undo the change. Any idea what I can do to get this all setup correctly? Thanks.
17
1
25k
Oct ’23