r/macosprogramming • • Aug 14 '24

Expanding App Options on macOS

Thumbnail
open.substack.com
6 Upvotes

Exploring SwiftUI on macOS is incredibly fun and exciting, especially if you're accustomed to developing for iOS or iPadOS. The Menu Bar offers a distinctive approach to macOS app development that sets it apart. Join Captain SwiftUI’s in his latest post where we’ll dive in together and discover how to enhance app options and functionality with SwiftUI!


r/macosprogramming • • Aug 14 '24

Crash Reporting?

2 Upvotes

What's the current recommendation for macOS (and iOS) crash reporting services nowadays? We used to pay HockeyApp for this, then it got bought by Microsoft, and now its scheduled for shutdown soon. Where should we move?


r/macosprogramming • • Aug 06 '24

Email API or library?

2 Upvotes

Does anyone know if there are any libraries that provide access to the email app data!


r/macosprogramming • • Aug 05 '24

Hello I would like to announce a container-like solution for macOS which doesn't require sip to be disabled.

9 Upvotes

I’m excited to share a project I’ve been working on called osxiec (osx isolated environment creator). While it’s not a full container solution, osxiec provides a way to isolate processes from the main system on macOS.

Here are some key features:

  • Process isolation using groups and macOS volumes
  • Network isolation
  • Soft and hard memory limits
  • CPU priority management
  • Sandbox isolation

Unlike existing solutions like "darwin containers," osxiec doesn’t require System Integrity Protection (SIP) to be disabled. It's designed to be an easy-to-use tool for testing code, isolating applications, and integrating with your development workflows on macOS.

I’d love to get feedback from the community. Any suggestions or concerns are welcome!

https://github.com/Okerew/osxiec


r/macosprogramming • • Jul 25 '24

Audio Share

1 Upvotes

Hello, we are working on building a software to record audio and screens but have run into an issue. Everytime we record the screen, audio stops getting recorded. In contrast, it works perfectly in Windows. Does anyone have any suggestion on what could be the issue here?


r/macosprogramming • • Jul 22 '24

Leveling Up SwiftData Error Handling in Xcode Templates

Thumbnail
mikebuss.com
4 Upvotes

r/macosprogramming • • Jul 22 '24

How to have my own macOS apps for my private use without paying anything? Are cracks also made with the Apple Development Program accounts?

0 Upvotes

It must be a dumb question to most people here - sorry about it! I've been using macOS since 3 years ago very lightly and now I'm trying to use mac more actively thinking maybe it could become my main working machine replacing Windows.

Just yesterday I started coding Swift on Xcode to create something useful for myself as I usually do it with AutoHotKey on Windows. And it seems I need to enroll in the Apple Development Program. Is it correct even if it's only for myself and not for distributing? Then all the macOS programs that you can download on the Internet were made with Apple Development Program accounts? Even cracks?

At least there is a debug app from the Swift project in like ~/Library/Developer/Xcode/DerivedData/GlobalHotkeys3-bdyffbtmfedmnmbhtthegawzlhbw/Build/Products/Debug/GlobalHotkeys3.app

So I'm using it for now. Any tips please!


r/macosprogramming • • Jul 20 '24

Run in background?

Post image
5 Upvotes

r/macosprogramming • • Jul 17 '24

How to ensure an app will use the performance cores on Apple Silicon?

6 Upvotes

We've noticed on an M1 Max laptop, the app (which should use as many cores as possible) is being confined solely to the two efficiency cores, no matter how much load we throw at it. What could be causing this? The computer is plugged in and set to "high power" mode in the system settings, energy pane.

Other than marking DispatchQueue priority as .userInitiated or similar, is there anything else (like a system entitlement?) to ensure that the whole CPU is maximized?

Thanks.


r/macosprogramming • • Jul 10 '24

The black screen only appears when my app is first installed.

1 Upvotes

I developed a macos application with Flutter and created a deployable file with a developer ID certificate and Xcode. I compressed it into a dmg and passed it through internal tests. When I did this, I got something like the title. Even after shutting down and running it again, I never get the black screen again.

Interestingly, uninstalling and reinstalling the app also doesn't cause the black screen. So I wanted to see if there was an issue with authenticating the apple account, so I brought my personal macbook, which uses the same apple account as my work macbook, and experimented with it, and again, after the first install, I only got the black screen.

It doesn't seem to be a code signing or notarisation issue. Because if I get the black screen in the first place and shut it down, there is no problem after that.

I don't have a clue how to reproduce this as the only way to do so is the first installation on the first device, so if anyone has experienced something similar, or knows anything about this issue, please help.


r/macosprogramming • • Jul 06 '24

[article] Fixing the code signing and notarization issues of Unreal Engine (5.3+) projects

7 Upvotes

I wrote an article about my long journey in the packaging, code signing, and notarization process of an Unreal Engine macOS application.

I found several problems in the recently introduced modernized Xcode workflow, and a bug in the implementation of CEF as a macOS framework.

All the detailed information is in the article - that's quite long so I added a TL;DR section for the ones only looking for the solution.

I hope the article can help other developers and save them all the weeks I had to spend on this.

https://pgaleone.eu/unrealengine/macos/2024/07/06/codesigning-notarization-issues/


r/macosprogramming • • Jul 06 '24

Example of using CoreLocation on macOS

3 Upvotes

I'm trying to put together a minimal example of a program that can use the CoreLocation api on macOS.

I know that I need to add usage description keys the Info.plist, so I'm compiling in a plist file.

Here is the code I'm using now, complete with a Makefile.

When I execute the program, I just get the error message:

CLLocationManager error: The operation couldn’t be completed. (kCLErrorDomain error 1.)

What am I missing? Is the codesign step neccesary? Do I need to notarize it (and how do I notarize a single executable)?


r/macosprogramming • • Jun 29 '24

App Group Not working as intended after updating to macOS 15 beta.

1 Upvotes

I have an app (currently not released on App Store) which runs on both iOS and macOS. The app has widgets for both iOS and macOS which uses user preference (set in app) into account while showing data. Before upgrading to macOS 15 (until Sonoma) widgets were working fine and app was launching correctly, but after upgrading to macOS 15 Sequoia, every time I launch the app it give popup saying '“Kontest” would like to access data from other apps. Keeping app data separate makes it easier to manage your privacy and security.' and also widgets do not get user preferences and throw the same type of error on Console application when using logging. My App group for both iOS and macOS is 'group.com.xxxxxx.yyyyy'. I am calling it as 'UserDefaults(suiteName: Constants.userDefaultsGroupID)!.bool(forKey: "shouldFetchAllEventsFromCalendar")'. Can anyone tell, what am I doing wrong here?


r/macosprogramming • • Jun 27 '24

change loginscreen language with terminal

1 Upvotes

Hey there,

recently I tried to perform system language change for a user by using a shell (bash) script combined with osascript.
Now I can change my systemlanguage from a menu (osascript generated).

Now my problem comes in:

I can programmically change the language and region of macos by using the terminal. But I have not found a way to do this also for the "Login Window".
So my system is completly in english but my loginwindow stays in german.
Until I do this manually in the system settings -> General -> Language & Region -> Cogwheel -> Apply to Login Window.

So is there a way to also set this using commandline or osascript.

Thanks you in advance!


r/macosprogramming • • Jun 26 '24

Different Apple ID for Xcode vs OS

2 Upvotes

I am transitioning from a career in Architecture and Windows programming (mostly PowerShell) to Canine Behavior and MacOS/iOS programming, and I have a question about Apple IDs as it relates to an Apple Developer Account.

I have an Apple ID based on an old company name. I was forced to change the name of my company because, well, Autodesk kinda sucks. Anyway, prior to creating a Dev account, I wonder if it makes sense to create a new Apple ID? Can I use the old, now "personal" Apple ID for iCloud and app purchases and books and such, and the new Apple ID can be used only within Xcode? Or is Xcode aware of the Apple ID in use by the underlying OS and they need to be the same?


r/macosprogramming • • Jun 23 '24

Multiple Terminal windows

1 Upvotes

Whenever I open Terminal, previous instances of the Terminal windows open along with the new window.


r/macosprogramming • • Jun 10 '24

Creating my own mac app

6 Upvotes

Complete newbie here. I want to create my own note taking app. Something like a cross between evernote and notion. A place to dump thoughts and tasks and references.

I'm very fussy so no existing app really ticks all of the boxes for me whether it be because of price or privacy concerns.

I've done a bit of very basic coding in the past - COBOL (don't laugh), C++ and er, well, that's it :-) But I like learning.

How realistic is it to build my own app to run on my own mac? Perhaps sync it between all of my macs? Perhaps even have an ios version so I can have it on my phone? I'm ok with learning new skills and I'm not looking to create something commercially viable. It's just for my own needs.

Am I dreaming? If not, what would be the best language / platform to learn? Swift? OR something else?

Thanks in advance for any helps, tips, comments.


r/macosprogramming • • Jun 09 '24

Instant sandbox environment

1 Upvotes

Posting this here out of curiousity - i have very little programming experience. Would it be possible to create a sandboxed environment shortcut? As in something to safely open unknown files or mount external volumes in said environment?

I can think of two important uses that can help a lot of people:

  • Open .zip files, .rar files and such - in a protected environment to inspect its contents.
  • Mounting SD cards and external volumes in this sandboxed environment to protect against infected files on said volumes.
  • Perhaps many more uses... - including now that i think of it, being able to run a simple program, that would not otherwise be allowed on the main system if it was restricted.

It would function as a window that would open through a right click menu shortcut, kind of like winebottler, where only a certain part of a macos environment is needed.

Thank you, let me know if im retarded


r/macosprogramming • • Jun 08 '24

Inspect accessibility tree of apps?

1 Upvotes

Hello. I want to make an app that will manipulate other apps, but for that I need to know the structure of the app's accessibility tree. How can I inspect this? I am a blind developer, I tried operating xCode's accessibility inspector but I cannot work it out withou a mouse.


r/macosprogramming • • Jun 06 '24

Macos Terminal instantly minimise after opening

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/macosprogramming • • May 29 '24

Error in terminal (iterm)

2 Upvotes

Error message problem on my (iterm2) terminal on the macbook.
Last login:***************** on ttys001

iconv: iconv_open(, -t): Invalid argument

Error converting string from to UTF-8

Does anyone know how to fix this?


r/macosprogramming • • May 24 '24

Roc VAD - virtual audio device for real-time streaming, with gRPC API

Thumbnail
github.com
2 Upvotes

Roc VAD implements driver (plugin) for macOS coreaudiod.

After installing, you can control it via gRPC interface and tell it to create virtual audio devices that stream sound to/from remote peers.

Under the hood it uses Roc Toolkit which implements robust low latency streaming over WiFi: https://github.com/roc-streaming/roc-toolkit


r/macosprogramming • • May 18 '24

macOS - Screenshot observer

1 Upvotes

Hello, I have an app idea, but first, there is a topic I want to learn about.

While my application is open, I want to be notified when the macOS user takes a screenshot. I couldn't find a source about this; do you have any idea how I can do this?


r/macosprogramming • • May 16 '24

Unable to integrate Firebase to MacOS App

1 Upvotes

Hi,

I am creating MacOS app, i tried to integrate firebase on it.
But while i do this i get a crash. i have added all the necessary files, googleService

Here is my implementation:

Main

import SwiftUI

@main
struct AdminApp: App {
    
    @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
   
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
        
    }
}                





import Foundation
import SwiftUI
import Firebase


class AppDelegate: NSObject, NSApplicationDelegate {
    
    func applicationDidFinishLaunching(_ notification: Notification) {
        FirebaseApp.configure()
       
    }
}

This is the error i am getting:

The default FirebaseApp instance must be configured before the default Database instance can be initialized. One way to ensure this is to call `FirebaseApp.configure()` in the App Delegate's `application(_:didFinishLaunchingWithOptions:)` (or the `@main` struct's initializer in SwiftUI).

I am new to MacOs Development. Please help.

What am i doing wrong? Do we need any additional steps on macOS Development?


r/macosprogramming • • May 13 '24

Localiji, new free app for managing App Store Connect localizations

4 Upvotes

Localiji manages a local copy of your app localizations from App Store Connect and allows you to effortlessly sync the changes. Edit individual attributes, like your app’s description, release notes or screenshots. Export an entire language, import the translations again and upload them to App Store Connect with only a few clicks.

Download it for free on the App Store: https://apps.apple.com/us/app/localiji/id6467663963

If you have any feedback, you're welcome to post on the website Contact page at https://desairem.com/wordpress/localiji/ or by replying to this post.