1

Environment:

  • Flash Builder 4.6
  • AIR SDK 3.1
  • OS X 10.7.3

I'm debugging a problem that does appear in iOS builds of app that uses my SWC library, compiled with FB, and does not appear in the iOS builds of very similar app done with raw AIR SDK.

I suspect that the reason of a problem is a difference in compiler configuration. Now I'm trying to manually (and unsuccessfully) craft the ant's build.xml so it would match whatever I think FB is doing in hope that I would see the same crash at some point. But this is not very effective.

Is there a way I can see how FB invokes adt etc. and compare that with my ant config?

Any other troubleshooting hints?

Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160

3 Answers3

2

This reminds me my older answer.
In short, you can create program that logs its arguments, backup original adt and substitute it with it (your program might even run original adt with those arguments.)

Community
  • 1
  • 1
alxx
  • 9,897
  • 4
  • 26
  • 41
  • Hmm, doesn't it invoke Java version directly? But, anyway, one can proxy that Java code as well. Good idea. Can you think what else should I proxy besides adt and mxmlc? – Alexander Gladysh Feb 17 '12 at 16:02
  • No, it just ignores `adt` binary, and runs `java` executable with `-jar adt.jar`... Got all the flags by replacing `java` with a script which logs command line to a file and then starts the old `java`. – Alexander Gladysh Feb 18 '12 at 23:22
  • NB: figured out the above with `$ sudo execsnoop -v -a -e` (on OS X) – Alexander Gladysh Feb 19 '12 at 00:24
0

I've combined answeres from another thread and wrote this:

just build a runnable jar file

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;


public class adt {

    /**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException {
        String argsString = "";

        for(int i=0; i<args.length; ++i)
        {
            argsString += args[i];
        }

        Process proc = Runtime.getRuntime().exec("java -jar adt2.jar " + argsString);

        File txt = new File("C:\\command.txt");
        try(FileWriter writer = new FileWriter(txt))
        {
            writer.write(argsString);
        }

        try {
            proc.waitFor();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        InputStream in = proc.getInputStream();
        InputStream err = proc.getErrorStream();

        byte b[]=new byte[in.available()];
        in.read(b,0,b.length);
        System.out.println(new String(b));

        byte c[]=new byte[err.available()];
        err.read(c,0,c.length);
        System.out.println(new String(c));

        File out = new File("C:\\output.txt");
        try(FileWriter writer = new FileWriter(out))
        {
            writer.write(new String(b));
        }

        File errors = new File("C:\\errors.txt");
        try(FileWriter writer = new FileWriter(errors))
        {
            writer.write(new String(c));
        }
    }

}
Community
  • 1
  • 1
Yitzchak
  • 3,303
  • 3
  • 30
  • 50
0

A likely case is that flashbuilder is using a separate copy of the AIR SDK, that is older. You can check the folder here (windows): C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks

To see if you are using the most current AIR sdk.

Plastic Sturgeon
  • 12,527
  • 4
  • 33
  • 47
  • It is Flash Builder 4.6, and it is using Flex SDK 4.6.0, which, according to README, is bundled with AIR 3.1. Both `adt` executables report themselves as `3.1.0.4880` – Alexander Gladysh Feb 17 '12 at 23:54