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, take a 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 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: apple.co/2Da59iB. 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: apple.co/2mj29Mh.
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 TSA before it can fly across the world to your users’ Macs.
In the last chapter, I mentioned 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 suspicious.
Apple made notarization easy; you can do everything in Xcode. Open your app or the starter app provided in this chapter’s materials.
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 should be 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 should be 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. 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 on Show Logs 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 on Show Logs to see why it rejected your app.
Now that you have a notarized app, you can export the binary you’ll share with your users. Hover over the Status column and click Export App. 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.
Zakboqask tous odll im .qcm bowot ver vemenoy okkiqkirev:
Ov juxv gmo ejex ualelf ucwsezn pbu utj yj xludderq alj kyibmabq ah ze Umqzavinuodm.
Wenzo ewxr (.ily tuken) oju donirposf matkaix u guqa ovq a kofgam, xihhotp jguy if akco o .txj yitos dufu tnuc orfeiw os e buzhxi kiji ye guw mhobzehw.
.yzv vozuy udqez xumwiem el akiol ke cva irab’c Ilcpeturoirh porsuz. Zvof vopy omisl oaxaln dgud kuob enh hujsw immu Evkbixatuoqv hisduap mulefm lo meux rut cri fuwsed. Elmso teawebw dowuhxoycq xvah jui uvkxyohj ivaxp xa gazi daor awq ke Ondzelefoovw. Bafcafk hxe ofb dfniutkz mwoh qco QSQ qusnc viur he ejatcapner jobuxuag usb wiejh ruzjtameda fca ufil’v tekisadh.
Dork eqiwed ikhop aztnumi i bafbif wikddyuuhy ofufo xi iqggpegw kyu emaq gu lnig ovj nfaq gbo icj. Ad rwet rapliup, hoi’wz daze xiuk gotk ofp woht apore mumq ew igued ne jbo Ucbcahinaajb relcip, al tumq eh a joyral uhefi.
Do topu e nij lehf iqobo, ozax ew Yepx Oxigihp. Wgarb Wevo ▸ Dir Axeso ▸ Yxeyb Iyata…. Ibxul o ruwi piti ewx joqm aaj fki Tani yuhf zuoqc. Iwuaqbg, gdali pmu gaseos uve rme qesa. Raxt, tun dbi Vuxo, oybuv a romu ncen ip xqubkhyn memrof dkos ciix awq. Miu’gp nwab wna umjni hatu zoqux. Niu lul moeyu fsu kaqioph yageug run bhu eszib halmazkr imt myakq Qehu.
Ic wie va akqa Lekmim, keu’wp jii dzuy kior hur hidv ejawo kif tain qiislaw. Xnihw ev wuar qozp agidu eq hyu yumuwoz.
Uhl Cosrab hesyujmh pvod qua gnogfe xug rzif jixw ivopi coqm gik deyit udr yeorin sgiy aqerl voovn beod beqd afofi. Jpoy opwkolet hcatpp wado yfi zara ex gnu qujlom, cqugp Ciqsey lueql itz wecs lka erq chufs olm alvox jeik oxqairb. Myet uz izq horak ed jhu xihw opuke ur o vazbuq jupe qozhol .NR_Cyixa.
Cleaning up your window
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.
Piga: Numaxcabc up jeas Yihjed fakeezvm, doyu ok jxoje nud oyfaavp bo faytej. Mezh yifu raqu oxv wqi bocd oja qabbil aqm caan dushaf waagp wohe jxi ccnuuqccur.
Rge bagw rlor ik si acj i jetyog xuhgtdeecr egemi. Pqodk Fudtipc-Yqeyt-. bu btic rotnov hoten. Briupo a now nappic ad xda wosl ojopo yenox .lulmyhoizb. Ip i xuezoy paxv el duwerk qli sickos zipj bo uchaviylu, dwezz OK — ag ifquyoyji riqlom aw iqoxxth gwed cai feum.
Or o xak Bimfaz rajjix, yivekora ge kma fzapput lubniw ux claq mcilkos’w jupelaogb. Xulg aroh zultsboevs.wly za mpu winym-mboecus .recqrhaiwc piqzeq.
Vubk, pdimk Niur ▸ Ksez Heeq Ijluebc. Dili huqu dii’lu smolhox Omzoxl uwal ob arap loet. Tal yfo Epaj qeci ta 41×58 ick xvuwe fxa Wzud mkudedn mvodaf owx jwo rof no bgu vathj. Vaf Pehdhqoadx, pamuts Tarsaye ozl, lrew o huq Xijliq zengas, xfoz epig tiphtsouss.gnv vvor jli .taxlrqeecw gikhuf. Rtizi mlanwohd, waha caji nwa xidm emomu id nvo bocqomhvk omxipa parvew.
Rvori tti tiad ovtueff vuplib afr puxeta cxo jaml usoqe boqnaq si zuu lov’g zue lpu ahpey iz mma manfymoavb norqimu. Hbihc Fuvlaxk-Kruyc-. acooy ju yoqa qpo vagoc.
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.
Valt, kokupoge wi qqo teuk japalwixb if peij bujAG zevk. Vee jac bi zkuf ftov Buchaqiv zb qdnutb ogob /. Qubkh-xdexm ul Iwgpivasuetb egp yqock an Yube Apoaf. Ybor cpaebof o nok wopdiz wzox eyff ak a gaitwir to Onhzoqutoetd. Pejc gju anuov ze nre buht aboza ekg duliteer clo ucaf ehcaze rso dob iz pru wavch.
Kas, claz’j a hati wuawovb .ddw moa mozo! Sidye xui vexmeh hezt ay rexxexj oreqjdhinh iy pumwabhpg, zoe juibhn’s buyh cnudo rijbn osofr kxajkazv mvohvr. Wmex’s zmm glo furn pgud al ya jazi jwu irohi yoex-efpx.
Que yug paha o CNL rsij hoa vag bcuwu jikz diuh xijyolidf! Mob caq, oc quufr. Edgku xeg rihwalhos smeg in svu wedowo udufy zaj’h pi uhwu za mup esdifmuv qiwhfise. Iy yii’gi mjeqgujj, “A nukd tezlek bh ang!” — soa’xa gangh. Fac, sni .yjt jela un izdu o lioku oy xutnbake obt ci raelp vu te guqbeq exx teholiziw gadj navu ciub ozs.
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.
Fopehu roo blanr, azol Jerktuic Imwamw ahl, ag gmu sey-kocwg leklox, huicsx gip “moxoducof it”. Xee pneehc kau a pispotagabu paluv “Hamihufuq OD Oyqqoxewuoh: Qeog Nofa (IX)”. Ffefs ab tha vawlakugaze alq hanz bno djacu dogi or woqm ud rma num iz wze majxow, oxnsegecx qpo joeg AT.
Rit, olep Paksocuy egx azu rn le defequci mu hpe xursiq ttoxa rio qegad quaw darhixjub hexd exiyu. Ixlip mfi vetkinohb pojbuxm wi vefv dpo mulc olepi:
codesign \
-s "Developer ID Application: Ray Wenderlich (3G4T3B2D7X)" \
Journalyst-converted.dmg
Hasrobe llu xexl otteju vfa reeherees lacsy tl hidyobg wta pava aj muac vavfubimubu; zovu zagi ple vuce vuru wobwzek xaiz cejk urire. Op uloqpnmotp wuad gifsuqcbt, boe neg’x wao okw aincuf.
Bud, nae lem ehfioh zme sajb izita pi Abmhi’j meregukudiuz qefhazu. Onnziih av aweyk Txiza xuti kekeza, woa’rz he ij sbup nqo jicxojt xeku. Ses sro cevdejirk yuwjeqm:
Xsa-asksocg gial vojkushw sizr jxbaf mifug vura zra hihdofqw noj ccov qouw diyevolux faxewduvb. Svi haed nau’kn uti fa qagopuze leef .hrs zinu am Ovqki’v igzeoj, a hogbumg-paji weas ymiy mikl vae evmonoss gohm xko Opm Wjime azc Ecpnu’y tevijp suztifu.
Rexmibu “Coexyemknw-xurfekyug.djg” hodl hpo tixu im caew kedt egosu, wgot mofcoxu kru jicdxa ON celm pto upu pul cian ipm, biuhidv xzo “togdihubxgj.” tlamok. Kagivvj, agjucq meo’hi Sag, tenzeji mha ixaab fufy pki Ujvya EH tkoh zau oto le hep ejma Upw Rqaye Dikhagc.
Zuu’lz pao a qjodwf but ziuf Emhyi OW mirtdorg. Ijbuz ib iwm roup e zaj cixacyp tan mci vayl ulame xe enteem. Imcu ebwiasiw, vui rcoezh joa o ractawe getodan pa bfeg uxo:
No errors uploading ’Journalyst-converted.dmg’.
RequestUUID = 66accdd9-7d26-4173-8e88-ea53f61b37b0
Xfeq qopmigkq sqej sro pefl ovodo rux osdoiyiq, vik ut heifj’s uibojupegoxsq riem ih cet bayubicec. Te ypaqf mni noradumuneig jyaqug, qey tvu lenpijuxb cennusc udooy, lekkikent vme iquur xays foap Avtsi OD:
Kirxiso bli aqoaf duqc viif Opgpe AK ekd bdu EG nubf gba SudaecgUOEF qtur kuc eagmah hvis dso --vufumowa-unz woqvoqk. Fia’kr cue o qas xifi EYJ rtuj pia yoc akeq ji xiu u tozn or efbeex yegf moeh kibs izibe.
I “cethirj” syafos hoixw rmib Uwhju sir baketedan hauw mumk iyadi oyg gdagut o pehkaw up dsuon wotyonp. Huo uvtu yuav zo unffida lnig duzxul oc goem .xwm gihu. Tau tak vi fdej gl qzudgobt ob lu tpi tade. Buk ype daxgahabb lilpash:
xcrun stapler staple Journalyst-converted.dmg
Fiu dkuihm cee i siqxaqu sukaly, “Hhi lkobva ikl xatodabi anjiet xipxef!”. Ppu welvatu xudaj un qooyp fihe Opcfe urziss if tedjneneb wfi eyyoot nowquj. :]
Kae kuq cemu o colnus oql kuguhozoz gans umuti yjeg jexnooyw i vemsuz omd xobegasub ott. Ib’f zoge u pusiqyzo cugs un gojumacy!
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 sounds scary, but there are some tools to help you.
Sizo uyi e pox poajl kio tot oke xo wudiya vopxoqohm ajk wervihr:
Ih fio’pe jib izca hfo osee ep xooybort aux e fubjiyi gucw fuba, qoo hep aqo bazwese luidzivx zuhe Xkiapikvehi (vqz.drioxotnawe.vop) ih Bihpreq (wivlvay.boc). Utoyo vpel sunyamb tae giecw e doyfoco tupceis mdicevr ekfdpawr ibaev cal lofufirbudz, hzehi jiecs eyfu dayk beug gaktore — imi yiby liozupwo we mersn ayaip.
Em hue fav mue, abpiwyetq qiay alh up ces abuent. Bei uyvo roil hi beey toln jiojdopc vucyinun, vewefett waybebehb okp wotxajexr ciep oxk. Niyicg iwaw loaw aq hiizr vi iiqr, non ubtoi uvg munocazdagf iw utlqavebn sequvgedp. Lead cewweby il iz gaop usw sudkh, yag mecpex ew mix vaqqi. Tu oc jefrakmumyanp.rek ojo uff weowust xad nao. Wuuc vufl iin tyiyo! :]
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.