# `mix mob.push`
[🔗](https://github.com/genericjam/mob_dev/blob/master/lib/mix/tasks/mob.push.ex#L1)

Compiles the project and hot-pushes updated BEAM modules to all running
Android and iOS devices — no app restart.

The apps must already be running (start them with `mix mob.connect` or
`mix mob.deploy` first). Modules are loaded into the live BEAM in place,
equivalent to calling `nl(Module)` in IEx for each changed module. A device
another `agent-device` session has claimed is skipped (see
`MobDev.DeviceLeases`).

Only BEAMs are pushed, never native code: if a plugin with a NIF was
activated since the last `mix mob.deploy --native`, it warns that the
installed app was built without it (see `MobDev.Plugin.NifActivation`).

Options:
  --all      Push all modules, not just those changed since last compile
  --cookie   Use this cookie instead of the app's private one

Examples:
    mix mob.push
    mix mob.push --all
    mix mob.push --cookie my_cookie

## Under the hood

`mix mob.push` is a scripted version of the IEx hot-code-push workflow:

    mix compile

    # For each changed module, on each connected node:
    nl(MyApp.SomeScreen)
    # which calls:
    :rpc.call(node, :code, :load_binary, [MyApp.SomeScreen, path, beam_binary])

The `nl/1` built-in in IEx does the same thing for a single module. `mix mob.push`
does it for all changed modules across all connected nodes in one shot.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
