Examining Escriptized Binaries

Posted Over 10 years ago. Visible to the public.

The escript binaries output by mix escriptize are actually made up of 3 lines of ascii text (the escript shell script bit) followed by a big blob of zip data that contains your project’s beam files.
If you want to see what beam files have been bundled into your escript do the following:

Generate your escript:

$ mix escriptise
# Creates my_escript

Exact the zip data:

$ tail -n +4 my_escript > my_escript.zip

Now list the contents of the zip to see the included beam files:

$ unzip -l my_escript.zip
Archive:  my_escript.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
     3032  02-03-14 16:45   Elixir.Access.Atom.beam
     2392  02-03-14 16:45   Elixir.Access.HashDict.beam
     2780  02-03-14 16:45   Elixir.Access.List.beam
     6612  02-03-14 16:45   Elixir.Access.beam
     4672  02-03-14 16:45   Elixir.Application.Behaviour.beam
     4588  02-03-14 16:45   Elixir.ArgumentError.beam
     4624  02-03-14 16:45   Elixir.ArithmeticError.beam
…
      248  02-03-14 16:45   my_escript.app
 --------                   -------
  2406827                   179 files
Dan M
Posted by Dan M to elixir tips (2014-02-03 17:30)