no console output

I dont get any output in the console ?
My code works in the mobile phone simulator but no output in the console every time I touch the image. For debugging in the future i wanted to display something in the console.

function playerMove(event)
print(“touch”) —no output
if event.phase == “began” then
print(“touch”) —no output
player:incrementPosition(10,10);
return true
end
end

rect:addEventListener(“touch”, playerMove) [import]uid: 138547 topic_id: 25054 reply_id: 325054[/import]

Were you previously getting print statements?

Have you tried the usual? Eg, reinstall, restart, testing with a new project, making sure only one terminal window is open, etc? [import]uid: 52491 topic_id: 25054 reply_id: 101773[/import]

yes i redid another project and everything you said.

there is no console output and no console print with this code shown above. at startup my print commands work fine.

print works fine except if in a loop situation it seems.

local function gameLoop(event)

print(“moving”); --not working
end

Runtime:addEventListener(“enterFrame”, gameLoop) [import]uid: 138547 topic_id: 25054 reply_id: 101782[/import]

That is quite strange, that prints fine for me.

Have you used io.output():setvbuf() anywhere? [import]uid: 52491 topic_id: 25054 reply_id: 101804[/import]

no I havent used this.

i can print but not inside an event while it is running.

[import]uid: 138547 topic_id: 25054 reply_id: 101813[/import]

I redid my project and this is the whole code.
I dont get repeated output in the console but the code works on the phone simulator.

function draw()
rect = display.newRect(0, 300, 50, 50)
rect:setFillColor(255, 255,50)

end

draw();
function playerMove(event)
print(“touch”)
if event.phase == “began” then
print(“touch”)
rect.x =rect.x+1
return true
end
end

rect:addEventListener(“touch”, playerMove)

local function gameLoop(event)
rect.x =rect.x+1
print(“moving”);
end

Runtime:addEventListener(“enterFrame”, gameLoop)
[import]uid: 138547 topic_id: 25054 reply_id: 101821[/import]

the problem is solved if i dont use intellij to run the project [import]uid: 138547 topic_id: 25054 reply_id: 101829[/import]

I have one last suggestion, which would be to do a totally clean reinstall. Steps:

  • Deauthorize
  • Delete CoronaSDK from Applications
  • Go to users/library/preferences and delete files starting with com.anscamobile (normally up to three of them)
  • Empty trash
  • Reinstall
  • Authorize

(For step 3 if you are on Lion you will need to click “Go” in finder then press ALT to make the correct library folder appear.)

Are you able to try that and let me know if it fixes the issue, please? [import]uid: 52491 topic_id: 25054 reply_id: 101830[/import]

Dont I have to be a subscriber to do this?
I am just using the trial corona sdk as I am learning it?

How do I delete corona from all applications as it isnt installed. Do you mean get rid of it from intellij ?
[import]uid: 138547 topic_id: 25054 reply_id: 101968[/import]

I am not keen to fiddle around with corona, and I am not a subscriber as yet.

I read other people have the same issues with intellij and the console.

Might be easier to find someone who has got this to work already. [import]uid: 138547 topic_id: 25054 reply_id: 101979[/import]

Wait, doesn’t Intellij have a built in console? I didn’t realize you were using a third party tool, I thought you were referring to the actual terminal.

For this you would want to contact Intellij support, supposing the issue only happens when using that software. [import]uid: 52491 topic_id: 25054 reply_id: 102004[/import]

i am using intellij but it uses the corona simulator with terminal.

Now if i simply run the simlator and run the project from there , the console will have all the correct output.

However when running the same project from intellij which calls the same simlator the console fails to print properly. [import]uid: 138547 topic_id: 25054 reply_id: 102027[/import]

OK, so Corona with the terminal works just fine and prints correctly - so your next step of action is really to get support from Intellij creators as we don’t offer support for third party tools.

Good luck,
Peach :slight_smile: [import]uid: 52491 topic_id: 25054 reply_id: 102091[/import]

I am having a similar problem: I have no output to console when using iOS simulator, NOR with Xcode when testing on a device.

This code

local n = display.newText("Hello!", 100,100)  
print ("Hello! in console.")  

does give output in Terminal, when running in the Corona simulator. But, there is no output of any kind when running in iOS simulator, nor on an actual device.

(update)

However, this seems to work!!!
io.write( “My console data\n” ) – write the string to console
io.write( “My console data 2\n” ) – write the string to console
io.flush()

Now, that I use an io.flush(), wherever I can, I am getting output. It seems that even when the app was pausing, the output was never flushed.

This seems strange because I added

io.output():setvbuf('no')

at the beginning of my code.
[import]uid: 37366 topic_id: 25054 reply_id: 102981[/import]