Windows: Eclipse + Koneki + Corona first steps setup?

I found this video explaining how to get debugging working once Eclipse + Koneki is set up.

I thought that getting the Eclipse-Koneki 1.0 Stand-Alone version would at least set up Code Assist for Lua, but I can’t duplicate what Benjamin gets when he starts typing “for”.

Before the stand-alone version I tried the two regular methods on their Installation page with the latest stable Eclipse (Indigo).

So there must be something basic that I’ve missed. Is the above version the correct link?

Basically, my questions are:

  1. What do I download?

  2. How do I get Code Assist working? (Preferably also with Corona SDK)

  3. How do I make Eclipse-Koneki aware of the Corona Simulator, so I can Run it from Eclipse?

After that, I’m pretty sure I can follow the Youtube video for the debugging part.

I’ve posted similarly in the Eclipse-Koneki forum, but while the post has a massive 6335 views, there’s no answer yet.

If you want more information, just ask. And if you think it’s ridiculously hard to do or I should be content with just a text editor, then say so. :slight_smile:

@Zen G,

A short time back I submitted articles on how to do this.  If they are approved they will probably show up in this section: https://docs.coronalabs.com/guide/

That said, here are links for the drafts of the articles that would help you try this:

Warning: These are all drafts.

Warning 2: I’ve tested all of the steps on my three machines, but you’re still a bit of a guinea pig as the first user to try these.

Note: Any feedback is welcomed, just put it in this forum post if you like.

Cheers,

Ed

I’m a very happy guinea pig now   :slight_smile:

The guides worked very well. There were one or two head-scratchers at just the last steps before typing ‘run’ in the terminal due to differences in Eclipse, but nothing I couldn’t solve.

I have 3 questions:

  1. Is there a way to modify the small “require” code snippet so that it doesn’t cause an error message when I launch the app from Eclipse in normal Run mode? Just something so you don’t have to comment it out and in. I think the error was on line 122 in debugger.lua.

  2. Is that code needed in each .lua file that you want to put a breakpoint in, or does it set globals?

  3. I wrote down exactly what I did and if you want, you can compare it or ask me what was different. (See attachment.) Can I put these steps in my blog?

Hi all,

I am an Eclipse Koneki developer, I just take a look this afternoon on Corona to test if our next release of Lua Development Tool (LDT) 1.0 work fine with Corona.

I just saw roaminggamer’s documentation about this, great job, it will help us to anwser Corona questions on the Koneki forum.

About the soon release of LDT 1.0, the 1.0RC1 is already available here with release note here.

As you can see in the New & Noteworthy, we have enhanced the support of non-stardard lua interpreter.
So it now possible to add Corona Simulator as an interpreter, Adding corona as an interpreter allow to debugger faster corona project with less configuration, see folowing steps:

  1. Add a new interpreter for corona simulator in the Lua/interpreter preference page by selecting “add” and selecting the Corona Simulator executable as Interpreter executable, adding “-debug” to “Interpreter arguments” and uncheck the option “Accept -e as argument”.
     
  2. You should still add the following code at the begging of your project:

if (system.getInfo(“environment”)==“simulator”) then
    require(“debugger”)()
end

3)  Copy the debugger.lua file by clicking on the top menu
“Run/Debug Configuration” and then create a “Lua Attach to application”
launch configuration and click on the link “Lua Debbuger Client” and
select “Corona SDK/Ressources” folder.

  1. Then go to top menu “Run/Debug Configuration” and create a “Lua Application”  launch configuration  which will use the created Corona interpreter as runtime interpreter and launch it in debug mode.

But, the configuration to enable debugging can be even faster and easier.

The step 2 can be skipped if the Corona Simulator can handle the following command line:
Corona Simulator -e "require “debugger”() C:/Corona Project/hello/main.lua
Where -e option enable to execute some lua in the VM just before executing the main.lua as the standard lua interpreter already do. LDT use this option on regular intrepreters to bootstrap the debugger. I don’t find any clue to do that righ now with corona, maybe there is some documentation about the options the Corona Simulator can handle ? The goal is to let LDT launching the debugger instead to add some debugging code in our projects.

The step 3 can be skipped also. In fact, LDT add to the LUA_PATH the path to the debugger lua module before launching the corona simulator but it seems that the corona simulator override the LUA_PATH variable to put his own path that doesn’t include the path the debugger module. Does anyone know how to customize the LUA_PATH in corona or a way to avoid corona simulator to override the LUA_PATH variable ? The goal is to find a way to let LDT configure the buildpath automaticaly

This two limitations avoid to start debugging a corona project really easly. Finding a solution to theses will not only help debugger with Koneki LDT but also help all others external tooling which want to interact with the Corona Simulator.

If some points are unclear feel free to ask.

Marc
 

@Zen G,

A short time back I submitted articles on how to do this.  If they are approved they will probably show up in this section: https://docs.coronalabs.com/guide/

That said, here are links for the drafts of the articles that would help you try this:

Warning: These are all drafts.

Warning 2: I’ve tested all of the steps on my three machines, but you’re still a bit of a guinea pig as the first user to try these.

Note: Any feedback is welcomed, just put it in this forum post if you like.

Cheers,

Ed

I’m a very happy guinea pig now   :slight_smile:

The guides worked very well. There were one or two head-scratchers at just the last steps before typing ‘run’ in the terminal due to differences in Eclipse, but nothing I couldn’t solve.

I have 3 questions:

  1. Is there a way to modify the small “require” code snippet so that it doesn’t cause an error message when I launch the app from Eclipse in normal Run mode? Just something so you don’t have to comment it out and in. I think the error was on line 122 in debugger.lua.

  2. Is that code needed in each .lua file that you want to put a breakpoint in, or does it set globals?

  3. I wrote down exactly what I did and if you want, you can compare it or ask me what was different. (See attachment.) Can I put these steps in my blog?

Hi all,

I am an Eclipse Koneki developer, I just take a look this afternoon on Corona to test if our next release of Lua Development Tool (LDT) 1.0 work fine with Corona.

I just saw roaminggamer’s documentation about this, great job, it will help us to anwser Corona questions on the Koneki forum.

About the soon release of LDT 1.0, the 1.0RC1 is already available here with release note here.

As you can see in the New & Noteworthy, we have enhanced the support of non-stardard lua interpreter.
So it now possible to add Corona Simulator as an interpreter, Adding corona as an interpreter allow to debugger faster corona project with less configuration, see folowing steps:

  1. Add a new interpreter for corona simulator in the Lua/interpreter preference page by selecting “add” and selecting the Corona Simulator executable as Interpreter executable, adding “-debug” to “Interpreter arguments” and uncheck the option “Accept -e as argument”.
     
  2. You should still add the following code at the begging of your project:

if (system.getInfo(“environment”)==“simulator”) then
    require(“debugger”)()
end

3)  Copy the debugger.lua file by clicking on the top menu
“Run/Debug Configuration” and then create a “Lua Attach to application”
launch configuration and click on the link “Lua Debbuger Client” and
select “Corona SDK/Ressources” folder.

  1. Then go to top menu “Run/Debug Configuration” and create a “Lua Application”  launch configuration  which will use the created Corona interpreter as runtime interpreter and launch it in debug mode.

But, the configuration to enable debugging can be even faster and easier.

The step 2 can be skipped if the Corona Simulator can handle the following command line:
Corona Simulator -e "require “debugger”() C:/Corona Project/hello/main.lua
Where -e option enable to execute some lua in the VM just before executing the main.lua as the standard lua interpreter already do. LDT use this option on regular intrepreters to bootstrap the debugger. I don’t find any clue to do that righ now with corona, maybe there is some documentation about the options the Corona Simulator can handle ? The goal is to let LDT launching the debugger instead to add some debugging code in our projects.

The step 3 can be skipped also. In fact, LDT add to the LUA_PATH the path to the debugger lua module before launching the corona simulator but it seems that the corona simulator override the LUA_PATH variable to put his own path that doesn’t include the path the debugger module. Does anyone know how to customize the LUA_PATH in corona or a way to avoid corona simulator to override the LUA_PATH variable ? The goal is to find a way to let LDT configure the buildpath automaticaly

This two limitations avoid to start debugging a corona project really easly. Finding a solution to theses will not only help debugger with Koneki LDT but also help all others external tooling which want to interact with the Corona Simulator.

If some points are unclear feel free to ask.

Marc
 

Hi All,

Thanks for the guides. I am running Mac OSX mountain lion and after following the above instructions i am stuck at the following error: 

Exception occurred executing command line.

Cannot run program “/Applications/Development/CoronaSDK/Corona Simulator.app” (in directory “/Applications/Development/CoronaSDK/SampleCode/Graphics/Fishies”): error=13, Permission denied

Do i have to configure a path variable somewhere or file permission?

Thanks

Nick

Hi All,

Thanks for the guides. I am running Mac OSX mountain lion and after following the above instructions i am stuck at the following error: 

Exception occurred executing command line.

Cannot run program “/Applications/Development/CoronaSDK/Corona Simulator.app” (in directory “/Applications/Development/CoronaSDK/SampleCode/Graphics/Fishies”): error=13, Permission denied

Do i have to configure a path variable somewhere or file permission?

Thanks

Nick

HI, 

I have the same problem as my debugger not working with corona simulator 

Exception occurred executing command line.

 

Cannot run program “/Applications/Development/CoronaSDK/Corona Simulator.app” (in directory “/Applications/Development/CoronaSDK/SampleCode/Graphics/Fishies”): error=13, Permission denied

 

Do i have to configure a path variable somewhere or file permission?

 

Thanks,

Kirti

Hello Kirti,

What OS/version are you running on? Same as Nick? Are you using an IDE like Eclipse? Which version of Corona?

Thanks,

Brent Sorrentino

Yes I am using Mac OS x 10.7.4, and using koneki to work on my corona project as lua, I have the same issue as Nick
I am using corona project manager 3.0.4 (5)

Thanks,
Kirti

HI, 

I have the same problem as my debugger not working with corona simulator 

Exception occurred executing command line.

 

Cannot run program “/Applications/Development/CoronaSDK/Corona Simulator.app” (in directory “/Applications/Development/CoronaSDK/SampleCode/Graphics/Fishies”): error=13, Permission denied

 

Do i have to configure a path variable somewhere or file permission?

 

Thanks,

Kirti

Hello Kirti,

What OS/version are you running on? Same as Nick? Are you using an IDE like Eclipse? Which version of Corona?

Thanks,

Brent Sorrentino

@maubry: I got the debugger to work in the way you suggested above, it now loads with a single click and I can immidiately debug my project. There is however, an issue/bug when I run it this way:

In the variables window, whenever I try to expand tables that have metadata I get the following error in the simulator’s console(not the eclipse console):

ERROR: loadstring() is not available b/c the parser is not load

DEBUGGER        ERROR   Command property_get caused: (206) nil

It won’t let me see any variables at all after this happens.

If I do things the “old” way everything works (setting eclipse debugger to listen, running Corona.Debugger.exe manually, loading the project manually, and typing run in the terminal).

***UPDATE: I have managed to solve this issue now by adding “-debug” to “Interperter arguments”. Corona does not support that function regularly for security reasons. It’s a shame tho, as having this available will also let us debug on device.

Thanks @sportyspice for the feedback.

I have edit my original post to include your solution.

Hi Kirti,

Sorry i didn’t post a solution, but I got this to work, if i remember correctly by finding the path in the package contents of the corona simulator.app to the corona command line executatble.

Right click in mac and show package contents for the corona simulator.app, your will find the below path

/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator

then

Go -> Menu

Run > 

Run Configurations -> Select your project - under runtime preferences, select manage interpreter

Preferences -> Add a new interpreter or Edit Interpreter

Under Interpreter exectutable use the following path you found,

/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator

Hope that provides you a solution, its not perfect but it seems to work. I dont know if you can add any command line switches.

cheers

Nick

Thanks for your great help,

Here,I am posting complete solution step by step so that others also can get help from it (Its working in my MAC 10.7.4)

Hi all,

I am an Eclipse Koneki developer, I just take a look this afternoon on Corona to test if our next release of Lua Development Tool (LDT) 1.0 work fine with Corona.

As you can see in the New & Noteworthy, we have enhanced the support of non-stardard lua interpreter.
So it now possible to add Corona Simulator as an interpreter, Adding corona as an interpreter allow to debugger faster corona project with less configuration, see folowing steps:

  1. Add a new interpreter for corona simulator like this way 

Go -> Menu

Run > 

Run Configurations -> Select your project - under runtime preferences, select manage interpreter

Preferences -> Add a new interpreter or Edit Interpreter

 

Under Interpreter exectutable use the following path you found,you can just copy below url and paste it into Interpreter exectutable

/Applications/CoronaSDK/Corona Simulator.app/Contents/MacOS/Corona Simulator

>Give anyname to your Interpreter  

  1. You should still add the following code at the begging of your project:(I have select Main.lua as beggining of my project from launcher script its also in Run>>run configuration>> above Manage Interpreter  , you can choose as per your requirment )

Just paste below code in the beggining of your starting script

if (system.getInfo(“environment”)==“simulator”) then
    require(“debugger”)()
end

 

If you will not do above code then you may get error while debugging like

 

“/Applications/CoronaSDK/Corona  Simulator.app/Contents/MacOS/Corona  Simulator"20-e"require(‘debugger’)()  3B”

Its very short and c;ear step you can follow this,

Hope works great
If some points are unclear feel free to ask.

Thanks,

Kirti

Yes I am using Mac OS x 10.7.4, and using koneki to work on my corona project as lua, I have the same issue as Nick
I am using corona project manager 3.0.4 (5)

Thanks,
Kirti

@maubry: I got the debugger to work in the way you suggested above, it now loads with a single click and I can immidiately debug my project. There is however, an issue/bug when I run it this way:

In the variables window, whenever I try to expand tables that have metadata I get the following error in the simulator’s console(not the eclipse console):

ERROR: loadstring() is not available b/c the parser is not load

DEBUGGER        ERROR   Command property_get caused: (206) nil

It won’t let me see any variables at all after this happens.

If I do things the “old” way everything works (setting eclipse debugger to listen, running Corona.Debugger.exe manually, loading the project manually, and typing run in the terminal).

***UPDATE: I have managed to solve this issue now by adding “-debug” to “Interperter arguments”. Corona does not support that function regularly for security reasons. It’s a shame tho, as having this available will also let us debug on device.