SWF to APK with AIR

20 posts (showing 1-20)
bsi73

Market Level 1Community Level 0
22 posts

Hello, I have never worked with AIR and I know nothing about this software. Anyone knows of a good step-to-step tutorial to convert a Flash SWF game into an Android APK application using Adobe AIR?

Thanks.

posted 2015-09-03T07:22:09-07:00
DelaniStudio

Market Level 2Community Level 5
370 posts

Flash Develops is your friend,download that program,install its sdks(it has automatic option for that).
Create project AS3 Air app, you will get read me files and thats it.

posted 2015-09-03T10:11:24-07:00
bsi73

Market Level 1Community Level 0
22 posts

- Downloaded FlashDevelop 5

- Installed the software with Tool -> Install Software (installed Flex SDK + Air SDK and AIR SDK + ASC 2.0)

- Created a new project with Project -> New Project -> AIR Mobile AS3 App

However now I am stuck. The AIR_Android_readme.txt does not explain where to load the SWF file I want to convert and how to modify the Main.as file to convert the file to apk.

posted 2015-09-03T14:14:15-07:00
JohnBlackburne

Market Level 3Community Level 10
2188 posts

I do it on the command line. The particular line to create an APK from a SWF is

adt -package -target apk-captive-runtime -storetype pkcs12 -keystore bin/sampleCert.p12 -storepass 1234 bin/Qyx.apk bin/Qyx-app.xml bin/Qyx2.swf -extdir bin

The keystore is one I created earlier, as is the .xml file. The swf is generated as part of the same build process, and is the same as I use for testing on the PC so Main.as does not need changing.

posted 2015-09-11T16:10:21-07:00
bsi73

Market Level 1Community Level 0
22 posts

If I use in the command prompt of FlashDevelop

adt -package -target apk-captive-runtime -storetype pkcs12 -keystore bin/sampleCert.p12 -storepass 1234 bin/Qyx.apk bin/Qyx-app.xml bin/Qyx2.swf -extdir bin

I get the error saying ADT is not recognized as a command

How is the xml file Qyx-app.xml created?

posted 2015-09-15T16:13:11-07:00
JohnBlackburne

Market Level 3Community Level 10
2188 posts

ADT is one of the command line tools, part of the AIR SDK. you need to find where that’s downloaded to and add it to your path. Mine is at /opt/flex/bin but yours is probably different.

As for the XML file it's an application descriptor file, like the one here:

http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff1.html

There are other pages around there that describe the particular settings you include for mobile, e.g.

http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffc.html

posted 2015-09-21T20:55:15-07:00
Ions

Market Level 0Community Level 1
0 posts

So to turn a flash swf clip into something the android can read(apk), the FlashDevelop application is needed with a certain command line code? Any full step representation of getting flash swf files onto android because that would be pretty neat.

posted 2015-11-15T15:07:58-08:00
JohnBlackburne

Market Level 3Community Level 10
2188 posts

My command line is above. I could explain every bit of it but you would be better served looking at the documentation. Once the APK is created I just copy it across with Android File Transfer.

posted 2015-11-16T20:28:47-08:00
DelaniStudio

Market Level 2Community Level 5
370 posts

JohnBlackburne wouldn't be easier to use flash develop, and directly compile to device?

posted 2015-11-16T20:30:21-08:00
FoumartGames

Market Level 3Community Level 4
209 posts

Here is the content of a bat file that automates optimization, packaging and testing:

START cmd.exe /k "cd D:\GameDev\_GameJams\_FGL_MobileJam && echo NOTE: Starting optimization... && optimizer -keep-as3-metadata Bindable Managed ChangeEvent NonCommittingChangeEvent Transient -input D:/GameDev/_GameJams/_FGL_MobileJam/app/apk/Game_secure.swf -output D:/GameDev/_GameJams/_FGL_MobileJam/app/apk/Game.swf && echo NOTE: Delete old APK (if any)... && cd app/apk && del Game.apk && cd ../../ && echo NOTE: Packaging... && adt -package -target apk-captive-runtime -storetype pkcs12 -keystore app/certificate/***.p12 -storepass *** app/apk/Game.apk app/apk/Game-app.xml app/apk/Game.swf -C app/apk . && echo NOTE: Preparing to install to emulator... && xcopy /y app\apk\Game.apk c:\sdk\Android_SDK\sdk\platform-tools && C: && cd SDK\Android_SDK\sdk\platform-tools && echo NOTE: Selecting Device... && adb devices && echo NOTE: Installing to emulator... && adb -e -s emulator-5554 install -r Game.apk && adb remount && adb shell monkey -p air.Game -c android.intent.category.LAUNCHER 1"

Enjoy!

posted 2015-11-20T23:01:53-08:00
JohnBlackburne

Market Level 3Community Level 10
2188 posts

On Nov 16, 2015, DelaniStudio said:

JohnBlackburne wouldn't be easier to use flash develop, and directly compile to device?

Easier how? I just type './build' to build it for Flash Player and for Android. Or more precisely I use Terminal’s command line history to save typing it. I could look up the command line for copying it to my test device but have not got round to it.

posted 2015-11-23T21:51:15-08:00
grado

Market Level 0Community Level 0
1255 posts

I could look up the command line for copying it to my test device but have not got round to it.

adb uninstall air.com.domain.game <---- remove existing file

adb install -r gamefile.apk <---- install new file

adb shell am start -n air.com.domain.game/.AppEntry <---- run installed game

posted 2015-12-15T15:36:50-08:00
lmahdi

Market Level 0Community Level 0
0 posts

how can I import swf game and convert to apk mobile

posted 2016-01-18T16:30:41-08:00
JohnBlackburne

Market Level 3Community Level 10
2188 posts

As above. You can use adt which is part of the Air SDK on the command line. It takes a .swf and generates a .apk.

posted 2016-01-18T18:22:02-08:00
lmahdi

Market Level 0Community Level 0
0 posts

On Jan 18, 2016, JohnBlackburne said:

As above. You can use adt which is part of the Air SDK on the command line. It takes a .swf and generates a .apk.

can you give me more information please

posted 2016-01-20T16:37:09-08:00
JohnBlackburne

Market Level 3Community Level 10
2188 posts

See my posts above. In the first there’s the full command line I use, in the second there are links to the Adobe help pages where I learned how to do it all.

posted 2016-01-21T22:16:55-08:00
JohnBlackburne

Market Level 3Community Level 10
2188 posts

On Dec 15, 2015, djstatika said:

adb uninstall air.com.domain.game <---- remove existing file

adb install -r gamefile.apk <---- install new file

adb shell am start -n air.com.domain.game/.AppEntry <---- run installed game

I did get around to looking at this the other day. The above did not work; the first two lines are OK but the last line failed whatever I put for AppEntry, and the documentation on it is unclear. But adt also does it quite straightforwardly:

adt -uninstallApp -platform android -appid air.com.domain.game
adt -installApp -platform android -package gamefile.apk
adt -launchApp -platform android -appid air.com.domain.game

posted 2016-01-23T23:23:41-08:00
lmahdi

Market Level 0Community Level 0
0 posts

can you give a tutorial video for this exemple

posted 2016-01-25T17:52:35-08:00
JohnBlackburne

Market Level 3Community Level 10
2188 posts

I can’t. It is not that difficult: install the Air SDK, then use adt on the command line/in batch files. You can find examples above, help at Adobe’s site, or if you run adt with no parameters it prints out comprehensive help.

posted 2016-01-25T22:00:49-08:00
jjwallace

Market Level 7Community Level 17
4715 posts

Can you make a game for me!

posted 2016-01-26T22:37:25-08:00