I have an app that runs on the emulators but not on the series 40 phones themselves. It's a bit of a memory hog, but as far as I can tell it stays within the limits of the platform when I run it under the profiler. But when it runs on the phone, it works for a while and then quits, no message.
Any thoughts on how to debug this? On other phones I can connect a remote terminal to the phone and read what's sent to System.out, but I haven't seen anything like that on the Nokia. Any other way to figure out what's happening on the phone?
It's not an easy task debugging on the devices themselves.
First of all, instead of System.out.println()'s, you can use other methods to save debug info. You can send it through http to a server that logs it, or you can save it in the RMS, and put another MIDlet in the MIDlet Suite that can then read the logs from the RMS. The downside with these methods is that they might affect the performance of the application, and hence the results might not be accurate.
The second option you have is just plain old guesswork. Try to guess what might be going wrong, take out the offending part, run it again and see if it helps. Repeat until your almost sure (because it's practically impossible to be 100% sure) you found the bug.