Universal Apps

RSS for tag

A single Universal app includes native binaries that run on Intel-based Macs and Apple Silicon Macs.

Posts under Universal Apps tag

102 Posts

Post

Replies

Boosts

Views

Activity

Can 64-bit apps run on 32-bit system.
My macOS application is built for 64-bit and arm64. Does this run on 32-bit machine. I am asking this because: macOS was 64-bit even when it was supporting 32-bit apps to run on it (<= 10.14). So, does it convert 64-bit instructions to 32-bit and thus can a user run 64-bit app on his 32-bit machine? (It might be slower though). Thank you. Deepa
2
0
1.2k
Apr ’23
Universal app launching as Intel on Apple Silicon
We've created and distributed a Universal app for Intel/Apple Silicon devices, which then gets launched by an Intel-only launcher. I'm finding that if I launch the app from the launcher, Activity Manager is reporting that it is an Intel application, whereas if I launch it directly, it reports as an Apple (Silicon) application. (Worth noting: this app is completely codesigned/notarized.) This is definitely odd, because we have other Universal projects that get distributed on different Intel-only launchers (e.g. Steam) and they are properly launched as a native Apple Silicon app. I apologize that I'm low on information here; happy to do more work to provide additional info.
1
0
1.6k
Apr ’23
Rosetta 2 automated installer problem
Hi, It appears that the automated triggering of Rosetta 2 installer is only done when a user directly clicks on an Intel only binary on silicon hardware. I have an app that is itself a universal binary but which loads an intel only plugin. This does not cause the built in Rosetta 2 installer to launch. I can detect that the app is running on arm64 and I can detect that Rosetta is not yet installed but I cannot programatically install it. It would be nice to have one of the following: The ability to require Rosetta in the app's plist for a universal binary. A system call to initiate installation. For the automated installer to work however a binary is run. The first seems like the cleanest solution. Without one of these, or some other fix, Rosetta 2 installation is incoherent. For now the only way I can work round this issue is very ugly: include a second minimal x86_64 only app with my app as a no op installer for Rosetta, then when my app runs if I detect that Rosetta is missing on silicon, throw up an alert to ask the user to run the bundled minimal app and exit. This is less than ideal. Can you suggest a better way to work round this issue? or Can you add one of the above solutions as a feature request? Thanks Paul
11
0
2.4k
Mar ’23
How does one get a universal macOS library from a Swift package dependency?
I'm getting an error building my Mac app for both Apple Silicon and Intel, related to a Swift package dependency. The dependency is a pure Swift package (SwiftyXMLParser), and I'm bringing it into my app with a package dependency from the git repository URL. My app is configured to build standard architectures to run natively on both Apple Silicon and Intel. The build fails because it looks like the package manager only provides the active architecture, not a universal library, when the latter is configured. It happens when I set "Build Active Architecture Only" to NO (if it's set to YES it succeeds, but then the app won't run on the other architecture). In particular, if I build on my M1 mini, the error is Could not find module 'SwiftyXMLParser' for target 'x86_64-apple-macos'; found: arm64, arm64-apple-macos If I build on my x86 MBP, same failure but the error is opposite (no arm64, found: x86_64). So clearly SPM+Xcode can provide either architecture - is it possible for it to provide a universal lib? Or do I need to download the source of the package and build it through a more manual process?
7
0
8.9k
Feb ’23
Status bar covers part of the application
I have a problem that the status bar covers part of the application, and I would like the status bar to be separate from the application. I use Angular 12 and Capacitor V4, should i use capacitor save-area package? This issue only appear on iphone with notch, on Android, iPad works very well. This is what the app looks like when you run it When I minimize the apps and come back again, the app gets a black bar at the top that just separates the apps and I wish it was like this all the time
0
0
1.1k
Jan ’23
Is it possible to build a macCatalyst app and distribute it on Intel only Macs?
I've build a few iOS apps, they are all distributes on iPhone, iPad and macOS Silicon as iPad apps I would like to distribute those apps on Mac Intel computers too, I'm able to build a version using macCatalyst, would it be possible to distribute this macCatalyst on Mac Intel only system, avoiding to presente int on the App Store for Mac Silicon computers? (on those I would that user download the iPad version and not the macCatalyst one) Mac Intel version should be compatible from macOS 10 thank you for your suggestion Antonio Ferraioli
2
0
1.8k
Dec ’22
Xcode won't build for universal binary
I am porting a macOS Objective-C app from just Intel silicon to universal binary -- Intel and Apple silicon both -- using Xcode 13.2.1, building on a 2019 Mac Pro running macOS 11.6.4. I have followed all the instructions here: https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary. In particular, in Xcode's "build" settings, "Architectures" is set to "Standard Architectures (Apple Silicon, Intel) - $(ARCHS_STANDARD)", and "Build Active Architecture Only" is set to "No". Yet when I use Xcode to build either the release or the debug version of my app, the shell command: lipo -archs <path to MyApp.app>/Contents/MacOS/<MyApp> returns only "x86_64", and indeed, the app doesn't even start initialization when I test it on a Mac Mini with Apple silicon. What could I be doing wrong?
5
1
6.5k
Nov ’22
How to show dock menu for Catalyst apps?
I've added Mac support to my iOS app and would like to add menu items when right clicking on the app icon. I was already using app shortcuts on iOS. I have a static item defined in my info.plist under the UIApplicationShortcutItems key. and I have dynamic actions I setup in applicationWillEnterForeground. Sometimes these actions appear when right clicking the app icon but most of the time they don't. Is there an example project or best practice to get this working?
1
0
1.3k
Nov ’22
Dual x86_64/arm64 Java application running under x86_64 emulation on a M1 machine
I have built a Java application that is bundled with universal binaries for the Java Runtime Environment, so that the application can run natively on both x86_64 and arm64 machines. That is, the executable file within the application is a shell script that calls the embedded java binary to actually start the Java program. The java binary itself is a “universal binary” created with lipo, with support for both x86_64 and arm64. Trying to start the application from the command line, with open -a MyApplication.app, on my M1-powered machine yields the expected behaviour: the application is running natively, as can be seen in the Activity Monitor, where the corresponding process is shown as running under an “Apple” CPU kind. (It can also be seen by the mere fact that the application is much more responsive than it is when it is executed by a x86_64 JRE). However, when the very same application is executed from the Finder, by double-clicking on MyApplication.app, it then runs under x86_64 emulation, as can be seen in the Activity Monitor, where the corresponding process is shown as running under an “Intel” CPU kind. How comes that the same application runs under emulation or not depending on whether it is started from the command line or from the Finder? How can I force the application to run natively when it is started from the Finder? Adding the LSRequiresNativeExecution key in the Info.plist file does not change anything, nor does adding the LSArchitecturePriority key. My workaround for now is to build two variants of my application, one with a x86_64 JRE for Intel users and one with a arm64 JRE for my Apple Silicon users. But I’d really like to be able to provide them with a single application that runs natively on both architectures. Any help welcome. Happy to provide more details if needed.
2
0
2.7k
Nov ’22
tel: action sheet UI doesn't respond to use interaction after invoked in UIInterfaceOrientationMaskLandscape
bug replay environment:Xcode 14, iOS 16.0 iPhone invoke this code in UIInterfaceOrientationMaskLandscape ViewController [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://foo"] options:@{} completionHandler:^(BOOL success) {}]; the tel: process UI can respond to use interaction. invoke this same code in UIInterfaceOrientationMaskPortrait ViewController, the tel: process UI doesn't respond to use interaction at any App. the only resolve method is restart tel: process by restart my Phone
0
0
1.2k
Nov ’22
Codesign and AppStore verification failure after manually lipo'ing two dylibs
We are creating a universal build of our application for the Mac App Store by merging separate x86_64 and arm64 bundles using a script. Codesign verification fails for some dylibs if they are signed after merging: % lipo -create x86_64/test.dylib arm64/test.dylib -o universal/test.dylib % codesign -s *** -f --timestamp universal/test.dylib % codesign --verify --verbose=2 universal/test.dylib test.dylib: invalid Info.plist (plist or signature have been modified) It seems verification fails for only those dylibs that have an Info.plist embedded in them. We were able to work around this issue by signing the individual dylibs before merging, but now AppStore verification is failing with the following error: ITMS-90336: Mismatched Embedded Info.plist: The executable 'test.dylib' has mismatched embedded Info.plists. This could be due to the use of 3rd party build tools. Does this mean that the __info_plist section in all the slices in the universal binary should be exactly the same (bitwise)? Some of these are third-party binaries and we don't know whether they were created using third-party build tools.
3
1
2k
Oct ’22
Pipe and Poll MacM1.
Hi since couple of day I introspect a bug that my application have on specifically on MacM1. All of this is code in C on a Mac Monterey (begun on Big Sure but updated recently). In nutshell we allow user to send some custom command to OS. In practice what does we do: Create 2 pair pipe (and a thirds one for error but not pertinent here). input parent were the command will be wrote -&gt; output child where the command will read the command. input child where we the child will wrote the output of command-&gt; output parent where we will read the return value. We configure them with "close on exec", "non blocking", "asynchronous" and "FIOSETOWN" raise a signal when data are ready. Forking send the command from child. And then we wait in parent with poll that data is ready in output parent. And this pattern work like a charm on all of our supported platform (including mac x64 Monterey with xcode 14 and an Unix A64v8). But on Mac M1 (tested on big sure, Monterey with xcode 13 an 14), it look like poll never go in state "some datas are ready to be read", even when there are datas ready to read. One of the possible conflict that I can see here, is that our application heavily use SIGIO for other purpose that force us to ignore the EINTR error and just wait that poll successfully return. if that poll basically return the EINTR error as the File descriptor signal the interrupt before poll returning, but the next poll should be instantaneous and success as the data are still ready. So I assume that not the issue here. But there are probably something that I miss. So here is some questions, are there any significant known difference between poll() on x64 or x86, and m1 ? Are there some known issue with poll behaviours on MacM1 ? What can we possibility miss here ?
3
0
1.4k
Oct ’22
Project doesn't archive, complains about architecture
I have a SwiftUI project, iOS16, it builds fine if I choose a simulator/device, but when I choose Any iOS Device (arm64) and hit Archive, it fails with error: error build: Entry point (_main) undefined. for architecture arm64 I'm using an M1 Mac Studio to build it. I have the following in my main: @main struct MyAppNameApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate ... } class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Sets cache for Images downloader SDWebImageSwiftUI // ... return true } } Under Architectures I have the following: Should I select for release Yes as well? Why is it failing? What setting do I have to look into? Thanks
2
0
1.4k
Sep ’22
Mac App Store url problem on Mac M1
Hello, I have an iOS application which has a "rate us" button. This button redirects to "Write review" section on the app's App Store. It is working great on both iPhone and iPad devices. The problem is on MacBook M1 - it is working, but once the App Store app for review is opened, my iOS app crashes :( UIApplication.shared.open(URL(string: "itms-apps://itunes.apple.com/us/app/app-name/id*****?action=write-review")!) Any ideas on how it can be fixed? Thanks!
11
1
3.8k
Sep ’22
CoreData+CloudKit custom Zone
Hi, I'm using CoreData+CloudKit in a blank universal project for macOS 11 and iOS14. The records are in a private database inside a custom zone, I was able to set the correct database, but I'm yet to be able to set the zone. On the PersistentController created by default by Xcode 12 I have the following code let container: NSPersistentCloudKitContainer     init(inMemory: Bool = false) {         container = NSPersistentCloudKitContainer(name: "finances_manager_pro")         let customZone = CKRecordZone(zoneName: "CloudCore")         guard let description = container.persistentStoreDescriptions.first else {             fatalError("Error")         }         description.cloudKitContainerOptions?.databaseScope = .private         if inMemory {             container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null")         }         container.loadPersistentStores(completionHandler: { (storeDescription, error) in             if let error = error as NSError? {                 fatalError("Unresolved error \(error), \(error.userInfo)")             }         })     } And inside a View @FetchRequest(         sortDescriptors: [NSSortDescriptor(keyPath: \ExpenseCoreData.timestamp, ascending: true)],         animation: .default)     private var items: FetchedResults&lt;ExpenseCoreData&gt; I've searched around the web and in apple docs but I haven't found an updated way to do this.
2
0
1.9k
Aug ’22
Both ios-x86_64-simulator and ios-arm64-simulator represent two equivalent library definitions. XCFramework for iOS simulator on M1 & Intel Mac? How?
I now have an M1 Mac and an Intel Mac. I have an XCFramework that targets the iOS simulator and devices. My XCFramework works fine but I'd like to be able to run my app (which uses the XCFramework) on the iOS simulator on both my Macs (m1 &amp; intel). Now my M1 Mac complains about the x86_64 architecture when I try to run it on the simulator. So I rebuilt the XCFramework (recompiling the simulator version on the M1 Mac). I'm compiling the source code from Terminal (building OpenSSL). There is no .xcarchive here. Anyway now the app runs on the simulator on the M1 Mac but on the Intel Mac it won't build (basically the same problem in reverse). So... I made three versions of the library now (for iOS devices, iOS simulator on m1 Mac, and for the iOS simulator on Intel Macs). When I try to make an XCFramework to wrap all three static libraries I get the following error: Both "ios-x86_64-simulator" and "ios-arm64-simulator" represent two equivalent library definitions. I found another thread where the accepted answer was to lipo the x86_64 and arm simulators together, then build the xcframework. I've seen posts from Apple engineers that say using lipo is not supported (reference: https://developer.apple.com/forums/thread/709812?answerId=719667022#719667022 ) So where am I going wrong? I try to make the xcframework like so: xcodebuild -create-xcframework -library build/sim/openssl-1.1.1q/libcrypto.a -headers build/sim/openssl-1.1.1q/crypto -library build/phones/openssl-1.1.1q/libcrypto.a -headers build/phones/openssl-1.1.1q/crypto -library build/intelsim/openssl-1.1.1q/libcrypto.a -headers build/intelsim/openssl-1.1.1q/crypto -output build/Crypto.xcframework
3
1
6.9k
Aug ’22
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
Hi, I have found multiple questions on this topic but none of the proposals solves my problem so please stay with me on the description below since I am obviously missing something. I have an iOS Framework that links with multiple static libraries from a C Open Source project using "Other Linker flags" and "Library search paths". These .a files are all fat binaries including arm64 and x86_64 versions. This Framework is later used by a regular iOS app after being packed into an XCFramework (do note, when generating the XCFramework I use EXCLUDED_ARCHS="arm64" for the simulator build since a long time and I think this is also wrong). Everything works fine on device but I have never gotten the Simulator to work on my M1 Mac and now I am trying to fix that but without success, when trying to start the simulator on M1 I get this error for the first fat .a found: building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 I do not want to exclude arm64 arch for the simulator as suggested in some posts since I want to be able to run the app in arm64 mode on the Simulator. Also, when starting the simulator on my M1 (not using Rosetta) I am expecting it to run in arm64 mode so then it makes no sense that it complains that the static lib is an arm64 lib right? I have tried changing Build only active archs and other suggestions but nothing has helped. I also checked the fat binary used from the framework with otools as suggested by @eskimo in another post and it spat out this: Load command 1 cmd LC_BUILD_VERSION cmdsize 24 platform 2 minos 13.0 sdk 15.4 ntools 0 which I think is correct, PLATFORM_IOS. I assume the arm64 .a file that runs in the xCode Simulator is the same as the arm64 .a that runs on device right? Or do I have to build arm64 for the Mac platform to run the iOS simulator on M1? Very grateful for any ideas on what might be wrong.
2
0
3.2k
Jul ’22
Asset validation failed
Hi I am trying to upload an App to the App Store. It is a Java application with a small Swift wrapper. I build for both arm64 and x86-64 and include JREs for both architectures inside the bundle. The Launcher App: @main struct LauncherApp {       static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "drrename")       static func main() {           var jrePath: String = ""       #if arch(arm64)     if let jrePathArm64 = Bundle.main.path(forResource: "jre-18.0.1_10_arm64/Contents/Home/bin/java", ofType: ""){       jrePath = jrePathArm64     }       #elseif arch(x86_64)     if let jrePathX86 = Bundle.main.path(forResource: "jre-18.0.1_10_x64/Contents/Home/bin/java", ofType: ""){       jrePath = jrePathX86     }       #endif           if jrePath != "" {       logger.log("Got jre path: \(jrePath)")       if let jarPath = Bundle.main.path(forResource: "drrename-0.6.4-SNAPSHOT", ofType: "jar"){         logger.log("Got jar path: \(jarPath)")         let task = Process()         task.launchPath = jrePath         task.arguments = ["-jar", jarPath]         task.launch()         task.waitUntilExit()       } else {         logger.critical("Failed to get jar path")       }     } else {       logger.critical("Failed to get jre path")     }   } } I get the following error: I understand that both arm and x86 are required, that is why I package both x86-64 and arm64 JREs inside the bundle. How can I resolve this error? Many thanks!
3
0
2.1k
Jul ’22
Can 64-bit apps run on 32-bit system.
My macOS application is built for 64-bit and arm64. Does this run on 32-bit machine. I am asking this because: macOS was 64-bit even when it was supporting 32-bit apps to run on it (<= 10.14). So, does it convert 64-bit instructions to 32-bit and thus can a user run 64-bit app on his 32-bit machine? (It might be slower though). Thank you. Deepa
Replies
2
Boosts
0
Views
1.2k
Activity
Apr ’23
Siri shortcuts doesn't work on Mac (designed for iPad)
I've created an iOS app with shortcuts one can launch with Siri and it works on an iPhone. I've added as a supported destination the Mac (designed for iPad). On the mac Siri does not recognise the shortcuts. Is there anything particular to add or is this a bug?
Replies
0
Boosts
1
Views
915
Activity
Apr ’23
Universal app launching as Intel on Apple Silicon
We've created and distributed a Universal app for Intel/Apple Silicon devices, which then gets launched by an Intel-only launcher. I'm finding that if I launch the app from the launcher, Activity Manager is reporting that it is an Intel application, whereas if I launch it directly, it reports as an Apple (Silicon) application. (Worth noting: this app is completely codesigned/notarized.) This is definitely odd, because we have other Universal projects that get distributed on different Intel-only launchers (e.g. Steam) and they are properly launched as a native Apple Silicon app. I apologize that I'm low on information here; happy to do more work to provide additional info.
Replies
1
Boosts
0
Views
1.6k
Activity
Apr ’23
Rosetta 2 automated installer problem
Hi, It appears that the automated triggering of Rosetta 2 installer is only done when a user directly clicks on an Intel only binary on silicon hardware. I have an app that is itself a universal binary but which loads an intel only plugin. This does not cause the built in Rosetta 2 installer to launch. I can detect that the app is running on arm64 and I can detect that Rosetta is not yet installed but I cannot programatically install it. It would be nice to have one of the following: The ability to require Rosetta in the app's plist for a universal binary. A system call to initiate installation. For the automated installer to work however a binary is run. The first seems like the cleanest solution. Without one of these, or some other fix, Rosetta 2 installation is incoherent. For now the only way I can work round this issue is very ugly: include a second minimal x86_64 only app with my app as a no op installer for Rosetta, then when my app runs if I detect that Rosetta is missing on silicon, throw up an alert to ask the user to run the bundled minimal app and exit. This is less than ideal. Can you suggest a better way to work round this issue? or Can you add one of the above solutions as a feature request? Thanks Paul
Replies
11
Boosts
0
Views
2.4k
Activity
Mar ’23
How does one get a universal macOS library from a Swift package dependency?
I'm getting an error building my Mac app for both Apple Silicon and Intel, related to a Swift package dependency. The dependency is a pure Swift package (SwiftyXMLParser), and I'm bringing it into my app with a package dependency from the git repository URL. My app is configured to build standard architectures to run natively on both Apple Silicon and Intel. The build fails because it looks like the package manager only provides the active architecture, not a universal library, when the latter is configured. It happens when I set "Build Active Architecture Only" to NO (if it's set to YES it succeeds, but then the app won't run on the other architecture). In particular, if I build on my M1 mini, the error is Could not find module 'SwiftyXMLParser' for target 'x86_64-apple-macos'; found: arm64, arm64-apple-macos If I build on my x86 MBP, same failure but the error is opposite (no arm64, found: x86_64). So clearly SPM+Xcode can provide either architecture - is it possible for it to provide a universal lib? Or do I need to download the source of the package and build it through a more manual process?
Replies
7
Boosts
0
Views
8.9k
Activity
Feb ’23
Status bar covers part of the application
I have a problem that the status bar covers part of the application, and I would like the status bar to be separate from the application. I use Angular 12 and Capacitor V4, should i use capacitor save-area package? This issue only appear on iphone with notch, on Android, iPad works very well. This is what the app looks like when you run it When I minimize the apps and come back again, the app gets a black bar at the top that just separates the apps and I wish it was like this all the time
Replies
0
Boosts
0
Views
1.1k
Activity
Jan ’23
Is it possible to build a macCatalyst app and distribute it on Intel only Macs?
I've build a few iOS apps, they are all distributes on iPhone, iPad and macOS Silicon as iPad apps I would like to distribute those apps on Mac Intel computers too, I'm able to build a version using macCatalyst, would it be possible to distribute this macCatalyst on Mac Intel only system, avoiding to presente int on the App Store for Mac Silicon computers? (on those I would that user download the iPad version and not the macCatalyst one) Mac Intel version should be compatible from macOS 10 thank you for your suggestion Antonio Ferraioli
Replies
2
Boosts
0
Views
1.8k
Activity
Dec ’22
Xcode won't build for universal binary
I am porting a macOS Objective-C app from just Intel silicon to universal binary -- Intel and Apple silicon both -- using Xcode 13.2.1, building on a 2019 Mac Pro running macOS 11.6.4. I have followed all the instructions here: https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary. In particular, in Xcode's "build" settings, "Architectures" is set to "Standard Architectures (Apple Silicon, Intel) - $(ARCHS_STANDARD)", and "Build Active Architecture Only" is set to "No". Yet when I use Xcode to build either the release or the debug version of my app, the shell command: lipo -archs <path to MyApp.app>/Contents/MacOS/<MyApp> returns only "x86_64", and indeed, the app doesn't even start initialization when I test it on a Mac Mini with Apple silicon. What could I be doing wrong?
Replies
5
Boosts
1
Views
6.5k
Activity
Nov ’22
How to show dock menu for Catalyst apps?
I've added Mac support to my iOS app and would like to add menu items when right clicking on the app icon. I was already using app shortcuts on iOS. I have a static item defined in my info.plist under the UIApplicationShortcutItems key. and I have dynamic actions I setup in applicationWillEnterForeground. Sometimes these actions appear when right clicking the app icon but most of the time they don't. Is there an example project or best practice to get this working?
Replies
1
Boosts
0
Views
1.3k
Activity
Nov ’22
Dual x86_64/arm64 Java application running under x86_64 emulation on a M1 machine
I have built a Java application that is bundled with universal binaries for the Java Runtime Environment, so that the application can run natively on both x86_64 and arm64 machines. That is, the executable file within the application is a shell script that calls the embedded java binary to actually start the Java program. The java binary itself is a “universal binary” created with lipo, with support for both x86_64 and arm64. Trying to start the application from the command line, with open -a MyApplication.app, on my M1-powered machine yields the expected behaviour: the application is running natively, as can be seen in the Activity Monitor, where the corresponding process is shown as running under an “Apple” CPU kind. (It can also be seen by the mere fact that the application is much more responsive than it is when it is executed by a x86_64 JRE). However, when the very same application is executed from the Finder, by double-clicking on MyApplication.app, it then runs under x86_64 emulation, as can be seen in the Activity Monitor, where the corresponding process is shown as running under an “Intel” CPU kind. How comes that the same application runs under emulation or not depending on whether it is started from the command line or from the Finder? How can I force the application to run natively when it is started from the Finder? Adding the LSRequiresNativeExecution key in the Info.plist file does not change anything, nor does adding the LSArchitecturePriority key. My workaround for now is to build two variants of my application, one with a x86_64 JRE for Intel users and one with a arm64 JRE for my Apple Silicon users. But I’d really like to be able to provide them with a single application that runs natively on both architectures. Any help welcome. Happy to provide more details if needed.
Replies
2
Boosts
0
Views
2.7k
Activity
Nov ’22
Prompt to install Rosetta 2 message
Hi, I created bundle (signed and notarized) using PyInstaller and currently it support only Intel. When I try to run the executable on Mac without Rosetta it fails and not prompt install Rosetta message. How can I show this message ? Thanks
Replies
5
Boosts
0
Views
1.5k
Activity
Nov ’22
tel: action sheet UI doesn't respond to use interaction after invoked in UIInterfaceOrientationMaskLandscape
bug replay environment:Xcode 14, iOS 16.0 iPhone invoke this code in UIInterfaceOrientationMaskLandscape ViewController [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://foo"] options:@{} completionHandler:^(BOOL success) {}]; the tel: process UI can respond to use interaction. invoke this same code in UIInterfaceOrientationMaskPortrait ViewController, the tel: process UI doesn't respond to use interaction at any App. the only resolve method is restart tel: process by restart my Phone
Replies
0
Boosts
0
Views
1.2k
Activity
Nov ’22
Codesign and AppStore verification failure after manually lipo'ing two dylibs
We are creating a universal build of our application for the Mac App Store by merging separate x86_64 and arm64 bundles using a script. Codesign verification fails for some dylibs if they are signed after merging: % lipo -create x86_64/test.dylib arm64/test.dylib -o universal/test.dylib % codesign -s *** -f --timestamp universal/test.dylib % codesign --verify --verbose=2 universal/test.dylib test.dylib: invalid Info.plist (plist or signature have been modified) It seems verification fails for only those dylibs that have an Info.plist embedded in them. We were able to work around this issue by signing the individual dylibs before merging, but now AppStore verification is failing with the following error: ITMS-90336: Mismatched Embedded Info.plist: The executable 'test.dylib' has mismatched embedded Info.plists. This could be due to the use of 3rd party build tools. Does this mean that the __info_plist section in all the slices in the universal binary should be exactly the same (bitwise)? Some of these are third-party binaries and we don't know whether they were created using third-party build tools.
Replies
3
Boosts
1
Views
2k
Activity
Oct ’22
Pipe and Poll MacM1.
Hi since couple of day I introspect a bug that my application have on specifically on MacM1. All of this is code in C on a Mac Monterey (begun on Big Sure but updated recently). In nutshell we allow user to send some custom command to OS. In practice what does we do: Create 2 pair pipe (and a thirds one for error but not pertinent here). input parent were the command will be wrote -&gt; output child where the command will read the command. input child where we the child will wrote the output of command-&gt; output parent where we will read the return value. We configure them with "close on exec", "non blocking", "asynchronous" and "FIOSETOWN" raise a signal when data are ready. Forking send the command from child. And then we wait in parent with poll that data is ready in output parent. And this pattern work like a charm on all of our supported platform (including mac x64 Monterey with xcode 14 and an Unix A64v8). But on Mac M1 (tested on big sure, Monterey with xcode 13 an 14), it look like poll never go in state "some datas are ready to be read", even when there are datas ready to read. One of the possible conflict that I can see here, is that our application heavily use SIGIO for other purpose that force us to ignore the EINTR error and just wait that poll successfully return. if that poll basically return the EINTR error as the File descriptor signal the interrupt before poll returning, but the next poll should be instantaneous and success as the data are still ready. So I assume that not the issue here. But there are probably something that I miss. So here is some questions, are there any significant known difference between poll() on x64 or x86, and m1 ? Are there some known issue with poll behaviours on MacM1 ? What can we possibility miss here ?
Replies
3
Boosts
0
Views
1.4k
Activity
Oct ’22
Project doesn't archive, complains about architecture
I have a SwiftUI project, iOS16, it builds fine if I choose a simulator/device, but when I choose Any iOS Device (arm64) and hit Archive, it fails with error: error build: Entry point (_main) undefined. for architecture arm64 I'm using an M1 Mac Studio to build it. I have the following in my main: @main struct MyAppNameApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate ... } class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Sets cache for Images downloader SDWebImageSwiftUI // ... return true } } Under Architectures I have the following: Should I select for release Yes as well? Why is it failing? What setting do I have to look into? Thanks
Replies
2
Boosts
0
Views
1.4k
Activity
Sep ’22
Mac App Store url problem on Mac M1
Hello, I have an iOS application which has a "rate us" button. This button redirects to "Write review" section on the app's App Store. It is working great on both iPhone and iPad devices. The problem is on MacBook M1 - it is working, but once the App Store app for review is opened, my iOS app crashes :( UIApplication.shared.open(URL(string: "itms-apps://itunes.apple.com/us/app/app-name/id*****?action=write-review")!) Any ideas on how it can be fixed? Thanks!
Replies
11
Boosts
1
Views
3.8k
Activity
Sep ’22
CoreData+CloudKit custom Zone
Hi, I'm using CoreData+CloudKit in a blank universal project for macOS 11 and iOS14. The records are in a private database inside a custom zone, I was able to set the correct database, but I'm yet to be able to set the zone. On the PersistentController created by default by Xcode 12 I have the following code let container: NSPersistentCloudKitContainer     init(inMemory: Bool = false) {         container = NSPersistentCloudKitContainer(name: "finances_manager_pro")         let customZone = CKRecordZone(zoneName: "CloudCore")         guard let description = container.persistentStoreDescriptions.first else {             fatalError("Error")         }         description.cloudKitContainerOptions?.databaseScope = .private         if inMemory {             container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null")         }         container.loadPersistentStores(completionHandler: { (storeDescription, error) in             if let error = error as NSError? {                 fatalError("Unresolved error \(error), \(error.userInfo)")             }         })     } And inside a View @FetchRequest(         sortDescriptors: [NSSortDescriptor(keyPath: \ExpenseCoreData.timestamp, ascending: true)],         animation: .default)     private var items: FetchedResults&lt;ExpenseCoreData&gt; I've searched around the web and in apple docs but I haven't found an updated way to do this.
Replies
2
Boosts
0
Views
1.9k
Activity
Aug ’22
Both ios-x86_64-simulator and ios-arm64-simulator represent two equivalent library definitions. XCFramework for iOS simulator on M1 & Intel Mac? How?
I now have an M1 Mac and an Intel Mac. I have an XCFramework that targets the iOS simulator and devices. My XCFramework works fine but I'd like to be able to run my app (which uses the XCFramework) on the iOS simulator on both my Macs (m1 &amp; intel). Now my M1 Mac complains about the x86_64 architecture when I try to run it on the simulator. So I rebuilt the XCFramework (recompiling the simulator version on the M1 Mac). I'm compiling the source code from Terminal (building OpenSSL). There is no .xcarchive here. Anyway now the app runs on the simulator on the M1 Mac but on the Intel Mac it won't build (basically the same problem in reverse). So... I made three versions of the library now (for iOS devices, iOS simulator on m1 Mac, and for the iOS simulator on Intel Macs). When I try to make an XCFramework to wrap all three static libraries I get the following error: Both "ios-x86_64-simulator" and "ios-arm64-simulator" represent two equivalent library definitions. I found another thread where the accepted answer was to lipo the x86_64 and arm simulators together, then build the xcframework. I've seen posts from Apple engineers that say using lipo is not supported (reference: https://developer.apple.com/forums/thread/709812?answerId=719667022#719667022 ) So where am I going wrong? I try to make the xcframework like so: xcodebuild -create-xcframework -library build/sim/openssl-1.1.1q/libcrypto.a -headers build/sim/openssl-1.1.1q/crypto -library build/phones/openssl-1.1.1q/libcrypto.a -headers build/phones/openssl-1.1.1q/crypto -library build/intelsim/openssl-1.1.1q/libcrypto.a -headers build/intelsim/openssl-1.1.1q/crypto -output build/Crypto.xcframework
Replies
3
Boosts
1
Views
6.9k
Activity
Aug ’22
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
Hi, I have found multiple questions on this topic but none of the proposals solves my problem so please stay with me on the description below since I am obviously missing something. I have an iOS Framework that links with multiple static libraries from a C Open Source project using "Other Linker flags" and "Library search paths". These .a files are all fat binaries including arm64 and x86_64 versions. This Framework is later used by a regular iOS app after being packed into an XCFramework (do note, when generating the XCFramework I use EXCLUDED_ARCHS="arm64" for the simulator build since a long time and I think this is also wrong). Everything works fine on device but I have never gotten the Simulator to work on my M1 Mac and now I am trying to fix that but without success, when trying to start the simulator on M1 I get this error for the first fat .a found: building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 I do not want to exclude arm64 arch for the simulator as suggested in some posts since I want to be able to run the app in arm64 mode on the Simulator. Also, when starting the simulator on my M1 (not using Rosetta) I am expecting it to run in arm64 mode so then it makes no sense that it complains that the static lib is an arm64 lib right? I have tried changing Build only active archs and other suggestions but nothing has helped. I also checked the fat binary used from the framework with otools as suggested by @eskimo in another post and it spat out this: Load command 1 cmd LC_BUILD_VERSION cmdsize 24 platform 2 minos 13.0 sdk 15.4 ntools 0 which I think is correct, PLATFORM_IOS. I assume the arm64 .a file that runs in the xCode Simulator is the same as the arm64 .a that runs on device right? Or do I have to build arm64 for the Mac platform to run the iOS simulator on M1? Very grateful for any ideas on what might be wrong.
Replies
2
Boosts
0
Views
3.2k
Activity
Jul ’22
Asset validation failed
Hi I am trying to upload an App to the App Store. It is a Java application with a small Swift wrapper. I build for both arm64 and x86-64 and include JREs for both architectures inside the bundle. The Launcher App: @main struct LauncherApp {       static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "drrename")       static func main() {           var jrePath: String = ""       #if arch(arm64)     if let jrePathArm64 = Bundle.main.path(forResource: "jre-18.0.1_10_arm64/Contents/Home/bin/java", ofType: ""){       jrePath = jrePathArm64     }       #elseif arch(x86_64)     if let jrePathX86 = Bundle.main.path(forResource: "jre-18.0.1_10_x64/Contents/Home/bin/java", ofType: ""){       jrePath = jrePathX86     }       #endif           if jrePath != "" {       logger.log("Got jre path: \(jrePath)")       if let jarPath = Bundle.main.path(forResource: "drrename-0.6.4-SNAPSHOT", ofType: "jar"){         logger.log("Got jar path: \(jarPath)")         let task = Process()         task.launchPath = jrePath         task.arguments = ["-jar", jarPath]         task.launch()         task.waitUntilExit()       } else {         logger.critical("Failed to get jar path")       }     } else {       logger.critical("Failed to get jre path")     }   } } I get the following error: I understand that both arm and x86 are required, that is why I package both x86-64 and arm64 JREs inside the bundle. How can I resolve this error? Many thanks!
Replies
3
Boosts
0
Views
2.1k
Activity
Jul ’22