SapphireSteel Forum
Welcome, Guest. Please login or register.
May 21, 2013, 12:02:27 AM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Ruby In Steel and Amethyst IDEs
3883 Posts in 799 Topics by 669 Members
Latest Member: m
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Amethyst
| | |-+  iOS debugging
« previous next »
Pages: [1] Print
Author Topic: iOS debugging  (Read 1462 times)
Jason King
Full Member
***
Posts: 159


« on: May 09, 2012, 10:14:23 PM »

With CS6, I wanted to start kicking the tires for iOS development using AIR.  Is Amethyst able to remote debug an iOS device like how CS6 provides (or preferably better  Grin)?

The process under CS6 works but requires quite a few long steps... build the IPA, copy/sync the IPA to the iOS device, enter remote debugging in Flash, and finally run the IPA on the iOS device.  Given this process, I imagine I would avoid debugging on the iOS device as much as possible.  If Amethyst could automate this system (at all) and (more importantly) allow me to use Visual Studio/Amethyst's debugging Ui instead of Flash, then that would be most excellent.

Let me know if this ability is already in place - if not then let me know if you need a beta tester.

Cheers,
Jason
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #1 on: May 10, 2012, 04:30:09 AM »

In principle, yes.

There's a bit of history to this. Adobe went through a number of versions of the AIR SDK pretty rapidly 2.5, 2.6, 2.7, 3.0, 3.1, 3.2 and now 3.3. There were a number of problems with 2.5 and we stopped work at 2.5 until they got themselves sorted out. We've recently tried again with 3.3. However, we still can't download into the iOS Simulator on an iMac using 3.3, so it's still not right. However, it's a good bit closer.

What we need to do is to put some work that we've done on Amethyst 2 back into Amethyst 1.6 and you should be ok to work with iOS and Amethyst. All you need to do is to use Amethyst to 'deploy' to iOS and then put Amethyst into 'Listen' mode on the USB port. In theory, the Amethyst debugger should then pick up on the inbound connect request from the Flash runtime on the iOS device when you start the app and you should be able to debug as normal. However, as I said, we've not been able to test this due to problems with the AIR 3.3 SDK.

But, if you're willing to give it a go, we can do the work and get a fixed version of 1.6 with iOS support for you to try. It works OK with Android (with a bit of port forwarding), so it should be good for iOS.

Dermot
« Last Edit: May 10, 2012, 09:33:31 AM by Dermot » Logged
Jason King
Full Member
***
Posts: 159


« Reply #2 on: May 10, 2012, 10:02:13 AM »

Hi Dermot,

I would definitely be up for giving the listen mode a shot.  Let me know when you have an update to 1.6 and I'll give it a go.

Cheers,
Jason
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #3 on: May 13, 2012, 01:18:35 PM »

Hi Jason,

We've build a new version with improved mobile support (details below) - but we haven't been able to test it with an iOS device. However, it does work correctly with Android emulator and we think that you should be able to get it to run with an Apple tablet.

This how it all works:

1) Deployment is a separate MSBuild step. Typically you might 'build' first' then 'deploy'. You set a project to be deployable by checking the 'Deploy' box in Build | Configuration manager. This is only available for mobile projects, so you must start with a Flash or Flex mobile project. Also such a project will display a 'Deploy' Project Properties tab with all the relevant properties that you need to set (passwords, provisioning, etc.)

2) Deployment occurs by Amethyst calling the batch file deploy-ios.bat or deploy-android.bat. These are in 'C:\ProgramData\SapphireSteel Software\Amethyst 2010' and you can modify them as you wish. Essentially a set of parameters is collected from the project properties (like the iOS provisioning file) and passed to the bat file which then executes the appropriate 'packager'. The iOS file currently does nothing useful (because I don't think you can deploy from windows - but I could be wrong here). Anyway, if you want try hard coding that file to do what you want and see if you can get the image copied onto the tablet. Set @echo on to see output displayed in the VS Output Window pane.

3) The second step is the debugger activation. This can be either over straight TCP/IP (WIFI) or USB. In the first case, the debugger attempts to start the app and then listens on port 7935 for an inbound connect from the app. For an Android app, the debugger starts the app, and connects. For an iOS app, you will have to start it manually, the app should then connect to the debugger and you're away. For USB debugging (when the tablet is connected via a USB cable, you have to check the USB option in the Deploy page). When the debugger is launched, it tries to forward port 7936. It does this (currently) by using the Android port forwarder utility, so it's a good idea to install the Android SDK. However, you can do this manually or whatever is required by iOS (this is where my knowledge of iOS runs out, but see this link for some more info http://forums.adobe.com/message/4325942). If Amethyst can't forward the port, it will complain but continue. The debugger then connects to port 7936 (which is why it has to be forwarded) and repeatedly tries to do this until it finds something it can talk to. The number of retries is set in Tools | Options |Debugger | Amethyst (as is the USB forwarding port - but don't change that - I think it's hard coded in AIR).

4) The tool (which the deploy batch file uses) is the 'adt' tool from the Adobe AIR SDK. A new one (beta 3) has just been released, so make sure you use the latest SDK. If you can get a command line to work, I can incorporate this into the ios_deploy.bat and the debugger start up commands. You'll also need to set the path to adt in the Tools |Options|Projects|Amethyst settings

I'm out until Wednesday, but see how far you get with the above.

LInks are here http://www.sapphiresteel.com/downloads/amethyst_beta/amethyst_VS2008_1_6_0_1361f.zip and http://www.sapphiresteel.com/downloads/amethyst_beta/amethyst_VS2010_1_6_0_1361f.zip

Dermot
« Last Edit: May 13, 2012, 01:24:48 PM by Dermot » Logged
Jason King
Full Member
***
Posts: 159


« Reply #4 on: May 18, 2012, 02:46:24 PM »

Hi Dermot,

I had to pull myself off our iOS development for the short term... as soon as I can get back on I'll grab the new version and give it a go.

Cheers,
Jason
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #5 on: May 21, 2012, 12:28:06 PM »

Hi Jason,

No problem ... let me know when you're ready to try it.

Dermot
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #6 on: June 10, 2012, 12:57:26 PM »

Hi Jason,

We've got the full deploy mechanism to the iOS simulator working now with AIR 3.3 beta 3 (this seems to fix a showstopper in beta 2). We've also got the debugging working correctly as well, so you can now build, deploy and debug to an iOS simulator (running on a Mac of course).

Dermot
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!