How to Use Packager for iPhone to Build iPad Applications

In my recent Packager for iPhone Refresher, I left something out which several people have been asking for: how to deploy your iOS application to an iPad rather than an iPhone or iPod touch. We stopped development on PFI before we could really dig into the iPad, but now that we’re back to developing AIR for iOS, I figured I should go ahead and post instructions.

There are two things you need to do:

1. Add metadata to your application descriptor.

Just add the following to your application descriptor at the top level (as a child of <application>):

<iPhone>
    <InfoAdditions>
        <![CDATA[
            <key>UIDeviceFamily</key>
            <array>
                <string>2</string>
            </array>
        ]]>
    </InfoAdditions>
</iPhone>

2. Include a 72×72 icon.

Rather than the 57×57 pixel icon you would use with a pre-retina display iPhone or iPod touch, use a 72×72 pixel icon like this:

<icon>
    <image72x72>Icon_72.png</image72x72>
</icon>

That’s it. Your app is now ready for the iPad.

13 Responses to How to Use Packager for iPhone to Build iPad Applications

  1. Kevin Newman says:

    Does this also make your app retina ready? Or are we waiting on an update for that?

  2. Christian Cantrell says:

    Kevin,

    The build of PFI on Labs does not have support for the retina display. That will come in a future version.

  3. Christian, were there directions/examples anywhere on designing an app for *both* iPhone and iPad (i.e. that will properly size to 1024 x 768 when on the iPad)? You never finished your multi-platform post, and I’d like to use my Flash CS5 to port one of my apps to run on both but adjust itself to their native resoultions.

    Thanks!

  4. Pingback: Tutorial Sviluppo Applicazioni iPadiPhone

  5. Christian Cantrell says:

    @Martin: Check out this article:

    http://www.adobe.com/devnet/air/flex/articles/writing_multiscreen_air_apps.html

    Is that what you’re looking for?

    • Christian, thanks. My concern is – doesn’t externally loading the application swf in to the containing swf violate the current Apple terms of not loading code?

      Also, how well does this work for bitmap based graphics? What I’m porting are games done through bitmap routines vs. vectors, and in my experience and scaling done to it to enlarge it slows down the game play.

      • Ok, answered one of my questions looking over the code further. You’re just creating an instance of the game class vs. literally compiling the games separately and loading them in as an external swf. My other question still remains through regarding bitmaps.

  6. Andrew Blair says:

    I made an app with Flash that is optimized for both iPhone and iPad called Little ABCs:

    http://itunes.apple.com/ca/app/little-abcs/id394282753?mt=8

    Note the description on the Apple page there how it has a plus icon and says optimized for both.

    Here’s what was involved in my case for making it work on both:

    I should mention that my graphics are vector, so they scale well. I use the same graphics for both devices, I don’t show certain graphics conditionally based on the device’ display dimensions.

    My Main.fla file’s stage is set to 320×480

    In my Main.as class:

    stage.scaleMode = StageScaleMode.SHOW_ALL;
    stage.align = StageAlign.TOP;
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

    In my ABCs-app.xml these are the last couple nodes that are relevant. Note the icon sizes for both iPhone and iPad:
    Looks like the blog here isn’t displaying XML properly so I’ve put it on pastebin:
    http://pastebin.com/nBwTDyJ9

  7. Vlad Alexander says:

    Christian, I apologize that this message is off-topic but I am unable to find an alternate way to contact you. We are a vendor of a popular browser plug-in called XStandard (a WYSIWYG editor control). A number of our customers have asked us to support the Adobe AIR platform. But it looks to us as though you have disabled all non-Adobe plug-ins. Is there a way to make our plug-in run in AIR or do you have plans to enable plug-in support in future releases?

    Could you please reply back by email? Thank you in advance.

  8. Christian, this works beautifully! Thank you so much for your help!

  9. Christian, have another quandry going with this method. Now I suddenly can’t access the stage from my game class to attach an eventlistener. I get a 1009 error. I have the main class wrapper that you suggest for the sizing, which creates an instance of the actual game and adds it to the stage. Then from within the game class I have the following code:

    this.parent.stage.addEventListener(TouchEvent.TOUCH_BEGIN, processSpinner);

    private function processSpinner(e:TouchEvent):void
    {
    trace(“here!”);
    if (points[e.touchPointID] == null)
    {
    testTouchResult.text = “x: ” + e.stageX + ” y: ” + e.stageY;
    }
    }

    Obviously by the above, I’m just trying to track the current stage point values (which are to get displayed in testTourResult a TextArea object).

    I also tried just a this.addEventListener(TouchEvent.TOUCH_BEGIN, processSpinner) and got no 1009 error, but also had absolutely no result in the text area
    .

  10. Bruno Caille says:

    Hi Christian,

    I’m trying to push ad-hoc apps on my iphone and ipad and the process is smooth until I start the synchronisation of either device. I get an eror : Invalid privileges.

    My distribution provisionning profile is active, so is my distribution certificate. Correct udids have been entered, app id is the same in my descriptor file than on the provisionning portal, I made sure to drag the profile in itunes before my ipa… nothing will do. The ipa is unusable.

    I must be missing something. Anybody had a success story using windows and the latest PFI?

    Thanks in advance

  11. Michael says:

    Bruno, it didn’t work for me either on windows. So i rent an ibook, on which this awful licence process (to get the provisionning profile and the .p12 file which the packager needs) is still a litle bit easier to set up, and it worked.
    i copied the files to my windows pc (which i use for developing) and created successfully an ipad app installer file from the command line.

    The following informations in the packager instruction pdf helped me a lot:

    “Also, check that your application’s app ID matches the Apple app ID:
    •If your Apple app ID is com.myDomain.*, the app ID in the app descriptor file or the App ID in the iPhone Settings dialog box must start with com.myDomain (such as com.myDomain.anythinghere).
    •If your Apple app ID is com.myDomain.myApp, the app ID in the app descriptor file or the Flash Profession CS5 user interface must be com.myDomain.myApp.
    •If your Apple app ID is *, the App ID in the app descriptor file or the Flash Profession CS5 user interface can be anything.
    You set the application’s app ID in the iPhone Settings dialog box in Flash Professional CS5 or in the application descriptor file.” (the xml file!)