XCpretty generate an empty HTML report

I want to generate Xcode static analysis HTML report. I have installed xcpretty and generated the report by running the following commands:

  1. $ gem install

  2. xcpretty $ xcodebuild [flags] | xcpretty -r html

The problem is that it generates an empty html report, any help?