Xcode

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

Xcode Documentation

Posts under Xcode tag

3,613 results found
Post marked as unsolved
10 Views

SwiftUI app broken when upgraded to macOS Big Sur 11.3

I have a SwiftUI app that works perfectly fine on the version prior to the new 11.3 update. The app has a List and on clicking an entry, opens the child view which has a toolbar. This app has been working fine for months now, and once I upgraded to 11.3, the following happens the app opens fine it even loads the entries into the list view when I click on the entry, the right side is "empty" - no toolbar, no content. But the View is loading! (because the debug statements from the view onAppear are executing) I have absolutely no idea where to even look. Has something materially changed in SwiftUI or Xcode that would break an app like this? There are no error messages, warnings etc. - nothing. The child area just stays empty... that's it. I have a MacBook Pro which I haven't upgraded to 11.3, and the app works just fine there. I've recompiled with the latest Xcode etc., no use. Looking for any hints, thank you,
Asked
Last updated .
Post marked as unsolved
7.4k Views

Create Provisioning Profile

Hi,I'm trying to start Appium with a given .ipa and run the Inspector while my device (ipad mini 2) is connected to my mac machine via usb cable, but I'm getting such error:[iOSLog] [IOS_SYSLOG_ROW] May 30 14:23:05 Test-iPad notification_proxy[121] <Error>: 0x16e247000 -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!While I google it I found that in order to solve it need to enable the UI Automation option from Developers options in the device itself.But I cant see "Developers Options" in the settings of my device (with ios 9.3.1 - XCode 6.4)!I serached for it and found that in order to enable it need to have a provisioninf profile:ProcedureRun Google Chrome, Mozilla Firefox or Safari.In the iOS Dev Center, click Certificates, Identifiers & Profiles.In the iOS Apps panel, click Provisioning Profiles.Click +.Select iOS App Development and click Continue.Select an App ID to associate with the provisioning profile and click Continue. To be able to use one development provisioning profile across multiple apps, select a wildcard App ID, if available.Select one or more certificates for development to include in the provisioning profile and click Continue.Only certificates for development are listed.Select one or more devices to include in the provisioning profile and click Continue.Enter a name for the profile and click Generate.(Optional) Click Download to download the provisioning profile.But when signing in with my account I have no such option: Certificates, Identifiers & Profiles.Please advice...
Asked
by zbeedatm.
Last updated .
Post marked as unsolved
14 Views

dlopen different behavior in xcode

I'm experiencing a strange problem with dlopen in my app. I use it to load a plugin .dylib, which works fine generally (I have a few plugins already). I'm developing a new plugin feature.dylib that has an external shared library dependency libexternal.so and here's where I'm having trouble. After a lot of work with install_name_tool and otool, I have the following situation: if I run my app from terminal open MyApp.app or ./MyApp.app/Contents/MacOS/MyApp or from the finder by double clicking MyApp.app, the dlopen of feature.dylib is successful. However, if I run MyApp from within Xcode, dlopen feature.dylib fails with image not found for libexternal.so. I've checked this with debug and release builds, and with and without debugging (and if I run lldb from the terminal as lldb MyApp.app/Contents/MacOS/MyApp it works fine too) and the behavior is the same: running from inside Xcode, the dlopen fails, but outside Xcode, it works. Some other details: otool -L libexternal.so shows its id is libexternal.so and otool -L feature.dylib shows its id is feature.dylib and it has the dependency @loader_path/libexternal.so. If I change it to @rpath/libexternal.so and add my plugins folder path to MyApp.app's Runpath Search Paths, then it works in Xcode (but I don't want to have to enumerate all the places a plugin might be found here). This is on osx 10.15.7 with Xcode 12.4. I'm not using hardened runtime. feature.dylib and MyApp.app are signed with the same certificate, while libexternal.so is not signed. I thought this might be a problem until I saw it works outside Xcode. Is it possible Xcode is somehow changing the behavior of dlopen?
Asked
by diverdi.
Last updated .
Post marked as unsolved
27 Views

All controls cannot display text in release mode

Hi all, All controls display text normally in debug mode, and none in release mode。 Xcode: 12.5(12E262) MacOS: 11.2.3 (20D91) If you also encounter this problem, please help me to solve it, thanks!
Asked
by Leslie07.
Last updated .
Post marked as unsolved
1.4k Views

stuck while pairing appleTV and xcode

I've been trying lots of times to connect my xcode with AppleTV wirelessly.I could input PIN code shown on Apple TV for pairing to xcode,and then xcode comes stuck with the message "setting up appletv name." and a loading image.I googled again and again and found some had the same situation with me.https://discussions.apple.com/thread/8353737I've already done the following things.- reset AppleTV- completely remove xcode and reinstall it- reboot AppleTV, xcode, MacOSHere is my environment.AppleTV A1842 tvOS 11.4.1xcode v9.4.1MacOS High Sierra 10.13.6Thank you in advance.
Asked
Last updated .
Post marked as unsolved
58 Views

Disable Dark Mode for iOS, iPadOS and macOS Catalyst App using Swift Programming Language

I want to disable Dark Mode system wide. Apple Developer has mentioned that you can add 'UIUserInterfaceStyle' key to info.plist. But I checked there is no such key in list and it also gives error when you upload app to the App Store. I tried using below code in AppDelegate.swift file. window?.overrideUserInterfaceStyle = .light' But it seems above code doesn't apply to LaunchScreen.storyboard How to fix this? That is LaunchScreen should also obey command to disable dark mode system wide.
Asked
Last updated .
Post marked as unsolved
58 Views

Adding border colour to page control applies background colour to page control

I tried adding border - https://stackoverflow.com/questions/35842040/add-border-for-dots-in-uipagecontrol colour to page control and it applies background colour instead. The code below is the method I used to add border colour. The hyperlink above is where I got this solution. This method works no more in iOS 14 said a user. extension UIPageControl {   func customPageControl(dotFillColor:UIColor, dotBorderColor:UIColor, dotBorderWidth:CGFloat) {     for (pageIndex, dotView) in self.subviews.enumerated() {       if self.currentPage == pageIndex {         dotView.backgroundColor = dotFillColor         dotView.layer.cornerRadius = dotView.frame.size.height / 2       }else{         dotView.backgroundColor = .white         dotView.layer.cornerRadius = dotView.frame.size.height / 2         dotView.layer.borderColor = dotBorderColor.cgColor         dotView.layer.borderWidth = dotBorderWidth       }     }   } }
Asked
Last updated .
Post marked as unsolved
104 Views

UI-Test Record Button does not generate code.

Trying to use the record button, it works, app runs, but when I use my app, no code is generated. I am on Xcode-12.5 Mac OS- 11.3.1 Tried this on friend's machine too, same issue. Please help!
Asked
by abhi9044.
Last updated .
Post marked as unsolved
92 Views

CoreML fails to decrypt a model

We've 10 CoreML models in our app, each encrypted with a separate key generated in XCode. After opening and closing the app 6-7 times, the app crashes at model initialization with error: 2021-04-21 13:52:47.711729+0300 MyApp[95443:7341643] Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=9 "Failed to generate key request for 08494FB2-B070-440F-A8A5-CBD0823A258E with error: -42905" UserInfo={NSLocalizedDescription=Failed to generate key request for 08494FB2-B070-440F-A8A5-CBD0823A258E with error: -42905}: file MyApp/Model.swift, line 43 Looks like iPhone is blocking the app for suspicious behavior and the app fails to decrypt the model. We noticed that after ~10 hours the app is unlocked, it successfully decrypts and initializes the model. Opening and closing the app many times in a short period of time is indeed unnatural, but the most important question is how to avoid blocking? Would Apple block the app if a user opens and closes it 10 times during a day? How does the number of models in the app affect probability that the app will be blocked? Thanks!
Asked
by alievk91.
Last updated .
Post marked as unsolved
16 Views

Adding a macOS app via Xcode to the list of accessibility in privacy system preferences

Hi, I am working on a macOS app that is a background app and so I would like to perform a particular function when a keyboard key is pressed. I read from the apple documentation that addGlobalMonitorForEvents(matching:handler: ) must be used. And also to use this, accessibility must be enabled. I checked for accessibility with AXIsProcessTrustedWithOptions and the functionality has been implemented and it works right if accessibility is enabled. I give an alert to the user asking to enable accessibility and if the user agrees, the accessibility in the privacy system preferences window opens. Now, the issue I face is the app is not present in the accessibility list and so the user has to add the app manually into the list. Is there any way to programmatically(SWIFT) add the app to the accessibility list?
Asked
by MariaGT5.
Last updated .
Post marked as solved
125 Views

Different behaviour when starting app from Xcode than from iPhone

I am developing an app to control DJI drones by using DJIs Mobile and UX SDK. I am aware, that the problem I am facing might be related to their code, but I am hoping for some pointers on where to look at or things I can try to troubleshoot the issue. I have explained the issue with code examples and screenshots on Stackoverflow: https://stackoverflow.com/q/67320963/1065468 The remote of the drone is plugged into my iPhone and I start the app through Xcode on my phone wirelessly over the network. While the app works as it should when started from Xcode, it does not work when I just press the app icon on the iPhone. Checking my log output of the app on the phone in the console of my Mac, I can see, that the underlying connection to the drone is working and the app should update. Could it be a difference in configuration when the app is started from Xcode or directly from the phone? Looking forward to any pointers from you to help me troubleshoot this problem.
Asked
Last updated .
Post marked as unsolved
13 Views

iOS camera not working in TestFlight

I have an app that utilizes iOS's camera to read code39 barcodes and fetches data. When building and loading my application locally on my iPad via Xcode, the camera works great. It turns on, scans the barcode, and makes the fetch for data. When I submit my app to TestFlight and the user tests via TestFlight, the camera turns on and once it reads the bar code...crashes. I'm having trouble figuring out why building my app and loading it locally via Xcode works, but when I achieve it and distribute the app, that version crashes. That's about the only consistency I can find, official app distribution vs local build. Just seems odd that it works natively, but when I do it via TestFlight, it crashes. Any help on this will be greatly appreciated, thank you for your time. Kelvin Crash logs: language Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x000000016d286000 x5: 0x000000016d2865a0 x6: 0x000000000000006e x7: 0x0000000000000600 x8: 0xf7464369578201d2 x9: 0xf746436854b0f912 x10: 0x0000000000000002 x11: 0x0000000000000003 x12: 0x0000000000000000 x13: 0x0000000000000000 x14: 0x0000000000000010 x15: 0x0000000000000000 x16: 0x0000000000000148 x17: 0x000000010332f8c0 x18: 0x0000000000000000 x19: 0x0000000000000006 x20: 0x0000000000000103 x21: 0x000000010332f9a0 x22: 0x0000000000000000 x23: 0x0000000000000114 x24: 0x0000000000000000 x25: 0x000000010332f9a0 x26: 0x000000000000000f x27: 0x0000000000000000 x28: 0x0000000002ffffff fp: 0x000000016d286510 lr: 0x00000001e0861aa0 sp: 0x000000016d2864f0 pc: 0x00000001c33c1334 cpsr: 0x40000000 esr: 0x56000080 Address size fault
Asked
by ktsoi.
Last updated .
Post marked as unsolved
26 Views

Sort is swift doubles the number of entries in array

class InventoryModel: ObservableObject {     @Published var fileData = [inventoryEntry]()     var fileData2 = [inventoryEntry]() // for debug viewing fileData     var fileData3 = [inventoryEntry]() // for debug viewing fileData ..... } struct inventoryEntry{     var id: UUID = UUID()     var name: String = ""     var catagory: String = ""     var subcatagory: String = ""     var location: String = "" } inventoryModel.fileData.sort{$0.name $1.name} before sort the array has 64 entries and it is also stored in fileData2 viewable at break point after sort the array has 127 entries and I store hit in fileData3 viewable at break point What happened here. I did not expect sorting the array to add copied entries I consider this a bug. bug?
Asked
by JackReigh.
Last updated .
Post marked as unsolved
15 Views

Xcode 12.5 bitcode error with static library bazel xcodebuil.

Xcode 12.5 bitcode error with static library bazel xcodebuil. I am a third-party technology provider. Our output product is a static library, built with Bazel, supports bitcode, and the built IDE is XCode11. It is normal to use static libraries in Xcode 12.4, but after IDE upgrade to 12.5, bitcode is no longer supported, and an error is always reported:This is an LLVM bug. "Wrong number of operands !124 = !{!"branch_weights", i32 1, i32 2001, i32 2001, i32 2001, i32 2000} Wrong number of operands !124 = !{!"branch_weights", i32 1, i32 2001, i32 2001, i32 2001, i32 2000} Wrong number of operands !124 = !{!"branch_weights", i32 1, i32 2001, i32 2001, i32 2001, i32 2000} Wrong number of operands !124 = !{!"branch_weights", i32 1, i32 2001, i32 2001, i32 2001, i32 2000} Wrong number of operands !124 = !{!"branch_weights", i32 1, i32 2001, i32 2001, i32 2001, i32 2000} Wrong number of operands !124 = !{!"branch_weights", i32 1, i32 2001, i32 2001, i32 2001, i32 2000} Wrong number of operands !124 = !{!"branch_weights", i32 1, i32 2001, i32 2001, i32 2001, i32 2000} LLVM ERROR: Broken module found, compilation aborted! clang: error: unable to execute command: Abort trap: 6 clang: error: linker command failed due to signal (use -v to see invocation) Command Ld failed with a nonzero exit code" If I switch the build IDE from XCode11 to XCode12.5, it will cause all IDEs not using XCode12.5 to support bitcode. Error log: "ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1205.0.22.9.0_0' Reader: '1200.0.32.28_0')', using libLTO version 'LLVM version 12.0.0, (clang-1200.0.32.28)' for architecture armv7"
Asked
by BingJuzi.
Last updated .