---
title: "dialyzer使用备忘"
author: "cryolite"
date: "2013-07-04T12:36:35Z"
tags: []
categories: ["开源软件"]
slug: "dialyzer"
draft: false
lastmod: "2013-07-05T15:30:35Z"
id: 1898632
url: "https://cryolite.iteye.com/blog/1898632"
---

一、构建PLT文件：
新构建
dialyzer --build_plt --apps $(APPS)

--apps参数对命令指定的应用构建PLT，缺省的PLT文件是~/.dialyzer_plt文件

如果要生成自己的plt文件，使用--output参数指定
dialyzer --build_plt --apps $(APPS) --output_plt my_abc.plt


一个例子：
dialyzer --build_plt --output_plt ～/.my_abc.plt --apps kernel stdlib sasl erts ssl tools os_mon runtime_tools c
rypto inets xmerl webtool snmp public_key mnesia eunit

添加内容
例如给已有的plt添加xmerl应用：
dialyzer --add_to_plt --apps xmerl




二、分析程序
既可以分析erl源代码，也可以对编译好的beam文件进行分析

例如对ebin下编译好的beam程序进行分析的例子：
dialyzer --plts *.plt ~/.dialyzer_plt -- ebin



参考：
http://learnyousomeerlang.com/dialyzer