Demlin and Marzipan Marzipan lives in the kingdom of Lunarlem where she works as a Knight, defending the castle and her girlfriend, the Princess Demlin, from enemies from Sorlen. One day, however, you find that someone from Sorlen. Apple Marzipan could mean the end of macOS. Because it sure ain’t going to spell the end of iOS! Apple Marzipan is a project to bring iOS apps to macOS and perhaps vice versa. Marzipan was first shown at the Apple Developers conference in 2018.
Long-term, the end result of Marzipan could be huge changes for the desktop OS, and for customers. This year’s WWDC answered many of our burning questions about Apple’s commitment to the Mac. If you're looking to make a great modern Mac app, Marzipan isn't for you. If you're looking for an easier way to share UI code between your AppKit and UIKit apps, Marzipan has nothing for you. If you have a relatively simple iOS app that you think might be useful on a Mac, Marzipan.
EDIT: July 26, 2019
WWDC 2019 brought us SwiftUI and Catalyst. As such this article is not relevant anymore. Feel free to look at the documentation provided by Apple and have fun with these new tools!
EDIT: January 13, 2019
The approach outlined in this post is now outdated. For easy tinkering with Marzipan I suggest you use the amazing Marzipanify tool by Steve Troughton-Smith.
Introduction
At WWDC 2018 Apple stealthily unveiled a new way of creating macOS apps — a rumored long-running project codenamed Marzipan. This was not an official announcement though, just an introduction of a couple of new apps in macOS 10.14 Mojave — Stocks, News, Home and Voice Memos - that were previously only available on iOS, and there was a quick mention of how future iOS apps could be ported to macOS by Craig Federighi, Apple's senior VP of software engineering.
Marzipan is still very unofficial, very beta and should only officially be released in 2019, but with some effort, we can play with it today!
So without further ado, let's take an iOS app and make it run on macOS!
The app
For this post I prepared a very simple app — that allows you to fetch top stories from Hacker News and present them in a simple UITableView
. This app is simple as far as functionality is concerned but includes some standard plumbing and networking to see whether common libraries can be used on macOS. The good news is that this is indeed possible and we can use libraries like Alamofire, Swinject and others without any special effort! Just make sure to review the dependencies of the libraries you'd like to use, as they might link to frameworks that are not yet available on macOS.
Preparing your macOS
Since this is very new you will need to install beta versions of macOS and Xcode. Specifically you'll need:
- macOS 10.14 Mojave (Beta)
- Xcode 10 (Beta)
To make your Marzipan app run, you unfortunately need to disable some security measures running on your macOS.
I highly suggest you re-enable these security measures when you're done tinkering with Marzipan or that you play with the framework on your non-primary Mac.
First, you need to disable System Integrity Protection. SIP is a security measure originally introduced in OS X 10.11 El Capitan that simply, restricts what parts of macOS your app can touch. Disabling SIP is required, because as you will see later in this post, your macOS app must use a new entitlement com.apple.private.iosmac
that is currently internal to macOS.
The second thing you need to do is to bypass AppleMobileFileIntegrity Kernel Extension. AMFI is a security measure that instantaneously kills any app that uses restricted entitlements, and com.apple.private.iosmac
is indeed a restricted entitlement, so AMFI must be disabled.
To nuke your Mac's security you need to follow a couple of simple steps:
- Boot your macOS to Recovery mode (hold
⌘+R
) - Open Terminal (you can find it in the Utilities drop-down menu)
- Execute
csrutil disable
in Terminal to disable SIP - Execute
nvram boot-args='amfi_get_out_of_my_way=0x1'
to disable AMFI - Reboot your Mac and boot to macOS normally
Now that we're done reducing macOS security to shreds we can play with Marzipan!
Making an iOS app run on macOS
I have prepared a GitHub repository with an app that runs on both iOS and macOS with exactly the same codebase. You can find it here: https://github.com/jankaltoun/TastyMarzipan.
The caveats
Modifying an iOS app to run on macOS is fairly easy. It mostly involves a target-build configuration. There are, however, a couple of caveats that need to be taken into account.
So far, I have not been able to port an app that uses Storyboards and Nibs. This is because Xcode will refuse to compile iOS Storyboards and Nibs when targeting macOS. From what I heard from the folks lucky enough to visit WWDC this year, some new apps use Storyboards, so this must be possible. Just maybe not with the tools that are available to us right now.
If you know how to use iOS Storyboards/Nibs with Marzipan please let me know. I'd love to figure this out!
My example app defines its UI in the code.
I have run into issues with some UIKit constraints. For example the following code in the NewsCell.swift file builds and works in debug mode but crashes when you run the app outside Xcode.
You need to use a macOS UIKit
framework that is not easily obtainable. Fortunately there's an awesome example by @biscuitteh available here: https://github.com/biscuitehh/MarzipanPlatter where you can obtain this framework.
Modifying and iOS app
Let's describe the steps needed to make your iOS app run on macOS. Hopefully if you follow all of them your'll be able to reproduce my results.
Start with a new Target
Open your Xcode project and add a new target. In Build Settings update your Base SDK
and Supported Platforms
entries.
- Base SDK: macOS
- Supported Platforms: macOS
Your code signing will most likely be messed up in the General tab so you'll need to fix it. As a simple test, unchecking and rechecking Automatically manage signing
should be enough.
You will also need to modify the auto-generated Plist file to match a macOS app. Feel free to grab a copy from my example project.
Finally, you will need to update your Podfile with your new target and platform. In the end, it will look something like this:
Link to macOS UIKit
As mentioned above your app won't compile without the macOS UIKit. Grab a copy from here https://github.com/biscuitehh/MarzipanPlatter/tree/master/Frameworks and copy it to a directory within your project.
Now back in Build Settings update Runpath Search Paths
parameter to point to your frameworks directory.
In the Build Phases tab, add your UIKit framework in the Link Binary With Libraries section.
Add forbidden entitlements
We have already nuked our macOS security so let's add a couple of entitlements to make the app work.
Create a new .entitlements file and add the following code to it.
Do not forget to update your Build Settings so that your settings know about this file.
Add a magical environment variable
To be very honest I am not very sure why this works but an environment variable CFMZEnabled=1
must be used whenever you run the macOS app otherwise it will crash on weird assertions and UILabel
s will behave weirdly.
Add it to your scheme and don't forget to use it when you ran the release build as well (more about this shortly).
Build and run your macOS app!
This should be it! Select the scheme that was created for you by Xcode when you added the macOS target, hit the ⌘+R
and behold! Your macOS app is running.
To export and run your new app firstly archive it:
xcodebuild archive -workspace 'YourApp.xcworkspace' -scheme YourAppMacScheme -archivePath ./build/YourApp.xcarchive
Then export the archive:
xcodebuild -exportArchive -archivePath ./build/YourApp.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath ./build/
Your ExportOptions.plist file might look like this:
And finally run the app with a magical environment variable:
CFMZEnabled=1 ./build/YourApp.app/Contents/MacOS/YourAppMacScheme
That's it!
As you can see converting your iOS app to a macOS app is not that complicated — we made it just by following a couple of fairly easy steps.
When Marzipan finally comes in 2019 I am sure many of the issues mentioned in this article will be resolved and I feel that creating macOS apps will be incredibly easy for iOS developers.
I'd say let's prepare for an App Store explosion, as we'll see many new macOS apps made possible by Marzipan.
2019 will be a good year.
A downloadable game for Windows, macOS, Linux, and Android
Marzipan lives in the kingdom of Lunarlem where she works as a Knight, defending the castle and her girlfriend, the Princess Demlin, from enemies from Sorlen. One day, however, you find that someone from Sorlen has kidnapped your beloved while you were out patrolling! You have to try and save her before her kidnapper gives her to Sorlen, kills her..or does something far worse to her.
Demlin and Marzipan is a game made in Twine by Livia Langley (Sleepy Dreamer). The cover art and inspiration for this game was taken from the artist Scott King (who is peabug on Tumblr).
Since it's a Twine game, everything should work smoothly, but if you have any problems, please feel free to comment here or email me at livialangley@yahoo.com! I'd be more than happy to help you out.
Damelin And Marzipan Mac Os Catalina
I hope everyone enjoys playing this little game about a Knight and her girlfriend, the spirited Princess.
Damelin And Marzipan Mac Os Download
Status | Released |
Platforms | Windows, macOS, Linux, Android |
Rating | |
Author | Sleepy Dreamer |
Genre | Role Playing |
Made with | Twine |
Tags | LGBT, Story Rich, Twine, Yuri, yuri-game-jam-2016 |
Average session | A few hours |
Languages | English |
Inputs | Mouse |
Download
Click download now to get access to the following files:
Log in with itch.io to leave a comment.
does not load on internet explorer, so you just have to copy paste the web address into chrome or firefox.
unless you figured out how to make either of those the default, in which case, tell me how because i don't know how to do that ouo
You have to make either Chrome or Firefox into your default Browser. Go into your Browser's Settings (Accessed via Dropdown menu at the top right of the browser) and there should be an option to do just that. Doing so will make it so that downloaded links will open in that browser.