Installing the iOS libraries
Install the iOS libraries so that your customers can provide detailed information about bugs and crashes that happen with your app.
Before you begin
- If you are using MobileFirst Quality Assurance SDK version 3.2.0, or later, you must build your project using Xcode version 7.0, or later.
- If you are creating a Swift app, you must have OSX 10.9.4 or later and Xcode 6.0 (all releases) or later.
About this task
Procedure
- Create an app in Xcode Project. Important: If you are using Xcode 7.x on iOS 9 and the MobileFirst Quality Assurance iOS SDK version 2.4.1 or earlier, you must set the Enable Bitcode setting to No in the Xcode Build Settings.
- Start Xcode and load the app project into Xcode. Your project folder that is similar to the following example for a Swift app is
displayed:

- Download and extract the SDK.
- Download the most recent version of the MobileFirst Quality Assurance iOS client libraries. For more information about downloading these libraries, see iOS SDK for download.
- After you download the MobileFirst Quality Assurance iOS SDK, extract the contents of the compressed file to your file system. A file folder that is named Q4M.framework is created.
- In the Xcode Project Navigator, create a Frameworks group. To create a group, right-click the iOS app project and select New Group.
- Drag the MobileFirst Quality Assurance SDK for iOS
Q4M.framework folder into the Frameworks group in the
Navigator tree. In the Choose options window, select Create
groups, and check the box for your project name as the target. The Production framework is added to the project.

- Copy the Q4M.framework folder into the root folder of your app project.
- Add the required libraries to your Xcode project.
- In the Xcode Project Navigator, click your project and then click Build Phases.
- Click Link Binary With Libraries.
- Add Dependency Libraries. Under Link Binary With Libraries, click + and
add the following frameworks:
- AssetsLibrary.framework
- AudioToolbox.framework
- AVFoundation.framework
- CoreData.framework
- CoreLocation.framework
- CoreMedia.framework
- CoreMotion.framework
- CoreTelephony.framework
- CoreText.framework
- CoreVideo.framework
- MediaPlayer.framework
- QuartzCore.framework
- Security.framework
- SystemConfiguration.framework

- Set Linker Flags. Set the Other Linker flags for Debug and
Release to -ObjC:
- In the Xcode Project navigator, click your project and then click Build Settings.
- In the Search field, enter Other Linker Flags.
- Under Other Linker Flags, add a row for Debug and then enter -all_load -ObjC.
- Under Other Linker Flags, add a row for Release and then enter -all_load -ObjC.
Tip: If you cannot use the -ObjC flag or Xcode cannot find the MobileFirst Quality Assurance Library, you can load specific libraries by using the -force-load flag:-force_load $(PROJECT_DIR)/Libraries/Q4M.framework/Q4MIf your project uses a different directory structure, you must modify the path.
- Objective-C only: Add the following import statement to the AppDelegate.m and ViewController.m files: #import <Q4M/MQALogger.h>
- Swift only: Add an Objective-C bridging header for the MobileFirst Quality Assurance SDK for iOS. The MobileFirst Quality Assurance SDK for iOS is written in
Objective-C. Therefore, to reference the SDK from your Swift projects, you must add a bridging
header to your project. The bridging header imports Objective-C header files into your Swift
project.
- Right-click the project root node, and select New File.
- In the Choose Template window under iOS, click
Source, and then click the Header File template.

- Name the file MyProject-Bridging-Header.h, where
MyProject is the name of your Swift project, and check the
MQASampleAppiOSSwift target. For example, name the file
MQASampleAppiOSSwift-Bridging-Header.h.

- Click Create to save the file in the root of your project. The file is created.

- In the new bridging header file, add the following import statement for the
bridging header file: #import <Q4M/MQALogger.h>.

- In the Xcode Project Navigator, click Build Settings, and search for
Objective-C Bridging Header.

- Under Swift Compiler - Code Generation, set the value of
Objective-C Bridging Header to the path of the bridging header. The path is
relative to the root of your project. For example, if the project MQASampleApp is at
/user/example/MQASampleApp, then the path is
/user/example/MQASampleApp/MQASampleApp-Bridging-Header.h. If you saved your file in the root of the project, then you can use environment variable to
set the path by entering
${SRCROOT}/MyProject-Bridging-Header.h.


- Save and build the app to verify that the path is correct.
- Modify the headers by adding the MobileFirst Quality Assurance header to the
precompiled ProjectName_Prefix.pch header
file for your project. Note: In Xcode version 6.x, newly created Objective-C projects do not have a precompiler header file.
- From the Project
Navigator, click your project and then select Info to
verify the following settings in your project information:
- Bundle version
- MobileFirst Quality Assurance uses
the value from this field to determine when to send a new build notification
to testers. When you upload a new build to MobileFirst Quality Assurance, ensure that
you increment this number.Tip: If you are directly editing the Info.plist file, look for the CFBundleVersion field instead.
The string in the Bundle version field is restricted to numbers and the period (.) character. Because this restriction is an Xcode requirement, most applications follow this convention and do not require changes.
The following examples show valid bundle version strings:- 1.0
- 1.7.5
- 2
Bundle version strings cannot contain letters or other characters. The following examples show invalid versions:- 1.0a
- 2.beta
- Latest
- Bundle versions string
- This field contains a string representation of your version number.
The string does not have the same restrictions as the Bundle
version field.Tip: If you are directly editing the Info.plist file, look for the CFBundleShortVersionString field instead.
For more information about version tracking, see App version numbers.
- Add logging calls to your code by replacing any instance of the NSLog method
with one of the following MobileFirst Quality Assurance logging
methods:
- MQALog
- MQAExtendedLog
- Configure MobileFirst Quality Assurance to start a new session with every time you log on by continuing with Starting an iOS session.
Parent topic: Installing the iOS libraries