The iOS and tvOS applications you develop using Swift and Objective-C must meet specific packaging and compilation requirements before you can submit them for scanning.
See Supported Languages and Platforms for instructions for other platforms.
You can analyze applications using Veracode Static Analysis or Veracode Software Composition Analysis (SCA) upload and scan, if licensed. For SCA agent-based scan requirements, see Using Veracode SCA with Programming Languages.
Veracode requires all binary executables and all required libraries for the application.
Supported iOS Platforms and Compilers
|Objective-C, C/C++, Swift 3.x, 4.x, 5.x compiled as bitcode||iOS||iOS 11–15
Note: Initial support for iOS 15, watchOS 8, and tvOS 15.
These instructions provide specific guidance on how to use Xcode to configure the scan settings that Veracode uses to scan your iOS application. These instructions also explain how to use the Apple Xcode utility to compile iOS applications for Veracode using the command line. Veracode also supports analyzing applications compiled with the PhoneGap, Titanium, Xamarin, and React Native cross-platform development frameworks.
Veracode analyzes all components submitted with an iOS application, such as standalone frameworks, extensions, and watchOS extensions. After a prescan, you can select these components as separate modules.
Veracode can scan only iPhone, iPad, or Watch applications compiled with debug symbols. Providing debug scans of iOS application code enables Veracode to provide source file and line number information about the location of flaws found.
Compilation Guidance for iOS
These settings are necessary for Veracode to analyze your application. They do not affect any project-specific settings that your application may require.
To test applications built for version Xcode 9.x or later:
- Launch Xcode, and select the Project and Signing Profile.
- In the Project Navigator, select the Project and its target to display the project editor.
- Go to Build Settings and select All instead of Basic.
- Go to DWARF with dSYM file. and set the values to
- Go to Yes. and set the value to
- Select Archive. , then, click
- For Build Configuration, select Debug.
- In the Xcode project editor, choose Generic iOS Device from the Scheme menu.
- Go to the Product menu option and select Archive.
- After the archiving process completes, the Xcode Organizer shows your archive highlighted.
- Right-click the project and choose Show in Finder.
Use xcodebuild with the parameters shown in this example command to compile your application from the command line:
xcodebuild archive -project MyApp.xcodeproj -scheme MyApp -destination generic/platform=iOS DEBUG_INFORMATION_FORMAT=dwarf-with-dsym ENABLE_BITCODE=YESIf you compile your application from the command line, you still must set the archive build configuration in the project scheme to Debug. To set the archive build configuration, go to and select Debug.
After you compile your application, you must package the archive according to the packaging guidance.
If you are using the Cocoapods dependency manager, you can add a snippet to the bottom of your podfile to automatically enable bitcode for your project dependencies.
- Add this snippet to your
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'YES' end end end
- Run this command in the terminal:
> cd <project_home_dir> && pod install
To submit your iOS application to the Veracode Platform, Veracode requires that you package your application by archiving the generated .xcarchive folder in ZIP format. You must manually create the package because Xcode does not bundle the debug information automatically in a portable format.
Veracode provides a mobile application packager for Xcode that can help package iOS applications built with Xcode 9.x or later. Veracode recommends you use this tool to prepare your application for analysis on the Veracode Platform. View the instructions on installing and using the Veracode Mobile Application Packager.
If you cannot package your application using the Veracode Mobile Application Packager, you can package your application manually using these instructions:
- Navigate to the Xcode archive that contains the compiled iOS application. The archive is usually located in ~/Library/Developer/Xcode/Archives.
- To create a ZIP archive, highlight the .xcarchive folder, right-click the folder, and select Compress.
- Optionally, rename the resulting archive file. Ensure that you preserve the ZIP extension. You upload this file to the Veracode Platform.
You can then upload your iOS application to the Veracode Platform for analysis. See the instructions for submitting an application for analysis.
If you use Veracode Software Composition Analysis, you must also upload the Podfile.lock file, which is present before compilation, to the Veracode Platform. To upload your archives for analysis:
- Add the Podfile.lock file to the root of another ZIP archive separate from the one that includes the .xcarchive folder.
- Upload both this new archive and the archive that includes the .xcarchive folder to the Veracode Platform.
Legacy Packaging Instructions
Veracode recommends using the simpler method of creating a ZIP package, but also supports the Veracode-specific BCA packaging format that was previously required for iOS analysis. These instructions are for reference only.
To create a BCA package:
- Navigate to the Xcode archive that contains the compiled iOS application. The archive is usually located in: ~/Library/Developer/Xcode/Archives
- In macOS, right-click the archive and select Show Package
Contents.Note: If you are working with this archive on a computer that does not have Xcode installed, navigate to the archives folder, and you have the ability to open the xcarchive file as a folder.
- Expand the Products folder and select the Applications folder.
- Move the Applications folder out of the Projects folder, and place it in the parent directory.
- Rename the Applications folder to Payload.
- Delete the Products folder so that the final directory is
structured similar to this example:
If using Veracode Software Composition Analysis, after compiling the application, create a ZIP archive that contains the output BCA file of the compiled Objective-C or Swift application and the Podfile.lock file, which is present before compilation.
Optionally, you can exclude the SwiftSupport or SCMBlueprint folders if they exist in the Projects folder.
- Create a ZIP archive containing the Payload folder. Highlight
all items in the directory, right-click, and select Compress.
When your compression completes, your directory should look similar to this example:
- Right-click the file Archive.zip and select Get Info.
- Under Name & Extension, rename the archive to <project
- When prompted, click Use .bca to change the extension.
- Move the new BCA file to a new location on your computer. You upload this BCA file to the Veracode Platform.
- You can now upload your iOS application to the Veracode Platform for analysis. For detailed instructions on submitting an application for analysis, see Requesting a Static Scan.