Error when testing on device

How is it possible on simulator to work alright all the time, but when I test my project on device to react differently.

I have an actor which is throwing a rock when is pressed (with a certain velocity). In simulator works alright, but on device after I throw the rock one time, the second time the velocity for the rock disappears and it’s falling on the ground…

How is this possible? [import]uid: 89239 topic_id: 17719 reply_id: 317719[/import]

Could be a performance-related issue because that is the major difference between the simulator vs. on-device. It could be some minor calculation that’s affecting the physics calculations is affecting the overall outcome completely.

Also try building with the Xcode simulator to see if it behaves more like the Corona simulator or the device. If it behaves like the Corona simulator, it’s probably performance-related. If it behaves like your device in the Xcode simulator, then it could be an internal bug in which case I would put together a small test case that isolates the issue and upload it with a bug report.

Here’s a link to the form:
http://developer.anscamobile.com/content/bug-submission

But try the Xcode simulator first to see what happens.

Good luck! [import]uid: 52430 topic_id: 17719 reply_id: 67597[/import]

@ jonathanbeebe

Thank you for your reply.

The so called bug is very weird… I tested in xCode simulator and it works fine. It seems that I only have the problem on the device.

I am using the accelerometer and Im thinking that this might be the problem, maybe is draining out the ram or something even tough I’m testing on an iPhone 4.

I will make other tests and let you know.

[import]uid: 89239 topic_id: 17719 reply_id: 67684[/import]

You should be able to check the application/device log output on the XCode organiser to see what your phone is doing. It should give you out of memory messages if that is the issue.

Accelerometer itself shouldn’t cause a problem, unless you are creating a lot of objects within that event. Do you get the issue if all other apps are shut down? [import]uid: 41286 topic_id: 17719 reply_id: 67691[/import]

Yes, it’s a performance issue. I managed to get rid of it now but I’m not sure what I did :slight_smile:

I will analyze the problem and see exactly where was the “bad code”.

Thank you guys for your replies! [import]uid: 89239 topic_id: 17719 reply_id: 67695[/import]

Ignore my post above. I still have the bug :frowning:

I’m now checking the FPS and memory usage to see exactly why is different on the device… [import]uid: 89239 topic_id: 17719 reply_id: 67738[/import]

Would be interested in seeing log output. You can also use this code to show memory usage in the simulator which will help you isolate the “bad code”;

[lua]local function monitorMem(event)
collectgarbage(“collect”)

print( “\nMemUsage: " … (collectgarbage(“count”)/1000) … " MB”)
print("Texture Usage " … system.getInfo( “textureMemoryUsed” ) / 1000000)

return true
end

Runtime:addEventListener(“enterFrame”, monitorMem)[/lua]

Peach :slight_smile: [import]uid: 52491 topic_id: 17719 reply_id: 67884[/import]

Thank you Peach :slight_smile:

I finally solved the problem, the accelerometer was still on that’s why it was affecting the velocity on my device and on the simulator was working :slight_smile:

Stupid mistake!

[import]uid: 89239 topic_id: 17719 reply_id: 67907[/import]

Easy mistake to make - very pleased it’s now sorted :slight_smile:

Peach [import]uid: 52491 topic_id: 17719 reply_id: 67920[/import]