Using the simulator for Android

My game is running fine on both the iPhone and Android simulator however when I actually install the game on my Android device it simply does nothing (this may be the same for iPhone but I don’t have an iDevice to test).

Is it possible to run the simulator in a “strict” mode so if there is something that is currently working for iPhone but not for Android it will spit out some warnings/errors? [import]uid: 5833 topic_id: 1058 reply_id: 301058[/import]

did you examine the output of the terminal when you build for the android? [import]uid: 5712 topic_id: 1058 reply_id: 2600[/import]

Yea, but I wasn’t entirely sure what to look for. However it reported that it was built successfully.
[import]uid: 5833 topic_id: 1058 reply_id: 2605[/import]

Most likely, you’re trying to use something that isn’t implemented yet. Check the release notes for the list.

Are you using textbox, textfield, or webpopup? If not, what other esoteric things are you using?
[import]uid: 54 topic_id: 1058 reply_id: 2675[/import]

esoteric things, LOL

Eric, when you have implemented these things on the Android, can we call you a medium then? Because it is so out of this world… these things :slight_smile: [import]uid: 5712 topic_id: 1058 reply_id: 2690[/import]

I wasn’t using anything like that, I will start creating some basic tests and build up slowly to see which part of it my device doesn’t like.

On a side note, is it hoped/planned that when 2.0 comes out of Beta the Android functionality will be on par with the iPhone or will there still be a way to go? [import]uid: 5833 topic_id: 1058 reply_id: 2778[/import]

The plan is for Android to be on par with iPhone. There will be some differences simply because the platforms offer different things. We’re working those out as we implement them. [import]uid: 54 topic_id: 1058 reply_id: 2898[/import]

Yea I figured there’d be some platform differences due to the nature of the devices.

Back to the original problem, I have now got an iPhone (first gen, donated by my old Uni to me) and am experiencing the same problem as with the Android build. I’ve built a handful of the sample apps and they all work fine.

Is there any form of on-device debugging or output? The XCode console doesn’t really tell me anything. [import]uid: 5833 topic_id: 1058 reply_id: 2918[/import]

To my knowledge there is no debugger or terminal output tool for Corona apps running on actual devices. If we can’t have a real-time debugger I would settle for a Terminal console output that would display run-time errors and print statements. Maybe this will come in a future version of the SDK.

Here is what I do to debug on an actual device.
If you have an app that only runs on a actual device I would first load it into the Simulator (“Corona Terminal”) and it will show if you have any major problems with the syntax of your main.lua code and other modules you may be using.

Next I add Alert boxes (for iPhone/iPad) in place of print/debug statements. If you have any screen space available, you could display some short status message/variables on the screen you’re debugging.

I was also thinking about creating a generic “information page” that I could transition in/out of my main display to keep track of variables and program trace/status information. My goal would be to create this once and reuse it among the programs I’m building.

If you have some device specific features that won’t run in the simulator, you could stub out those functions (or simulate the functions) in order to test and debug the rest of the program on the simulator.

I would love to hear how other developers are debugging their programs on actual devices.

Tom [import]uid: 6119 topic_id: 1058 reply_id: 2920[/import]

So your game doesn’t work on iPhone? Or Android?

On Android, if you have the Android SDK installed, you can do a “adb logcat” to see the Android log. This won’t tell you everything, but it may point a clue.

I know this is a bit painful, but is there any way you can pare it down in order to narrow down where something goes wrong?

Is there a way you can send me a copy (either of the app, or if it isn’t a problem for you, the source)?

Where are you located? [import]uid: 54 topic_id: 1058 reply_id: 2921[/import]

Also I logged an enhancement request for an on-device trace() type of command, which would be less painful than using alerts. [import]uid: 54 topic_id: 1058 reply_id: 2922[/import]

Thanks Eric.

Tom [import]uid: 6119 topic_id: 1058 reply_id: 2923[/import]

Eric,

I noticed on the Multitouch sample code (for iPad) that it used print() statements to display some of the distance information. Since Multitouch is not functional in the Simulator I was curious why that code was there. I’m assuming you have an enhanced simulator or a way to display print() output from an actual device.

It would be nice to know if either one exists and if that could be made available to developers some time in the future.

Thanks,
Tom [import]uid: 6119 topic_id: 1058 reply_id: 2925[/import]

@Tom - Thanks for the advice, I will add some alerts to see if the game even starts up.

@Eric - I can zip up the project folder and send it to you if you want/don’t mind taking a look? It would be amazingly helpful and it’s not like it’s top-secret NDA protected stuff :slight_smile:

Edit - How did I spell a 4 letter name wrong? Wow I must be tired. [import]uid: 5833 topic_id: 1058 reply_id: 2924[/import]

Send to me at eric @ anscamobile.com. I’ll delete it once we get it working. [import]uid: 54 topic_id: 1058 reply_id: 2926[/import]

Sent, thank you for doing this. [import]uid: 5833 topic_id: 1058 reply_id: 2927[/import]

For anyone following this at home, the problem was that in the Simulator, require is not case sensitive, where on device it is. Entered as case # 240. [import]uid: 54 topic_id: 1058 reply_id: 2928[/import]

Was just about to post this but got too distracted at actually having my game working on my device, I’m currently laughing and smiling like a giddy child. [import]uid: 5833 topic_id: 1058 reply_id: 2929[/import]

Some here are writing that you can’t see print output from Corona Apps on the actual devices!?

I don’t understand this because when I am using the xCode Organizer I can watch the Console output of the Device and even (with Reload) can watch the output while the application is running on the device. [import]uid: 6928 topic_id: 1058 reply_id: 3162[/import]

@OderWat

I didn’t realize that the Console Output in Organizer would show the Corona print calls so I tried it and it does work. The only problem on my system is the display is not real-time, even if I click Reload. Only when I exit the app does the Console display update. (I’m still running Xcode 3.1.4.). It looks like the print statements are saved in a temporary log file and transferred back to Xcode when the program terminates.

It seems that the Corona SDK is using the same output scheme used by NSLog() for Xcode. When you build under Xcode you can see NSLog() calls in the Debugger Display window. The Debugger Display window is grayed-out when no Xcode project build so it still doesn’t display my Corona print statements.

I would be happy using the Xcode Organizer Console Output if it was real-time but at least I could add some print statements and get a list of the outputs after I stop the program.

Do you know what you did to get the real-time output?

I think this is an import tip and should be in the Corona documentation.

Thanks,
Tom [import]uid: 6119 topic_id: 1058 reply_id: 3168[/import]