While I'm learning OTP I've been making a lot of changes to the .app and .erl files and re-running my application to see the effect of the changes.
I've tried the following sequence of commands to pick up all my new changes, but it doesn't seem to work:
Compile src files ...
erlc -o ebin src/*.erl
... followed by this is the erlang shell:
application:stop(my_app).
application:unload(my_app).
application:load(my_app).
application:start(my_app).
However, this doesn't seem to work. The only way I have found to work is to exit the erlang shell, recompile the app and then run application:start(my_app).
.
Is there an easier way of picking up my changes?
c(module)
is good enough. If your code is structured as an OTP application then runningmake:all()
is very convenient (you need an Emakefile, but a basic one is 1 or 2 lines erlang.org/doc/man/make.html). - zxq9