How to run several apps simultaneously in the system console?

For example, when I run px4_simple_app, it lasts for just a little while. What if I change the for loop to while(true) loop? Seems that I’m no longer able to run other apps now. In fact, I’m not allowed to type in the console now. Can anybody kindly tell me how to deal with this? Much appreciated!

Well, I’ve found out that I can use daemon app to replace my simple app. But according to dev.px4.io, I typed in the console:
daemon_task = px4_task_spawn_cmd(“commander”,
SCHED_DEFAULT,
SCHED_PRIORITY_DEFAULT + 40,
3600,
commander_thread_main(this funciton name is changed),
(char * const *)&argv[0]);
and NuttX replies that “daemon_task” is not a command… So… that’s yet another question. Any help will be appreciated!

OK, now I found out that the commands should be added in the code instead of typed in the console… But I just got confused… Cuz there is no tutorial telling me where to add these lines… Plus there should also be commands like “start”,“stop”,and"status" for these daemons, all of which seem to be missing from gitbook. And this really makes me down. Can anybody tell me where to find information like this please?

Have you seen this example? https://github.com/PX4/Firmware/blob/master/src/examples/px4_daemon_app/px4_daemon_app.c

It sounds like it does what you’re trying to do.

Yes exactly! Thank you very much!