I posted this technique in an example program in another thread and fogview made it more universal.
As somebody was looking for something like that I am posting it in this section again:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ---- Check if running on device or simulator ---- onDevice = false -- assume running on simulator local path = system.pathForFile("Icon.png", system.ResourceDirectory) if path and string.sub(path,1,6) ~='/Users' then -- Found device if Icon.png found and not in /Users folder onDevice = true end path = nil ------------------------------------------------- if onDevice then print("Running onDevice ...") else print("Running in Simulator ...") end |