How to run an app on localhost

Hi evreybody,

I’m trying to install legato on my linux ubuntu, and i’d like to test demo’s apps (HelloWorld) on localhost before usie target, but i don’t find commands to run it .
i tried instapp myapp localhost, it doesn’t work. the same for startapp myapp localhost.
i have tried to start legato on localhost with startlegato, but i don’t find the commande to run the app.

Would you please give me some suggestion to solve this problem?

Thank you.

1 Like

Hi,

Here’s an example of how you can run the sample helloWorld app on localhost:

  1. Build legato for localhost

    make localhost
  2. Source legato environment

    bin/legs
  3. Run ‘startlegato’ script from bin directory.

    ./bin/startlegato
  4. Go to apps/sample/helloWorld and build helloWorld for localhost

    cd apps/sample/helloWorld make localhost

  5. When app is successfully built, go to _build_helloWorld/localhost/staging/bin and run binary.

    [code]
    cd _build_helloWorld/localhost/staging/bin
    ./helloWorld
    Apr 7 11:40:02 : -WRN- | serviceDirectory[30082]/framework T=main | mem.c le_mem_ForceAlloc() 679 | Memory pool ‘refFdMonitors’ overflowed. Expanded to 10 blocks.
    Apr 7 11:40:02 : INFO | helloWorld[30137]/helloWorld_exe T=main | helloWorld.c _helloWorld_exe_COMPONENT_INIT() 5 | Hello, world.

    [/code]

Also you can stop the localhost version of legato by running ‘bin/stoplegato’.

Enoch

It works ! :smiley:
Thank you ! :slight_smile:

I was looking for a solution to that too and I’m glad I found this topic. It worked for me in case of ‘hello world’.
However when I define timer inside it does not work.
I can compile HelloIpc - but it does not work too.

Do you have any suggestions to solve that?

Miroslaw

Thanks for sharing @esun. Do you folks generally use this for unit testing?

I join to the question.
How please to run more complex applications with services on the localhost mode?