Anyone familiar with my ramblings will be aware that I mostly develop in C# using a mixture of Xamarin and .NET Core depending on what I’m building. Earlier this year I took the decision that I’d be serious about learning Swift and got started with building a simple utility app for macOS to help me find training images for some machine learning.
The app has mostly just sat on Github with little love since I originally published it, so this week I dusted it off (I actually just cloned it again from Github but I like the metaphor) and started implementing a few of the features that didn’t make it to the first release. The most obvious is file tagging, which makes it possible to add file system tags to exported images, for easier discovery of exported images.
20 hours ago I’ve developed a MacOS app (Swift/Objective-C) that generates music visualisations at 60 FPS. I would like to integrate the generated “video” into OBS (obsproject.com). I’ve tried using “Window Capture” in OBS, but it doesn’t capture the window at 60 FPS. See more: need simple job, simple net send app, simple timesheet web app, apple developer, swift programming language, swift programming language pdf, macos app development tutorial, xcode, xcode tutorial for beginners mac, swiftui, swift tutorial, need textbook solution, develop simple web based app updates database, sugar crm need simple. This usage is included in the sample app found in the stream-chat-swift repository. Long pressing a message on iOS blurs the background and shows a context menu with a set of actions that you can perform. On macOS, this translates to a control-click, which shows a typical macOS-looking context menu with the same set of options. In this macOS development tutorial for beginners, learn how to create your first “Hello, World” app with Swift and take a tour of Xcode. By Roberto Machorro Feb 22 2017 Article (20 mins) Beginner. AppKit contains all the objects you need to implement the user interface for a macOS app—windows, panels, buttons, menus, scrollers, and text fields—and it handles all the details for you as it efficiently draws on the screen, communicates with hardware devices and screen buffers, clears areas of the screen before drawing, and clips views.
I shared a gif of the new build with a colleague, and he loved it so much that he wanted a copy. Now I could have easily have behaved like an animal and built a version on my development machine and sent over the results, but instead, I opted to listen to the sane part of my brain that was calling for me to set up a CI/CD pipeline.
Enter Microsoft’s App Center
If you’re not familiar with App Center then you’re in for a treat! App Center provides a one-stop-shop for services that app developers will likely need. This includes building, testing, distribution, analytics and crash reporting to name a few. Today I’m going to focus on the build aspect, but I’ll cover other features in upcoming posts.
Microsoft has been working hard on adding new features to App Center, and one of those new features in the preview is the ability to build Swift macOS apps. The setup process only requires a few clicks, and we’re up and running. Below a gif of the process recorded in real-time which shows how quickly I managed to get a build setup and running.
App Center Build Setup
To get started we have to create a new app within App Center and specify a name OS and platform as a minimum. In my case, I only really need to worry about selecting macOS as App Center currently only supports Objective-C and Swift as languages for macOS app development.
Setting up the build pipeline
Once we’ve clicked “Add New App”, we’ll be presented with a screen encouraging us to integrate App Center SDKs into your app. I’ll cover the advantages of this in another post as it’s not needed to use App Center. Did I mention that every feature in App Center is optional? In the post, we’re only going to use the build and distribute functionality and ignore everything else.
Build Configuration
As mentioned earlier in the post, the code is hosted on Github which is integrated with App Center. This allows me to connect App Center to the repository and anytime I push to a branch I can have App Center automatically trigger a build.
Once I’ve selected Github I’m presented with a list of all my repositories for me to select which one I wish to link to my App Center App.
In this example, the repository only has one branch so I’ll select that puppy and move onto configuration.
Swift Playground Mac OsBuild Configuration
We want to do a few things with the build configuration. Number one, it has to sign the build for distribution using my Apple Certificates and secondly I want to increment the version number of the app automatically.
Signing builds
In order to sign builds for distribution, we’ll need to upload a copy of our .p12 file and a valid provisioning profile.
Swift Ui Mac OsIncrementing build numbers
App Center has native understanding of our projects info.plist file (thanks to the work they did on supporting iOS) so incrementing the build number only requires a few button clicks to configure.
Distribution
We’re almost finished configuring the build process but we’ve one last step to configure and that’s distribution!
Swift Mac
By default, the distribution list is a little lonely as it’ll just be you, but as you find people excited to try your apps you can add them to lists and control what versions of the app they get. For example, you might want your VIPs to get GM access and staff to have access to betas.
Adding distribution groups
To setup my VIPs distribution list I head over to the “distribution” beacon on the left hand menu and click “Add Group”. Top 5 best mac apps free.
Right now I’ve only one VIP and that’s my colleague Dean but this is enough to demonstrate the functionality. It’s worth noting that I need to pop back to the build configuration to update the distribution to VIPs if I want Dean to get a copy of the builds triggered from Master.
Distribution email
And with only a few clicks, my users will now get a nice email with a link to install the latest and greatest builds of my app!
Macos App In Swift AppConclusion
App Center is a powerful tool for app developers to streamline their development processes from building, distribution to monitoring after release. I hope this post has helped you understand how easy it can be to set up a CI/CD pipeline for macOS apps developed with Swift 4.0. https://strongtree347.weebly.com/blog/clipmenu-app-for-mac. If you’ve any questions or feedback then please don’t hesitate to reach out.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |