First, I must say I'm new to Flex Builder and to flash development in
general; so maybe there is a better way of doing this. And also I'm not
very good writing in English; that's the reason of the grammar mistakes
and the weird writing style. Hope the info to be useful anyway.
I think this is a better solution that the one in the previous post,
because this solution is more flexible to be used in different projects.
These are the new steps:
1. First, you need the
Packager for iPhone from Adobe. If you have installed Flash CS5, you can find the packager in
%ProgramFiles(x86)%\Adobe\Adobe Flash CS5\PFI or
%ProgramFiles%\Adobe\Adobe Flash CS5\PFI.
2. Create a file Pack.bat with this content:
set PFI=C:\Program Files (x86)\Adobe\Adobe Flash CS5\PFI\lib\pfi.jarset PROV_PROFILE_PATH=C:\Users\John\Documents\PackagerForIphone\Provisioning\John.mobileprovisionset CERTIFICATE_PATH=C:\Users\John\Documents\PackagerForIphone\Provisioning\JohnDevCertificate.p12set PASSWORD=123456set SWF_PATH=%1set APP_XML_PATH=%2set IPA_PATH=%3set ADD_RES1=%4set ADD_RES2=%5set ADD_RES3=%6set ADD_RES4=%7set ADD_RES5=%8set ADD_RES6=%9java -jar "%PFI%" -package -target ipa-test -provisioning-profile "%PROV_PROFILE_PATH%" -storetype pkcs12 -keystore "%CERTIFICATE_PATH%" -storepass %PASSWORD% %IPA_PATH% %APP_XML_PATH% %SWF_PATH% %ADD_RES1% %ADD_RES2% %ADD_RES3% %ADD_RES4% %ADD_RES5% %ADD_RES6% %ADD_RES7% %ADD_RES8% %ADD_RES9%
or download it from
here.
You need to change the paths to point to where you have each corresponding item in your machine.
3. In Flex Builder, go to Run->External Tools->Open External Tools
Dialog... and create a new launch configuration by clicking in the
little button with the plus symbol. You need to fill the following fields:
Location: write the path to the Pack.bat file.
Working Directory: the directory where the .swf is. Usually is the directory bin or bin-debug inside the project directory.
Arguments: the parameters to be passed to Pack.bat. It's important you put them in the same order the .bat reads them. If you use the posted .bat, then the order is:
- Path to .swf file
- Path to application descriptor xml
- Path to output ipa file
- And then additional resources in no particular order(icons, Default.png, etc)
The Default.png and icons must be in the same directory that the .swf, and the paths are relative to this directory.
You should get something like this:
Note the use of variables like
project_loc and
project_name instead of the hardcoded path. This allow us to use the tool in different projects without change anything.
4. Now, after building your project as usual, go to Run->External Tools->Pack
Right now I'm working in some performance tests in my spare time. I'll post the results if I find something interesting.