Prehistory
The other day my first app for appstore passed a review in an epple and was approved on the first try. This ended my monthly journey from writing a small toy on Actionscript 3 to appstore
tops . The whole journey was made with the use of a Windows computer without the use of poppy (there is a small fly in the ointment, but more on that later) and I think the experience gained can be useful to many. I myself had to google a lot in the development process, collecting bit of useful information from all over the Internet, so a small tutorial highlighting important points will be useful for those interested.

Given
I note right away that there will be nothing about the development of the actual game: design, coding, and the like will remain outside the article. Here will be how to make a cross-platform application on a flash and send it to the store. From the same source code, you can build an application that will open in the browser and pack for mobile platforms. Development environment - Flash Develop. In Builder, however, everything is about the same. In addition, I used the starling framework (
gamua.com/starling ) - its beauty is that it a) supports hardware graphics acceleration, i.e. Your flash drive most likely will not slow down on the device and b) supports multiresolution - worries about the support of different screens are minimized
Decision
Step 1. Creating a project, registering a developer account, certificates, provisioned and all that.
In this place, I allow myself to relax and give you this link here:
kpulv.com/115/FlashDevelop_to_iPad_Workflow - here is a great instruction that takes you in small steps and with pictures from project creation to launching the first build on some iPhone. All you need is 100 bucks to get an account of an Apple developer and a Windows PC (no poppies, hurray!) Apart from the fact that getting an account will take about a day (as it passes through manual moderation), then this whole way should not take more than an hour. If you have already had your project before, then it will be enough to transfer its sources and resources to the project created according to the instructions, connect the device to the computer, press the F5 button and enjoy how your game slows down on the device in the debug mode :) These brakes Do not be afraid - they are most likely from debag. If you do not click F5, but run PackageApp.bat and select Ad-Hoc build there, the application will run quickly, but it will take a very long time to build (assembling within 5-10 minutes is normal). In interpreter mode, it will be collected quite quickly, but it will slowly work.
')
Step 2. Connecting Native Extensions
Adobe Native Extensions (ane) - these are libraries that allow you to use the capabilities of the device, such as vibration, accelerometer or In-apps and Game Center. If you do not need anything, then we’ll skip this step. I also wanted to fasten to my toy a collection of statistics (Flurry) and the Game Center itself for achivok and leaderboards. For this, I downloaded
flurry ane and the
Adobe Gaming SDK , from which only gamecenter.ane was needed. However, it is better not to use this gamecenter.ane - this will be discussed later too.
Connecting ane is quite simple (we find the file in the project explorer, we right-click on it and click Add to library; it is recommended to add ane to the libs folder), but there are a couple of unobvious moments.
First: by default they are connected as a Library, but you need the External Library. It switches here:
Second: in the SetupApplication.bat file that lies in the project, in the bat folder, in the line
call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%" "%APP_XML%" %FILE_OR_DIR%
in the end you need to register
-extdir lib/
, where lib / is the path to the place where you have .ane
Third: in application.xml, which lies in the project folder, you need to write an extension extension, like this:
... <extensions> <extensionID>com.adobe.ane.gameCenter</extensionID> <extensionID>com.sticksports.nativeExtensions.Flurry</extensionID> </extensions> </application>
These IDs are case-sensitive and not always obvious. In order to know the extensionID for sure, you need to open the .ane file as a zip archive and look inside the \ META-INF \ ANE \ extension.xml file - the required line will be written inside the tag.
TA-dah! Now we can use native extensions. Just write, for example, import com.adobe.ane.gameCenter. * - and you can use.
By the way, the remark about the Adobe Game Center ANE. It is free, it is there, but its use causes the application to crash when trying to send data to the game center, provided there is authorization in the game center and no Internet connection. Adobi has been silent about this, the problem has been known for at least several months, but there are no fixes and it is not clear when they will be. In addition, it does not know how to display banners that pop up from the top of the screen about getting achivok. In general, it is better not to use it. There is another
ANE , also free, but it requires an iOS SDK to compile, that is, an application using this thing will not build without a poppy. And there is ANE for 70 bucks, a link to which I will not give, it already gives Google the first line. I could find nothing more.
Step 3. One code - many platforms
At that moment when we begin to use native extensions, our code ceases to be cross-platform. That is, we cannot assemble a flash drive from the same code that runs in the browser and a flash drive that runs on the phone. And it's sad and we do not want it. It is much more convenient to test the gameplay in the form of a flash drive right on your computer, without collecting ipa each time and not flooding the game on the device. For this, I came up with a crutch ... crooked, but it works.
I made a copy of the project file in the same folder. For example, these are Project.as3proj and ProjectMobile.as3proj files. And a copy of the Document Class file Main.as - MainMobile.as. At the same time, the Flash Player platform is specified in the usual Project settings, and Air Mobile is specified in the ProjectMobile settings; Run.bat is selected in the Test Project item in the Test Project item. Further, in a simple Project, Main remained the document class, and in ProjectMobile the MainMobile appeared as the document class. Then, in the Singleton Game, I started
public static var main:Class
and each Main sets the value of this variable equal to itself. That is, in the project, the usual Game class considers that main is Main, and in the mobile project, he thinks that main is MainMobile, and you can simply refer to them as main. In MainMobile, we import everything we need from .ane, but in a simple Main we don’t. Further, when from the game itself we need to call some kind of chip, which is mobile, we do this if there is a corresponding variable in main. For example, the opening of the game center looks like this:
if(main.gc){ main.gc.showLeaderboardView() }
If the main we currently have is not Mobile Main, then there is no gc variable in it and the game center will not be shown. At the same time, the Game class itself, in which this occurs, generally has no idea about any gamecenter, it does not import the necessary classes.
Now we can simply switch between projects to collect either a mobile version or a browser version, despite the fact that all the source code is shared (except for Main.as, of course).
Step 4. The most tedious.
In general, we are great, and did everything we wanted. The application is going, working steadily on our devices and we are determined to break the records of the Flappy bird. It's time to fill in the AppStore. But for this we need some more preparatory steps ...
IconIn the icons folder there are default icons, they should be replaced with the correct ones from our application. They are needed in different sizes. You can automatically generate a bunch of smaller files from one file, for example, here:
makeappicon.com This site accepts one 1024 * 1024 picture (in this size you need an icon for appstore) and spits out pictures of various sizes. It is necessary to check the application.xml, so that there the file names correspond to the desired size.
Splash-screenIn the same place, in the icons folder there are pictures of splashes - this is the image that is displayed on the screen at the very beginning, while everything else is loaded. There are usually the logo of the company draw. They just need to make and save here.
Certificates againIn the first step, you generated certificates for testing; now you need a certificate for distribution, distribution or production (on the eppl website, both of these words are used to mean the same thing). This is done in exactly the same way as in the first step, even a little easier, because With a distribution certificate, you do not need to list devices for provisioned - after all, you are assembling the application not for test devices, but for all users of the app! In general, we get the .p12 and .mobileprovision files and write them into the SetupApplication.bat, which is already familiar to us, we get something like:
set IOS_DIST_CERT_FILE=cert\ios_dist.p12 set IOS_DEV_CERT_FILE=cert\ios_dev.p12 set IOS_DEV_CERT_PASS=******* set IOS_PROVISION=cert\crushTest.mobileprovision set IOS_DIST_PROVISION=cert\crushDist.mobileprovision set IOS_ICONS=icons/ios set IOS_DEV_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%IOS_DEV_CERT_FILE%" -storepass %IOS_DEV_CERT_PASS% -provisioning-profile %IOS_PROVISION% set IOS_DIST_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%IOS_DIST_CERT_FILE%" -provisioning-profile %IOS_DIST_PROVISION%
I note that I added the line set IOS_DIST_PROVISION = cert \ crushDist.mobileprovision (and replaced% IOS_PROVISION% in the last line with% IOS_DIST_PROVISION%) in the last line, so as not to change the provisioning each time, switching between test and final builds.
AIR SDK 13Perhaps this item will soon lose relevance, but at the moment, the latest stable build of the AIR SDK is 4.0, which was until February. And in February, Apple activated a new policy, according to which applications that do not know something from ios7 are not allowed into the store. And just the applications collected in the 4 SDK are not able to do this and are not allowed to store. But it fixes the AIR SDK 13.0 beta (you shouldn't be afraid of the difference in the version, in fact, the 13th is the next after 4th :) just Adobe has changed the version numbering system). In order to use the 13th version you need to download it here:
labs.adobe.com/technologies/flashruntimes/air and unpack the archive into the tools / flexsdk folder (yes, all right air sdk is dumped into the flexsdk folder), which is located you have installed Flash Develop (well, or wherever you have flex sdk, if everything is not the default). And in the application.xml file in the second line we replace the number at the end with 13.0, it should turn out something like this:
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)
5. .
! . PackageApp.bat , AppStore, , 5 dist .ipa, . , . " ". 99% , , -. . . , . "App Loader", XCode. . , . , , .
, - , , , . . ... , , , - . , .
, , :
, - , 99 , ( ) - flash still alive :)