📜 ⬆️ ⬇️

How to build Adobe Air app for Mac OS AppStore


A search on the Internet did not give a result, although it would be more correct to say that it gave only a partial result. I hope this instruction will help you. If you are interested, welcome under cat. Attention many letters.

First you need to get two certificates from Apple:


Instructions on how to get certificates are easy to googling.
After receiving certificates, they must be registered in the system.
All actions must be performed in Mac OS.
The next step is to build your application, you can use Flash Builder 4.7 with the Adobe Air SDK 3.6 or the utility from the Adobe Air SDK 3.6 "ADT". At the assembly stage, it doesn’t matter at all what certificate you sign your application, with certificates from Apple you cannot sign the application.
As a result, you should get a file of the type bundle.app - in fact, this is just an archive with the files of your application and c air runtime. You will need to install Xcode, to be more precise, some of its utilities.

Let's create a folder somewhere and name it for example build . We put there our ready-made bundle.app
Now you need to prepare icons for your application from the requirements for the icons is the presence of all sizes and file names.
')
Create a folder in the build with the name icons.iconset inside we must put such files (the file name must be exactly this):

  1. icon_16x16.png - size 16x16
  2. icon_16x16@2x.png - size 32x32
  3. icon_32x32.png - size 32x32
  4. icon_32x32@2x.png - size 64x64
  5. icon_128x128.png - size 128x128
  6. icon_128x128@2x.png - size 256x256
  7. icon_256x256.png - size 256x256
  8. icon_256x256@2x.png - size 512x512
  9. icon_512x512.png - size 512x512
  10. icon_512x512@2x.png - size 1024x1024

Do not ask why the same icons with a different file name, so put on Apple's userguide, if there is not at least one file you just will not miss the AppLoader.

Go to the build folder using the Terminal (from the console) and enter the command:

iconutil -c icns "icons.iconset/"

as a result, we obtain the file icons.icns and copy it to bundle.app/Contents/Resources with the command:

cp icons.icns bundle.app/Contents/Resources/

remove from the webkit application which is prohibited by Apple (they say it uses the private API):

rm bundle.app/Contents/Frameworks/Adobe\ AIR.framework/Versions/Current/Resources/WebKit.dylib

We give full rights to the folder with the application:

chmod -R 777 bundle.app/

edit the file bundle.app/Contents/Info.plist you should have it look like this:
 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleAllowMixedLocalizations</key> <true/> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>LSMinimumSystemVersion</key> <string>10.6</string> <key>LSRequiresCarbon</key> <true/> <key>CFBundleIconFile</key> <string>icons.icns</string> <key>CFBundleIdentifier</key> <string>com.sitename.bundle</string> <key>LSApplicationCategoryType</key> <string>public.app-category.puzzle-games</string> <key>CFBundleGetInfoString</key> <string>1.0.0,</string> <key>CFBundleShortVersionString</key> <string>1.0.0</string> <key>NSHumanReadableCopyright</key> <string/> <key>CFBundleExecutable</key> <string>Fatty Maze</string> <key>NSHighResolutionCapable</key> <false/> <key>CFBundleLocalizations</key> <array> <string>en</string> <string>ru</string> <string>zh</string> </array> </dict> </plist> 


I will explain one thing: in Info.plist , you must specify in which category your application will be placed; this is done here:
 <key>LSApplicationCategoryType</key> <string>public.app-category.puzzle-games</string> 

the category name is strictly regulated; a list of categories can be found here.

Again we go to the build folder through the Terminal and start directly signing the application and all its components with the certificate using the following commands:

codesign -f -v -s APPLICATION_CERTIFICATE bundle.app/Contents/Frameworks/Adobe\ AIR.framework/Versions/1.0/Resources/AdobeCP15.plugin

codesign -f -v -s APPLICATION_CERTIFICATE bundle.app/Contents/Frameworks/Adobe\ AIR.framework/Versions/1.0/Resources/Flash\ Player.plugin/

codesign -f -v -s APPLICATION_CERTIFICATE bundle.app/Contents/Frameworks/Adobe\ AIR.framework/Versions/1.0/Resources/adobecp.plugin

codesign -f -v -s APPLICATION_CERTIFICATE bundle.app/Contents/Frameworks/Adobe\ AIR.framework/Versions/1.0

codesign -f -v -s APPLICATION_CERTIFICATE bundle.app

Instead of APPLICATION_CERTIFICATE, you should write the full name of your certificate. It looks like this for me: “3rd Party Mac Developer Application: Vasya Pupkin” quotes are required.

The next step is to add support for the sandbox. Create the file entitlements.plist in the build folder with the contents:
 <?xml version="1.0" encoding="utf-8"?> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> </dict> </plist> 

we add changes to the application and sign it with a certificate using the command from the terminal being in the build folder:

codesign -f -v -s --entitlements entitlements.plist bundle.app/

To make sure that everything is done correctly, the command:

codesign --display --entitlements - bundle.app

As a result, you should see the contents of your entitlements.plist , if there is no content in the output, then you did something wrong.

Finally, product build :

productbuild --component bundle.app /Applications bundleInstaller.pkg --sign INSTALLER_CERTIFICATE

My INSTALLER_CERTIFICATE looks like this: “3rd Party Mac Developer Installer: Vasya Pupkin” quotes are required.

Check whether everything is correctly signed:

sudo installer -store -pkg bundleInstaller.pkg -target /

If the percentage has reached 100 and you have not seen any errors, Congratulations, then everything is done correctly and can be sent to appruv.

PS We created a game for iOS on Adobe Air and ported it with a few changes for MacOS, now our application is running in MacOS.
I do not specifically specify the names and references of the application, this is still not a PR article.

All manipulations were obtained from these sources and by these methods:
  1. http://pigsels.com/2012/04/air-app-store-publishing-guide/
  2. http://forums.adobe.com/message/4564789#4564789
  3. Method of scientific spear.
  4. Error messages received from Apple (some error descriptions shine with completeness, to the impossibility - Status: Invalid Binary. And understand why!)


UPD:
There are some changes when building an application with Adobe air 3.8.
These commands are no longer needed:
codesign -f -v -s APPLICATION_CERTIFICATE bundle.app/Contents/Frameworks/Adobe\ AIR.framework/Versions/1.0/Resources/adobecp.plugin
(not necessary)

codesign -f -v -s APPLICATION_CERTIFICATE bundle.app (not needed)

codesign -f -v -s --entitlements entitlements.plist bundle.app/ (does not work)

and instead of these three lines one:
codesign -f -v -s APPLICATION_CERTIFICATE --entitlements entitlements.plist bundle.app/

Thanks for the new information pozirk

Source: https://habr.com/ru/post/168187/


All Articles