Debug output when running on device
I have tried a lot of hacks mentioned on the internet to try and get debug output (from the print(..) function) of a Corona app running on a iOS device.
Nothing worked, until I found this great GDNtip
Steps
- You basically create a bin at http://requestb.in/
-
Then you create a print function like this:
local isSimulator = "simulator" == system.getInfo("environment") function prnt(msg) -- do return end -- uncomment this for production build if isSimulator then print(msg) else local postURL = "http://www.postbin.org/foobar" local function networkListener( event ) -- nada because if not in sim won't ever see it end local params = {} params.body = msg network.request( postURL, "POST", networkListener, params) end end
Note, this is not my code, but from the post @ GDN that I mentioned at the start.
Written by Herman Lintvelt
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Corona
Authors
Related Tags
#corona
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#