View unanswered posts | View active topics



Reply to topic  [ 4 posts ] 
Android like application upload for testing on iOS 
Author Message
Member

Joined: Wed Jun 27, 2012 10:44 am
Posts: 34
Reply with quote
Hi people,

I have started developing for Air mobile lately.
I was glad for toying with Android, but not so much with iOS.

I don't like Apple for many reasons.
And now that I tried developing for iOS I find them laughable.

What a mess to get an app running.
Drap and dropping you app, two or three clics.
I couldn't stand it, and I couldn't find anything proper on Windows.
(I'm sure it is much better on Mac, with ObjectiveC, and if you have a poster of jobs behind you).

So I got to work to get is as close as possible to the Android testing confort.
In the end, I got something close enough and I thought it might interest people here.
Maybe even can we make it evolve a little more (make the scripts work nicely with the FlashDevelop variables).

I am on Windows7, and I used an iPhone3GS with iOS5.

It is important you understand I spent the day testing some stuff, and even if I can reproduce what needs to be done easily from my current setup (that's what I will cover here), I can't remember every thing I did and installed previously.
If you see anything relevant (the need for a specific software, a procedure to make) please say so and I will update this post.

Basically, to start this procedure you need to be able to transfer files to your device throw SSH and install them with Installous.
That means your device needs to be rooted, that you need to have OpenSSH and Installous installed and WinSCP on your computer (Maybe some other software can do it, but I use a WinSCP scipt latter).
Many tutorials on the web should bring you there.

I also use 7Zip on my script.


Once you are here, the idea is quite simple, and therefor solid.

An iPhone app is pretty mush an xxx.app folder on your device.
Pretty much, it is, because if you just upload the folder, it doesn't work (couldn't launch it, couldn't get a link on the Spring board).
I tried to use some shell scripts I found on the web (and one on the Installous application folder) to install from the ipa file but they all sent bugs.

So I gave up on installing and just used installus.
It is not automatic, and therefor not the objective.
But it is just the first time, and everything is set properly.

Once you have it installed, you can now just replace the xxx.app folder with whatever you unzip from the ipa file Flashdevelop gives you.
The application will remain valid, the link will work etc etc.
And this simple upload can easily be made automatic.


On my bat folder, I added to scripts:
You obviously need to Change some datas (WinSVC session name, Project/App name locations).

Upload_iPhone_Debug.bat
Code:
rmdir /s /q "dist/uncompressed"

"C:\Program Files\7-Zip\7z.exe" x dist/MyProjectName-test-interpreter.ipa -odist/uncompressed

"C:\Program Files (x86)\WinSCP\WinSCP.exe" /console /script="bat\WinSCP_Scipt.txt"

rmdir /s /q "dist/uncompressed"


WinSCP_Scipt.txt
Code:
open "My WinSCP session name"

call killall MyProjectName

lcd "dist/uncompressed/Payload/"
rmdir -s -q "MyProjectName.app"

cd "/private/var/mobile/Applications/37585FD9-AD84-44B0-980F-F21736331A4F"
put "MyProjectName.app"

exit


I don't know what this "37585FD9-AD84-44B0-980F-F21736331A4F" is for... I have two such folders on my mobile/Application directory and obviously there are generated randomly.
You need to retrieve the proper path from the installation directory Installous made.


Once you are there, all you need is to modify the Run.bat file.

Search for "Now manually install and start application on device", yell "HELL NO!" and edit as such:

::echo Now manually install and start application on device
::echo.
::goto error

echo Now updating
call bat\Upload_iPhone_Debug.bat
goto end


In order you should see a decompression process, your application be killed (if running) and an upload process.

I did not manage to launch the application.
En Erica Utilities is supped to do that but it doesn't seem to work on iOS5.
So you still need to push once the app icon on the sceen.

The process is long, given this is iPhone packaging ( captive runtime means longer to transfer) but it still appends way before the debugger gets tired of waiting.


So that is a first scrap.
I will catch over this post and update it as informations come.
Please help me make this better

For example:
For those used to it, how to modify the script for it to work with a dynamic project name.
What is the command line to kill the debugger from the start (rather than waiting for the application to die) I think it sometimes overlaps with the next debugging session start.
Is there a shell command to get back the folder Installous installed the app?
How to launch the application from command line?
Is there an adt option to start by not zipping the ipa file.
How to optimize transfer (maybe some files haven't changed).
Anything that comes in mind is welcome.

If we can manage that, and although yes it needs to be rooted, I think we could get something as comfortable as with android.
Thanks.


Tue Jul 03, 2012 4:25 pm
Profile
Member

Joined: Tue Jun 15, 2010 10:27 pm
Posts: 30
Reply with quote
You can install and uninstall using AIR 3.3 or later. Something like:

Code:
"java"  "-Xms32m" "-Xmx32m" "-jar" "E:\Program Files\Adobe\_AIR SDKS\AIRSDK 3.4.0.2200\lib\adt.jar" "-installApp" "-platform" "ios" "-package" "MyApp.ipa"

Code:
"java"  "-Xms32m" "-Xmx32m" "-jar" "E:\Program Files\Adobe\_AIR SDKS\AIRSDK 3.4.0.2200\lib\adt.jar" "-uninstallApp" "-platform" "ios" "-appid" "com.my.app.MyApp"

You can also include code in your .bat file to package the ipa file. There's still no way to automatically launch an app once it's been installed, though.


Sat Jul 21, 2012 6:34 am
Profile
Member

Joined: Wed Jun 27, 2012 10:44 am
Posts: 34
Reply with quote
I knwo it is possible with the Air3.4 beta.
Didn't knew for 3.3.

One way or another, yeah, this topic became pretty useless.


Wed Jul 25, 2012 10:38 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
I spent days trying to do what you did, horsetopus, congrats although AIR 3.4 finally automates this (I still have to update the templates though).


Sat Jul 28, 2012 4:23 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.