Infer of facebook使用简介 Mac篇II

来源:互联网 发布:经纬度查询定位软件 编辑:程序博客网 时间:2024/05/29 18:21

前一篇Infer of facebook使用简介 Mac篇 有点问题, 在查找的过程中, 发现Infer的Install Help 已经做了更新。

重新安装一次看下是否还有问题。

1. 安装相关的依赖

1)install autoconf >= 2.63 and automake >= 1.11.1

brew install autoconf automake

2) install opam

brew install opam, 需要点时间。

opam init

eval $(opam config env) 

2) python 2.7 已有

3) Java (only needed for the Java analysis) 已有

4) clang in Xcode command line tools. You can install them with the command xcode-select --install (only needed for the C/Objective-C analysis)

5) Xcode >= 6.1 (only needed for the C/Objective-C analysis) 

通过app store安装了Xcode 7.2

2. 下载release infer from https://github.com/facebook/infer/releases/tag/v0.4.0 for mac

当前是v0.4.0

3. 编译安装infer

tar xf infer-*-v0.4.0.tar.xz 

cd infer-*-v0.4.0 make -C infer 

export PATH=`pwd`/infer/bin:$PATH

4. 用example下的Hello.java测试

infer -- javac Hello.java
Starting analysis (Infer version v0.4.0)
Analysis done
Hello.java:4: error: NULL_DEREFERENCE
  object s last assigned on line 3 could be null and is dereferenced at line 4
Analyzed 2 procedures in 1 file

终于可用了。。

0 0
原创粉丝点击