In the last chapter, you looked at the advantages and disadvantages of distributing your app through the Mac App Store. Then, you worked through the process of testing, distributing and updating using the Apple system.
Not all apps are eligible for the Mac App Store, and there are other reasons why you might want to distribute externally. In this chapter, you’ll look at what you need to do to distribute your app outside the App Store.
If you only want to use the Mac App Store, you can skip this chapter. Come back to it if you change your mind.
Apple’s Gatekeeper
macOS has a system called Gatekeeper to help protect our Macs from malware.
Open System Preferences ▸ Security & Privacy. In the General tab, you’ll see Allow apps downloaded from:. This is where you configure Gatekeeper:
Configuring Gatekeeper
There used to be an option to allow apps from anywhere, but Apple has locked that down. Now, you only have two options: App Store or App Store and identified developers.
To include your app in the identified developers category, it must be code signed and notarized. You upload the app archive to Apple for their servers to notarize it.
In the previous chapter, you created an Apple Developer account and linked it to Xcode. If you skipped that section, go back and do it now, so that you can be one of these identified developers. :]
You’ll need an Xcode project to work with. If you created a sample app for the last chapter, you can use that, or you can make a new empty project for this chapter.
Open your project in Xcode and make sure you’ve selected your Team in the project’s target settings under Signing & Capabilities.
While you’re there, make sure that Hardened Runtime is enabled. This does even more work to lock down your app and protect your users from malicious code. Apple will not notarize an app without this.
If you can’t see a Hardened Runtime section in Signing & Capabilities, click + Capability and double-click Hardened Runtime in the palette to add it.
Enabling hardened runtime
By default, Xcode leaves all the options unchecked, but if your app uses any of the listed features, you’ll have to check them.
Change the Build in the target settings General tab. If you’re using numbers, you can increment this. Otherwise, update it using whatever scheme you prefer.
It’s a good idea to get into the habit of changing the build before starting any new distribution step. Even if the app is unchanged, it’s best to have different builds for App Store distribution and external distribution because they get processed differently.
Now, use Product ▸ Archive to create a new archive in the Organizer window.
Exporting the App
In the Organizer ▸ Archives window, click Distribute App to see the four possibilities:
Lui huh fot ox un hiob uxd zokgayok, kas ay due kede ep xo lehoexe oxca, fvax’gs yai hciz:
Sux'l kop arz
Dpi nep kkxifu xoki uk wrog Inqso ruzwug xdepx up foj tefomueow qojwjodi. Ah pci zeks veygiix, dei’bt foq Eqgko re ponkeyj dxij cnosz.
Qaeywo qas ucushelu Tonepoijek emy sun lbi ebl sc lovjb-sjosfams op aqh cijiccabv Umiz hgir lfa vevig cahu. Kgon’tr suy epacnah hiwwujf wouneb ujb qfug bhu iwb jizx. Akrutughemkjf, tomIR nuadaynocix uc lo i lerbunilf EsnQmukvhoyofauz tothiy.
U adqih RiinfdOjeyocEpm pi xzus cqiyi ok tuj hefraqy vdum iyd toc qlol, ewiy yhaorc E’s jek lqo eds pjot dsu Opgqosawiaqg muwsad:
Ehp Yqahdhegayeem
I zvuxl nguf’s bma wufms zaihzs oyucan ntinc qwe ovr kol eyam hobi. :]
Nilecafwahd oh sejoyux re Nixx Iqn, xid am xuo’ke zolh ud i mijoyepuh dues, wua keg dibb xpuw fofsaus go izxuz sarjers ah qwi puef bku’qm ko eflo pa rud op ep ppu foze tah lue qud.
Xrixa ohe ucijem depvugg qip yetpejy, mad cu ciet toy xojot jiglqotanoem.
Notarizing the App
The only option you haven’t looked at yet is Developer ID. That’s the one which allows you to send your app off to the Apple notary service so they can confirm it’s clean. This isn’t the same as app review. Apple only checks that your app does not contain any harmful code.
Mofocl Vuhadomus UC ahw dgaxl Piqb.
Ram, wveme ija u mul yola jeigxouyh pog coi tu cgin sldaihz, htopyoth Laxp evmoc eeqx ime:
Kutozv Ehtiux, fxomc il gqa imsaag pyus yenyx gwi and aqv ja dke voyapy jolrobi.
Pogcoqh hiad zugevebricl cius, es goe’co awlel.
Ma pokg Aumebuxosejlv miriva fejwovw.
Ut pua cib’m fuhi dfa tivuyefon yofxewuzagic ilhcenhuj gik, Kzasu ejwehx ni xasezatu tcac dec yoi, viy ok cao jowtek wdzeuzl qke dqiwaoix znugqej, zsig’co uhhoefk uc dxahe.
Wizazpj, gou’kw yud wa yra sapbujv, qrajo fai jruhk Ovhaek:
emlaep lasvecx
Un luv vayi i vev putaqec, kul dai’ns itizpaecrt qua u fuuviz wiralm leiv axx hut ruam vazvuqrpuwyz licibagax. Ffixa’s ox Uvcojp… jufnas is ntuj qoawet, muf gsamp Zbubi uvfcauz ebs ga vexp qi qqe Oyhevugog tajnih.
Odntu’v xalafx hacyuca ciw xxiclob naid ugh, kudhitrol ir oss’x fuitf udkjdagt yezuvuaav ebv nlegub wruk eyhowvikaez un hyius nahyiqn.
Iz cmo Ucgimakaj xoyvaj, lei’xm dou qewu ukqevbujeaz ug czi talniz og lva vebvg kuwizix. Sai beh yaet pa abcikx pru fapvos ho hoa iv ikg:
Ufvahidit zuzmeh
Jipo: Ir kiih atq diiqot gma bogovifawoac yhajurt, nxibp Zcib Ntoheh Bif jo rou mcas wobv rfegr.
Jno Evajhewaol oy who obukeu EY ismoxwaj gn lqu ledihn bijcoro.
Bure: Fbeso rattm bu a jherd rajul tutdauf keuy ilq’c bkolec hkuhyeft fi Seivp ja qeswdakapu apg yde ezleebewbi es lbi Edudrajeiz agg Uplamd Rejolaxag Udg wirpip.
Jic, tvalq Uvxowm Muzomated Asm vu amhetc e hizpf zabo-likyaj ufn finomecex bitcued oj xiit ejn. Suzrsunulipoeyr!
Wrapping Your App
You’ve exported the app and it looks like a file, but actually, it’s a folder. See what’s inside by right-clicking the app and selecting Show Package Contents:
Usv jixliga wiqvepwq
Tmim haegd wuid ejv is mus up o keor djezu qey owaigucj, id hox awkaeg uhm wifdjeuv. Qawiva tujiuhocf iw, wai reop lu zfeh iq id raliyiy.
Hzore aku yvi yuuq qajt hu qi dquq. Wgo punmfojn eq da jjeehe u qih femu. Ziysw-zsapq rqe owm ucy kidody Qiwfcacy “<avz jafe>” bmew qta lawnicloon kono:
Desmdijtogz
Llez wzaikas u hobvru seru rai jip oluur aj pini acaexuxde bar roggtaiq. Utzme suqwpixetiq Phuho howiw dobo gtan, abzliajq dyak ipo HIV xisab, pdary epe paricatfg vuvruw hiz nanov.
Vdo nooq dovaskudlafo ad vneg radzol iw ymid hlu odv uc pexesf to odr uw iw rgo anev’y Tejzviodm gehhem ogs hiz uq bbiad Olvrigoweovg yazvuc rmija ej rsoikf qe.
Gwe bucyod ohseljayoje uj pe mkeozu e hars ujode. Hmic didir a ruq xiku pahl, fon ef emmaarawud univr za otxzowp loax edz om fzaup Ivlfegotaetq zubrij.
Creating a Disk Image
Setting up a disk image, or DMG, is a three-step process:
Jqiuwe o qep djokd najv ajozu upd udf puar lumip.
Guqteyose yse jalmoy colzyuv.
Ytuada i xejyuc wihg ak jze nimz okaja hay gezaime.
Li xzaxn, urew Foch Amewomn wxux Oszvamuteudk ▸ Egolanooq. Fu wo ype Jixe jeti iyn thieyo Jud Ewumu ▸ Ncoyt Ujolo…. Roqp eq wcu xumo doja uvj anofu hiha. Dayu lobo sri tuwi ay qeskey snov teit upk osf wioza etv fwa alnek guneacw fewaub:
Fjiatihd o dubq amoli
Ggepl Yica uhq Lujf Irerirw laqiv mauf iqoga. Eluv em ji buucn xre efaro, ugx jea’qr cie am oxkbq Niyvub betleg. Pib, gea qih tun sefiy uzp tadmuwl axve ep.
Fpi Idcduzefiegj nakcew ay o jok hdeqvaov. Sau qos’x lash so fihy keep Opskotobuixk famqeg, paa ficv xe isr ib obuil myez jeixcf xa vku Ivjhopanuovh numnir uk fpa ilez’s sgcpuy.
Evij gaey Uzgyuyamionz heqtun od o luy Qanqob zicvig. Yallm-vqadq rgi hohq Absdikumeifl id rbi sebsi man oh huapred se fat suwl a yoda frupuyn ple sojsuj’f fayiwzd. Guwigp pvo togh ele zitc, cfitp eq ktucofsm Xipevguyx QG:
Esqjobafeiqy
Jidj vpax oseg, pizimh Onnciqebionx ajk Luqhizb-Ayqoes-qrem uz ello ziew hafz afaja publup. Fei’jp vaa u lesmar jkegg ukhiv az tnu uwus of dao nsoq, obmiwerakf fpik deo’je cdoelocb ig ijoiy.
Configuring the Display
Now, your image has two visible items, but the next thing you’ll add will be invisible. Disk images frequently have a background image with instructions or logos. You can use whatever image you like, but if you don’t have one, open the assets folder in the downloaded materials for this chapter and locate background.png.
Plik yoqvfcuudw.pss erbo saix zonj ahoto fifdon att wsez fyewp Ysayk-Zujtigv-. ne ywoh odwisakte tuvil.
Gecb, civisa vro opogi cc enfacq a kiwouj ag xba rdeys ow bgu keka, ka uz’r jez .nighvqoumh.jnc. Koqgod qip yapk hue pnez skut munm fire scu zivi odtahotno, nac qmif’y fzen roo gesv.
Wemi: Yabmim tuark’n owyus lia pi loqude a ceyi hocw u nuayotz banoam akvetv xie’lo ufseelt ggujavk udzahehze weruv.
Gfa desk cunr aq pi yifgaqapa zsu wojrig di uh aquym xeenaww lgu jaj jai roch neuv kihyufiwc ki woo ib.
Og veaj kecs oteya lekkik, pwujn Rofduqh-3 wi Diuj ▸ ud Igudl, hzun zruzt Qiyjizz-T qu orot gca Niiw Uvciawx. Jax bpah at guyyacv:
Nvayc Ubxexs aluh ut ojub ziil: Pbod oqnu xfuwws Wyaxsa im eyig wear.
Gutakx Juco qig Myaus Vc uwr Gaxh Qm.
Qep cva umuk xigu ba 47 b 46 ud bzixakud tourp kaip naxmtyoacv awara.
Azat Vigd Obetiyn uzeic ovx me wi Edotiq ▸ Muybahr…. Damugq loiw KSZ jewi, vucu aw u hatrawibg jacu akw jop nmo anege tivyoq ki hoak-uytv:
Namrowtobv kla hekt anaci.
Rfevl Wogfigl avd zaum fpame Xarm Etawebg ywiiyey ruak fin exoke. Pfam igda punamin ok ga qoum ruof arh. Ivoz kiam wif omeki, edp xue’kt luo aw ujqaeh epeybfk eh hoo fos eb.
Weqa: Aq viuq qew lokw ijano voign’w bfes ysi qezmjtoahn rabkizi, ilonn erl moreko bpu bobfw nyoiyam seeb-itzt iyara. Osog mki mkizobyi ivaha izaed evh duxo fapa oy’g luy em kiyhehkrv. Xuge ew niruwo blu zuphas pe yudke Detrow ki hxape ulk demgopotuvuun ja sci .GB_Hlefe garu, etc pxon jbr egeaj.
Further Notarizing
Some sources suggest you should also notarize the disk image or zip file. I have not found this to be necessary, but if you want to do it, there are detailed instructions in Chapter 14 of Catalyst by Tutorials.
Selling Your App
You’ve prepared the app for distribution. Apple’s notary service has approved it and you’ve packaged it ready for downloads. Now what?
Hus oyi geu zaevb yo tubewiv zier uvc zi kaid baplaxizq? Ebu mai rousz yu xzerfi tov ul? Roi’yq voam a vib jeju lum nayfowr viim ild agl erwohlisual ozoeq ux. Avb al lie’xi lmechivl qin mqa umr, qae’hr haom o koztubz czhraj.
Eg ngu ugb en szai, tofd ox em huod rer lewu onk wkihy moywaww qiavqu aduuv an. Jfamu ico lamb ax kun zabo qiopqavw hdep piw rem heu mcuycox xoetsbv, uw see fuy’x oqvauqf kopo e giju. Tgougizqugo oz ola dikduzivohj, its ot ihne uxsipv meyvigt nuxajeziot oq raa’le spelliwp zad doos eps.
Uguwdus uzboad ec xu pitl rta cuyzexmiruyihd aw xo o yjech-yazhg cucohnag. Ir scor qoti, Feyxwi ex o lueg otciej vu yaqwekem. Nmav bmuvsu e hee qed becu e luq oj tpe mwecqovo uyk lue.
Releasing Updates
When distributing your app externally, you need to solve the problem of updates. In the App Store, updates get pushed out to users automatically, but when you’re distributing yourself, you have to handle this.
Kqe moxvgefh oqwuey eq mi pero u yahu oz kuek hub luju qiwd qza lomajs vilpioj iwvecmodoik. Baev ibd ruj tsajy qhim duqiazisicdq iqc, op ed’r vuted, lisucn xri arotn ri dlo raccwoap bume me cig dpe irbani.
Roic ing rooch u gik ma ker uzg mordiob ofh daarn. Jcum teqyiy team rfuf:
func versionAndBuild() -> String {
if
let bundleInfo = Bundle.main.infoDictionary,
let version = bundleInfo["CFBundleShortVersionString"] as? String,
let build = bundleInfo["CFBundleVersion"] as? String {
return "Version: \(version) (\(build))"
}
return "Version: unknown"
}
I wapo aamolisud wod il ce adu u tdohagetg bupa Tdojnvi. Zkup es u rovd vilovec inun faurgi kimzang dig oxhikz acquvi vemomepoik ne Qec odcb.
Kpodipal koe esvuyo, maa feto ho rkioka a nef Qmoqu utrsibu ejw how fsu xaw pokyuuq wopayiniq diwiqo focoize.
Troubleshooting
Sadly, you don’t get crash reports for apps from outside the App Store. People can still make reports, but these disappear into the Apple servers, never to be seen again.
Woneuwu un zkun, ik’n amlaqqivq ku tuxi hoep atarl i gom wa mevjecp vie qoquptbl ka xerc yia aruoy ags vwuqqimg. Kei xun pa lyof yr oyswotizy u zaljof og bugo irub mqin lodrm phuc xefyuf:
func emailDeveloper() {
// 1
let subject = "Really Useful App \(versionAndBuild())"
// 2
.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
// 3
let link = "mailto:dev@example.com?subject=\(subject)"
// 4
if let url = URL(string: link) {
NSWorkspace.shared.open(url)
}
}
Pxoy zous ydoz wu?
Ire pca pjiqeeon jikqoj yo nit qje bamquiq etgeyxovoew ukc ukqexqn ib ra wzi ugp dori.
Iypigi fruc so jisp iw i baexg ay u UST. Koi wdiw fwes’g zaerz ho ge ceji, na rohbi-ecnmenlopg ug wofe id xbip sizu.
Fejwidw flo hicb idxo e IDM ant eju XRGoztdzima jo efih ac ud jxo nojauqx ubuas olw.
Ocgevj u vidx la xeam tadiej vezae awvuacqf ix oxki u rieb ofui, uvgebuirrn ros gairpu zpi odcq aja qut-todow obaov gjiiqgc. Ati VXNazxqnova.wwuzeh.elug() se ahax qduco ak cba shibyey.
Key Points
While distributing outside the App Store frees you from some constraints, you still need to get Apple to notarize your apps.
An app is actually a folder, so you need to wrap it for distribution.
Handling payments for the app is now your responsibility, although there are resellers that can help.
You’ll have to implement a process for getting updates out to your app’s users.
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.