In Xcode you can use the Organizer. Open Xcode, got to Windows->Organizer, in the new window you should see your device on the left hand side with a hopefully green light. Click on console and that should be your Print logs + crash logs.
You can also take advantage of the malleability of the lua interface and override print. While this still won’t get you errors, doing something like this:
local file, err = io.open(system.pathForFile(fileName, system.TemporaryDirectory), "w+")
if file then
file:setvbuf("no")
print = function(...)file:write(table.concat({...}, "\t") .. "\n") end
else
print(err)
end
will mimic the print() call parameters, but instead of sending it to stdout, it’ll write it to a file of your choosing. If you store the old print call, you can set it to do both logging methods as well. This will not effectively catch the errors, but you can hook up your code to have appropriate logs where the errors should be.
One downside is that I believe Corona Indie/Pro strips all your debug symbols, meaning you are likely to end up seeing that variable “?” on line “?” in file “?” was nil, which is horribly ineffective for tracking issues. I’m not sure if there is a good way in Corona Indie/Pro to be able to prevent luac from stripping your debug symbols. [import]uid: 134101 topic_id: 28349 reply_id: 114519[/import]