Free tools for making Adobe Air apps for iPhone, iPad, etc.  These tools and much of the process can also be used for making Android apps.

There are very good instructions for developing apps on Windows for developing iPad and iPhone apps on a Windows machine from an Untold Entertainment blog tutorial.  (Adobe has an adequate, but inscrutable doc on the process, too.)

This process uses Adobe Air  to create iOS apps.

But why use Adobe Air?

  • Guess what?  You don’t need to buy a Mac!  There are online services that allow you to rent time on a mac.  One that has proven useful is http://www.macincloud.com/.  You do have to set up your account using the Mac keychain (which means re-compiling your certificates (you can ignore the OpenSSL solution below, which is limited to testing and ad hoc development), app ids, and, subsequently, your app), and use the Mac Application Loader.  But you can do this all for an $8 fee (for one day of use, or $20/month for 3 hours per day of use).  Note that the only problem that I had was that the names of my app in iTunes did not exactly match the name I entered in Flash — it is case-sensitive.
  • Adobe Air is free.
  • There are free development tools.
  • You can make Android (Google, Kindle Fire, etc.), Blackberry, and other apps from exactly the same code.
  • You can make a website-based Flash app from mostly the same code, though there are some necessary security restrictions.
  • There is a huge community support.
  • There are simulators for many tablets and handheld devices, so you do not need to buy the devices to test on (though you should do some testing on the thing itself eventually).

You will probably use FlashDevelop to create the iOS app, Adobe’s Flex SDK and Air SDK to compile the apps, and will need OpenSSL to manage the certificates and signing.  For an iOS look-and-feel to the buttons and movement, use ExtendedMadness framework and tools.  Follow the instructions from Untold Entertainment to set up FlashDevelop, Air, and Flex, as well as see a more detailed view of the Apple development process.

About the code:

  • Mouse events will automatically get translated into touch events.
  • The program will not end unless you specifically code it to do so.  This matters in terms of animations, and so on.  It’s difficult as a user to manually close a program.
  • (I will add to this list as things occur).

Here is a checklist for the Apple development process.

  • Get an Apple Developer account. Costs $100.
  • I would recommend creating a new email account for this process. The Apple folks like to use this everywhere as a login, as well as a general identifier.
  • Create a certificate; you will need one for development, one for “ad hoc” distribution, and one for App Store distribution. (See the MSDOS batch file code below.)Here is an overview of the process:
    1. Using OpenSSL, create a key file.
    2. Using OpenSSL, create a certificate request file with the key file.
    3. Upload the certificate request file to Apple.
    4. Refresh the browser until you see the certificate’s “Download” button.
    5. Download the certificate, and put it in the same directory as the key.
    6. Using OpenSSL, create a PEM file from the certificate (dunno why).
    7. Using OpenSSL, sign the certificate with the key, saving it as a P12 file.
    8. The P12 file and your key file are used to sign your apps. Make a copy of both of these files to use later.
  • Add your devices to your Apple Developer account.
  • Create an App ID  on your Apple Developer account.
    • You must have a device listed on your account to create an app id.  But you really only need a device’s UDID, and not the actual device.

      • It certainly is possible to use a fake UDID, or a UDID of an unknown device .
      • You will need the device’s UDID.
      • Just borrow one from a friend — any iPhone or iPad UDID will work.
      • Use the iTunes method, or else use the free “UDID Sender” app from the App Store.  See this post for the method.
    • You will need a developer and distribution version of these app ids.
    • Note that you can use this ID for multiple projects, just make sure that the Bundle Identifier uses the wildcard (*) instead of an item. E.g., com.something.*, which can be used like com.something.appA, com.something.appB, com.something.tigerBloodApp, etc.
  • Create a provisioning profile for each app.
    • This connects the app id, the certificate, and the devices together.
    • It produces a *.mobileProvisioning file that you (finally) use to create the app.
    • Refresh the screen until you see a “Download” button.
    • Download the provisioning profile to your final app directory.
  • Revisions/changes:
    • If you want to revoke and re-create your certificates, go ahead. You will have to re-link them to your apps and devices, but that is problem-free.
    • You can delete and re-create the app ids. You will just have to and re-connect the certificates and devices at creation time.
    • If you change the developer version of a cert, app id, or profile, you will probably have to change the distribution verison, too, so might as well do it at the same time.
    • Basically:
      • Add or delete a device (ipad, etc.):  new app id, new provisioning file.
      • Change an app ID:  new app id, new provisioning file to download, new certificate to download.
      • Change an app name:  new app id, new provisioning file to download, new certificate to download.
      • Revoke and re-create a certificate:  new certificate request file, new app id, new provisioning file to download, new certificate to download.
      • Change your private key:  new certificate request file, new app id, new provisioning file to download, new certificate to download.
      • Make a revision on the actual app:  no changes needed from Apple.

Batch file for certificate management:

Save this code in a file called certSetup.bat:

REM Make sure you have OpenSSL installed.
echo off
cls

:adSetup

REM Instructions derived mostly from http://www.untoldentertainment.com/blog/2011/11/30/flash-to-ios-a-step-by-step-tutorial-part-2/

REM for setup:

REM ***** Choose either development or distribution. *****
REM set adAppType=Dist
REM set adAppTypeFull=distribution
set adAppType=Dev
set adAppTypeFull=developer
REM **********

REM ***** OpenSSL path *****
set path=%path%;C:\OpenSSL-Win32\bin;
REM **********

set RANDFILE=.rnd

REM for adCertReq:

REM ***** Set your email address. *****
set adEmail=yourEmail@whatev.com
REM **********

REM ***** Your name; spaces are allowed. *****
set adName=Your Name
REM **********

set adKeyName=myApp.key
set adCertSignReq=CertificateSigningRequest%adAppType%.certSigningRequest

REM for adCert:
set adCertName=%adAppTypeFull%_identity
set adPName=iphone_%adAppType%.p12

REM change this line to a choice, eventually:
goto adKey

:adKey
REM goto adCertReq

REM Generate RSA private key, 2048 bit long modulus
REM * * * * *
REM You really only need to make a key once. Ergo, I would recommend commenting these lines out entirely so you don’t make any mistakes.
REM * * * * *
REM del %adKeyName%
openssl genrsa -out %adKeyName% 2048

pause

:adCertReq
goto adCert

REM Generate a certificate, signed with your key.
REM * * * * *
REM Creating a new cert is a once a year process (for both development and distribution), unless the cert info is compromised, or some info is changed.
REM * * * * *
echo key: %adKeyName% req: %adCertSignReq% info: “/emailAddress=%adEmail%, CN=%adName%, C=US”
del %adCertSignReq%
openssl req -new -key %adKeyName% -out %adCertSignReq% -subj “/emailAddress=%adEmail%, CN=%adName%, C=US”

echo.
echo Upload ‘%adCertSignReq%’ to http://developer.apple.com/ios/manage/certificates/team/index.action, under “Certificates”.
echo.
echo You can revoke the old one and reassign any apps from the old certificate to this certificate.
echo.

pause

:adCert
REM goto end

echo.
echo Download the “%adAppType% Certificate” from http://developer.apple.com/ios/manage/certificates/team/index.action, under “Certificates”.
echo.
echo (The certificate should download automatically to a filename ‘%adCertName%.cer’. Move that file to the working directory.)
echo.
pause

echo key: %adKeyName% cer: %adCertName%.cer PEM: %adCertName%.pem P12: %adPName%

REM I don’t know if these are ever necessary — pretty sure that they are not:
REM openssl x509 -inform der -in mdm_identity.cer -out mdm.pem
REM openssl x509 -inform der -in AppleWWDRCA.cer -out intermediate.pem
REM openssl x509 -inform der -in AppleIncRootCertificate.cer -out root.pem

del %adCertName%.pem
openssl x509 -in %adCertName%.cer -inform DER -out %adCertName%.pem -outform PEM

del %adPName%
openssl pkcs12 -export -inkey %adKeyName% -in %adCertName%.pem -out %adPName%

:end

del %RANDFILE%

echo.
echo Fini.
echo.
pause

Advertisements