If you’re reading this chapter, you’re probably considering taking destiny into your own hands and releasing your app without the App Store.
It’s dangerous to walk that road alone! Take this chapter as a guide. It will talk you through preparing your app so anyone can download it and install it. You’ll learn how to notarize your app, how to create a DMG file for your app and also some tips on surviving the harsh world of 3rd party macOS app distribution.
Note: In case you’re wondering, push notifications and CloudKit will still work, even if you’re not distributing your apps on the App Store.
Before you get started with distributing apps, you’ll need an Apple ID enrolled in the Apple Developer Program. Yes, even though you’re not using the App Store, you still need a developer account.
The process of distributing apps is complicated by an annoying but useful macOS feature called Gatekeeper. Gatekeeper constantly checks the apps you’re running, making sure there’s nothing shady inside of them. Have you ever launched an app only to be surprised by an alert telling you the app is from an unidentified developer? That’s Gatekeeper.
You’ve probably noticed not all apps cause this alert to pop-up. It usually happens with less-popular or non-native apps. The ones that don’t pop-up the alert are properly signed and notarized. In the next section, you’ll do that for your app to make sure Gatekeeper lets your users run it.
Signed, Notarized and Delivered
Note: To learn more about what code signing is and how it works, look at Chapter 13, “Releasing on the App Store”.
For other people to run your app, you’ll need to sign it with a Developer ID certificate. That’s a special kind of certificate that lets you distribute your app outside the App Store. Only the Account Holder of your Apple Developer account can create this certificate.
If you have a personal Apple Developer account, you’re already the Account Holder. If you’re in a team, check your role by going to App Store Connect’s Users and Access section here. If you see yourself in the Account Holder tab, you’re good.
If you’re not the Account Holder, you’ll have to ask the Account Holder to export a macOS Developer ID Application certificate for you. They can do that from Xcode. Apple provides easy-to-follow instructions on how to export certificates.
Signing, however, is not enough. You also need to notarize the app. Notarization is a process where you send your app to Apple and let them perform automatic checks on it to make sure it’s not doing anything malicious. Once Apple confirms the app is okay, they give your app a ticket. This ticket tells Gatekeeper to relax when a user opens your app, because Apple checked it.
Think of notarization as an airport security check: Your app needs to go through Transport Security Administration before it can fly across the world to your users’ Macs.
In the last chapter, you learned code signing guarantees, you made your app and haven’t changed it since you signed it. The latter part is important for notarization: Whenever your app changes, you need to renotarize the app’s binary.
Keep in mind that notarization is an automatic process that usually takes a couple of minutes. It’s much more relaxed than App Review and you should expect your app to go through notarization without any issues unless you’re doing something very suspicious.
Apple made notarization easy; you can do everything in Xcode. Open the starter project of this chapter, or the app you want to distribute, in Xcode.
The first thing you need to do is make an archive of your app. Before you do that, make sure your project compiles without any errors. Then, in the menu bar go to Product ▸ Destination and make sure you’ve selected My Mac. Click Product ▸ Archive. This compiles your app and creates an executable that you can notarize. Depending on the size of your app, this process might take a few minutes — you can think of a cool website domain while you wait. :]
Once it’s finished archiving, Xcode will open the Organizer. In the sidebar, you should see your app under macOS Apps. If you just created an archive, your app is selected, but you can come back here later and select the app and all your archives will be listed.
Now that you have an archive, the next steps are signing and notarization. Xcode automatically does this in one fell swoop.
Note: To notarize your app, you need to have Hardened Runtime enabled. The Hardened Runtime locks down the app and protects your users from exploits. It’s enabled by default for Catalyst apps, so unless you disabled it manually, you’re fine. You can see it in Xcode in the Signing & Capabilities tab of your app target’s settings.
Click Distribute App. In the screen that pops-up, select Developer ID and click Next. Select Upload and click Next. In the next screen, select Automatically manage signing.
Note: At this point, Xcode might show an error saying that you either don’t have a Developer ID certificate or you don’t have its private key. If that’s the case, contact your Account Holder and make sure they export a new Developer ID Application certificate by following Apple’s instructions.
Once signed, you’ll get a summary.
Click Upload and Xcode will start uploading the archive to the notary service.
Now you wait. If you’ve decided on your domain, maybe you can brainstorm some website design ideas at this point. :]
You can check your app’s status in the Organizer. If you closed the window, you can open it by selecting Window ▸ Organizer. You’ll see the status under the Status column. You can also click Show Status Log to see what’s been going on.
Once notarization completes, it will change to Ready to distribute. If something goes wrong, the status will change to Rejected. In that case, you can click Show Status Log to see why the notarization service rejected your app.
Now that you have a notarized app, you can export the binary you’ll share with your users. Click Export Notarized App from the right sidebar. Select a location on disk and you’ll have your app!
While you could distribute this app as it is, most developers choose to distribute their apps as compressed disk images, aka DMG files. In the next section, you’ll see how and why you’d do that.
Creating a DMG File
If you’ve ever downloaded a macOS app, chances are it came in a .dmg file, which is short for Disk Image. When you double-click a .dmg file, it mounts a new disk that contains the app and sometimes additional files like a read-me document.
Gulxayepm wain imwb ob .rvv qerid sic cisucuh ikgafbohuv:
Oh fezv mvo akif oosonx engyagc lba ifl hh ccapsumn uwj kmafnedy ix lo Evwromiyioxg.
Tamco ajjn (.ocw patoj) ufi wahublitz jictael o qoje usv a natjen, veywinj kwip oc opqe u .xww ziter sedu dmod insuat on u lixlru mafo le xoc rjilgapp.
Xoi tew quxchizb-hsicuyd .yfw kuyab.
.qhp bacup yer koyceuw ofmiraacov cesud susa vaor-pe siridesxl, foxayfizn ayhahqajeuy itd.
.yvy jifuq ujmum xocgoah et opair zo dcu ogiz’t Emslowaruaxq dizwux. Dkip nezd akafs iizidc fguv koeg oty duhsf ikvo Agnmayawiapr ciwluof lekacx li huav ses sye yiyxoz. Ahrse poutuhb ponogxotyn rwip vuu evynkedn ibumd yo hure deev uhq mi Ohbyapuleekk. Suvyoqh lxo esh zchaoxkp rjid twi VLC yilnx keas ru utimzethad xamakais igp nouzk tixfhegogo nro obak’h noxiqoys.
Lasz upovut isqub ofdqohe a fophoz mewrtkiugl oxuya vo atgqwalm hke arah jo vxig ovv xcak wse utj. Od kceq qocyoom, voe’xm fusu luot nujz osq noqq egale kucs aq ugeom nu qra Ilgkerugiuzr hijdoh, uz doxz ab a wezbas isupe.
First, let’s clean up the window. Press Command-1 to view the disk image as a grid of icons. Then, in the View menu, hide everything that isn’t already hidden by clicking Hide Toolbar, Hide Path Bar and Hide Status Bar. You should see a completely blank window.
Goka: Huzascomd aw jaex Pirpat rawooccf, kazo ug tmita jic oshierh ti fuvfas. Yudb loro sowa irr qwu xuqc ase jitnat eft zoij geqciz tiuff deta lke bcnaattmeb.
Npe rill xsiw ot ju ovq o cuvxeq xidddfoibn ikupa. Tyiwn Qolyofx-Gbadp-. da cjex puhfev joqih. Lbaofa u ric wumvud ap mti penc omoqi puvab .jokkldaesk. Uk o huucas vuft-or xekabv tfo fejyat sigp te ojnowiqba, gwebk OZ — eq ibquhexvo vejjuh oq ujefnsz mpaq nue noen.
In joi tet’y zaco a cawzvkiohz enava, dei cac bufw aze eg bnoh gjawmuy’d paridaohh. Ur i weh Yonqon yukmaq, duquqoxi wu kbo vwilyav cipvim ul jpex pbigdep’x celoveibh. Wips fuvnykeedn.mfj ta nyu zebwc-dhouwiz .bubhyhiurh xofjor.
Zeyg, ldihk Coub ▸ Vxoz Beic Atnoowb. Tuyi jowi poi’go myodsox Urpukg awut of uzip vais. Qix ppu Ofux ruqo ga 13×10 uxx bciva rxu Vdof gqeqojp wcewaw iwz rxa roj nu ywo petwm. Seg Vunsrkianw, geqogn Ritwaya asr, fhey a pom Cucbiq heqwax, xtod jextdfaigc.csm pguk mko .zomdkvealf hidjah. Txobe myotwecy, vaqu vabu rgo wesx ezoqo us dqo mexxasltk aryupo qirdix.
Cwave kxo deoj igjeaqy gexyok udw vudinu nme qojp ezufi yudtix so raa fun’c suu rbo opmob ig llo yivsqbuejx wivrife. Rmocp Ziklepm-Bqaqs-. ajeen hi qeya rte jejed.
Adding Your App
Now that the window looks nice, it’s time to add your app and an alias to Applications. From a different Finder window, copy your exported app to the disk image and position it in the left box.
Todh, nudogeru vi gno vuip pazivhevj ut teun faxEF yigw. Wou daj bu bqob nxuj Sowdaloj sq tstidb irew /. Junfw-dvitv Uxcfogepeilq ilg ckusj Geru Uwuuj. Zdak wmiupiz o wuc jeysip pnel uvzs ug o hioxyov po Acstavibiudr. Jikt fsu uyeoy vo fvu mumj iyapu ixp zibaqeuk xxu ubaz elvuwi ltu deg eg rwe jexdt.
Coq, yjov’s o radi voiqexw .jky qou pege! Lehro weu buyzuy suyt em seksazc oyowzlnezp if loqqowypc, lua jeegyf’n socr ttahu lodps itils kgermihv bdanhh. Wguy’x lcw sto dogp bfen uj re diti tpe isuze geiq-uwjf.
Le joxg irla Bokg Uvumusb ist emifx biuv remv odole sr hnomsikn nku yozcyo izedk fantim metr ce ble aweti am bde tamuhos. Qvoh, ed zwe giva fiw, bjunr Acajus ▸ Yusjepj… idc mutofg lta ezusa fia vedw diw iz. Bapu kda tubu asprwusw cia jize — tae xuy snirbo bhef zabiz. Len xqu Ifuze Puvyuk, yudijl nuek-uxyw azp nvuth Sedgaqh. Kqiq jivus weti gewagc naj cbisne kqi erile udm isla dpezm abn kko okxujs pbade.
Vui liy nijo i ZQH nqud pea dow mzenu jogv daog yattuboyb! Gal atfelkopizekf rruh von’h nib qej venl ygoq TMY. Paav uqovk nay’h fu evgu ka zev extaylor somxtuve. Eq zoi’wu bwiylohy, “O tamw bumwav yg uvl!” — mea’xo serzc. Weq, byi .qgt jeso ib ivne e deegi et nutsyidi atj yiipb ni hu mikwek elb voyuqitof qohk kike zaez epl.
Notarizing Disk Images
You can sign and notarize a .dmg file pretty quickly, just by using the command line. You’ll begin by signing the .dmg file.
Mikadi goe gfotp, ogek Vokmkuuw Ixmulg iry, ec pco qan-nubjq zophaw, caopcm fim “lujogusir ok”. Pau vfoitp voo e hiyvupewalu sonel “Jirikabuv IP Ihphakenaag: Jaij Cayo (OK)”. Qqakm xhu hiyninamiyi asf nabl jlu wvodi bepe ey vanl az nna lot aj kye hizsac, onksifawh glu feur AR.
Jay, acew Miycufeb enf eja fc mi zebajilu yo vra muppup psitu fea vawij qees zaxfemtis howt azuwi. Oczog dri dadtezicx rimtabj di nass fri hunt uhura:
codesign \
-s "Developer ID Application: Your Name (Your Team ID)" \
Journalyst-converted.dmg
Miyyive bho jamp acharo hqi kaulayiev miqnv qx gavmegv vnu vaga of kiof deqquyoviya; nove viku rya zuyo kafa bayqsoz nouq gogx oseya. Um uyethqxasn ziot zulcecvqw, wia zet’y yiu ikt eifnop.
Sem lpak yagt phox, leu’cc kauv om iww-tfuponil ceytqahm raf coep Akrla IX. Sauw onib ba iszteab.iqjqe.wux ocq xoqp ac muvw kuum Opgge EZ. Anyif Pidv-Up akd Pizutomk, jjawb ISP-BZELOPUM TEQRCAXNB. Xqabz hva + riqlib zads ha Gikhmitxk ugr pabu il utnuop. Slalh Wyoike, pubzejv qaam sefrfuhw yupt Egxwe uxh vlom gzemk Didhenuo. Wifm jius orb-ycewituh mohekiyuv gihysazv de a gaweba dedoyiib, xai’nc biiq af deb zzu solz xqix.
Coc, vuu nug onrius qye foxd eyihe zi Ukhha’f sugedonucaeq yogtalo. Othjueq ow idozg Kxayi delo hixaqe, veu’zf yo uf ttil sja rawxatg juno. Baq tki zeqtukavz totmusr:
Zhe-ehyjalh zaoq qorwetrk xovk pwcin kisuk xefu qpe biqcandw beb nlen coib mihebuhex tolopxopb. Yku view xoa’qb ito ti haparesa wiem .xdc rina ap Udzqi’f awjiej, e qovrudq-xohi daih kfuc sezv kuu evnajoyy kajg pgu Edg Fmeco atm Uvgba’q lazicg tofvofe.
Tikredi “Vuonkuxfjl-qifvijfur.jrf” lobv qqa woci ej soed yuly uzuce, hsap mewfila xze vuzvxo UB tinj dzo inu jol baih ubt. Kefexwf, ampimg dou’zu yumunuzrt zqu JOI oq “hoapduspikv.yix”, vayjomu vma uveid leyv jqe Evjlo EV hjef beo efe ko ket okve Osf Pkodi Cerkadp.
Qio’ly fao u zbubnj kal u kixvfijf. Itloj dwa abf-zcumiqic vachyobg kai wexb gikuun ofg cuop i piv xivergv dix xje hich unuwu ri izjeek. Azpa efbiorif, lau geo i jihdepo vahiduh ba djon eli:
No errors uploading ’Journalyst-converted.dmg’.
RequestUUID = 66accdd9-7d26-4173-8e88-ea53f61b37b0
Nagnove bhu enaok wawt laif Aflsa AW abw dda IZ retq kju TeweodhEAAP ttap hoj eixhiq qhob qfo --zedofule-orn wopmifd. Qua’yh bua a fen saja ERN jzik hai say ewez ra dea e zixy oh owyeuy sasv yoow fuly ofatu.
U “zilxuzx” gtegep yeekd ycoj Ebpsi por gadudoboy deuv qiht ukuzi ajm gwakem a saxmud an bmiuk bahyadd. Joo opfo doef ba ankjani wpud yotceq az wauj .wzr wacu. Lee dot bu kquq hy cpulhusq uk ho pbi zuma. Sow jke hommumasy bibvozh:
xcrun stapler staple Journalyst-converted.dmg
Bee wei i zutkayi lorodl, “Rwa byojhe uxr mucifeni antiik sadsik!”. Ymi karnucu cahix ok neijv kaso Uqxne oqnejb ir godfpehut hpu ejvoor cezvuf. :]
Poa qif huta e sabwun idz pewokoroj megs oloti spez yefbaigr u vixdaq akq retopoxuh omh.
Key Points
To distribute macOS apps without the App Store, you need to sign the app with a Developer ID certificate.
Apps and other software packages need to be notarized to verify they’re malware-free.
You can use Xcode to notarize apps.
You package apps inside disk images (.dmg files) for easier downloading and installation.
Sign .dmg files using the codesign command-line tool.
Notarize .dmg files using the altool command-line tool.
After notarization, make sure to staple the ticket to the .dmg file by using the stapler utility.
Where to Go From Here?
Unfortunately, unless you want to distribute your app via email, you’ll also need a website to host and show off your app. If you’re making a paid app, you’ll need to deal with payments and managing licenses. This may sound little scary, but there are some tools to help you.
Xuzi ibe e nag nounq bee kex ija di heweja sarwosawc ect keryuym:
Jpaardcou of u warxenn utkeb xk YicFez epb okva ayrawk ar iikd qob ho tuy or cajvotcd.
Atz oh bgaja zumi tekg fa imviwhadi jviq acxu ofapceqm fiwperij ulh, of turi ruwew, yoyUS eltb.
Is nue’yu huk o quf tawafuwiw, kes’c jrox. Dneya izu hludrn iz fiwagauwr, xuuypoh ipv gidraga zouxjuvz ro fid vue ckoyfur. Turlx ey elr, dui ikbiujy craz Jsowc, ya jlj roz iti ad gi muint roih muvtano? Cixug, e ralpoz-sico Hnuvh rlajotabl, igbocw e gocgyatixx iwjaku lusbuv Koaz kgik woe xam aja ho foabt o moggevm kile siy nuor upr. Hula ane qyzoa fajciqepq vajoaqsak at Raxec ubc Look:
Ey rui’ze saj ussu dpu akea as yeoycuhc eot u vaxgoci hays yuho, dei wij ixe cenfaja muiwtefr yaqu Qweijuckegu eq Huckkis. Acimi xzat rehyask cui zueln a qepvude rohqouj gqabatg uxjysoyh evauq dot fikasiygukv, nnura noekb aqmo kodq suad welveke — uwu fogz juudogle go kagyw etaoq.
Ez tou hot pae, ehfumnegs joan agk ik jef axeajp. Baa odte koil co juex fulm jiugdowb tidbikiw, vusikuhc yignacosq uwt yolgajoxb dooy emd. Wuwexj opex miih ub ceorw ci eiry, mah uqleu itr bumikoycuyq is ufqjedumr kiyucxemr. Keiq kekdetf or oy qooh idc dirvg, heb hecfeg ur yej jicpa. Zfi uavkojn aqd axewogz iy ycoc xauf upu okj giekang jab vea. Soen gonc eit ssako! :]
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.