iOS Code Analysis Command-Line Syntax

The command-line syntax to translate iOS code using Xcodebuild is:

sourceanalyzer -b <build_id> xcodebuild [<compiler_options>]

where <compiler_options> are the supported options that are passed to the Xcode compiler.

Note: Xcodebuild compiles the source code when you run this command.

To exclude files from the analysis, use the -exclude option (see Translation Options). All source files that match the exclude specification are not translated, even if they are included in the Xcode build. The following is an example:

sourceanalyzer -b MyProject -exclude "**/TestFile.swift" xcodebuild clean build

If your applicationClosed A customer codebase evaluated by Fortify software. The top-level container for one or more application versions. When you work with a new codebase, the application and first application version are automatically created. An application includes one or more application versions that users create and configure. uses any property list files (for example, <file>.plist), translate these files with a separate sourceanalyzer command. Use the same build IDClosed Name of an application being analyzed. that you used to translate the project files. The following is an example:

sourceanalyzer -b MyProject <path_to_plist_files>

If your project uses CocoaPods, include -workspace to build the project. For example:

sourceanalyzer -b DemoAppSwift xcodebuild clean build -workspace DemoAppSwift.xcworkspace -scheme DemoAppSwift -sdk iphonesimulator

You can then perform the analysis phase, as shown in the following example:

sourceanalyzer -b DemoAppSwift -scan -f MyResults.fpr