Developing mobile applications without being able to debug them can be a pain. Sometimes a good logger like SOSmax can do the job, but its also possible to use FDT’s debugger to debug your applications live on the device.
The only tweak that is needed is to add an additonal parameter when packaging your Android, Playbook or iOS application.
-connect "your computers ip"
Before the app starts up on the device, simply start the FDT debugger so it can listen for a connection to your device.
<fdt.startDebugger switchperspectiveonbreakpoint="true" projectname="Projectname"/>
When the application has launched it will connect to the debugger and you will be able to step through breakpoints and see traces in the console.
If there are any problems make sure your pc and device are part of the same network and your application was packaged in debug mode, means with one of the following arguments:
- -target ipa-debug (iOS)
- -target apk-debug (Android)
- -devMode (BlackBerry Playbook)
Have fun.
Richard, Flo2611: you need wi-fi enabled on the device. You still use the USB cable to deploy, but you’ll need the wireless connection to connect back to the computer and send the trace data. I made the same mistake by misunderstanding the debug naming.
So just have wi-fi on and use the wireless debug profile, even if you’re using a USB cable.
I have exactly the same kind of probleme as Richard.
Although I can build and deploy to my Playbook fine with -devMode set (which pops-up an ‘unable to connect to debugger at …..’ message understandably, when I add the
<fdt.startDebugger ….
line, I always get a java.lang.NullPointerException in the FDT console and the debugger is never launched (using FDT 4.5.1 MAX)
Any ideas?
Is there anyway to use SOS while testing in the real device like for example in the iPad?
i can’t get anything to trace using usb and android_debug_build.xml
haven’t tried on wireless yet but tried changing “-connect” to “-listen” in android_wireless_debug_build.xml
and get the following..
Using Flex SDK 4 Debugger Adapter.
[Info] Could not connect to the player
and on the device it gives me the “adobe air waiting for connection”
any suggestions?
There is a bug where only works if your project is in the workspace directory. If your projects are in folders outside of the workspace will fail.
Joey,
if you want to debug via USB you can simply use “-listen” instead of “-connect”. There is no need to add the ip of the host PC then but you can specify the port, by default it uses tcp 7936. I made the experience that debugging via network works most reliable. For more information check out the ADT options.
Also a quick tip: Instead of hardcoding the host ip in your ant file you can also use FDTs Ant task FDTHostIP: -connect ${FDTHostIP}
Philipp,
you can also use the USB debugging option with iOS-update but this is not possible with the fdt.startDebugger. Could this be added to the FDT4.6 release, while the USB-option is much easier to set up when not having a local network (underway/at client) and speed/performance.
Just a thought.
😉