MobileFirst Quality Assurance for native iOS applications
improve this page | report issueOverview
Prerequisite: This tutorial is a continuation of the MobileFirst Quality Assurance tutorial. To follow it, you must first set up IBM Mobile Quality Assurance (MQA).
The tutorial explains how to install and configure the Mobile Quality Assurance client SDK for iOS, and how to enable apps to send back bug reports and feedback.
Jump to:
- Creating a simple iOS app
- Installing the iOS libraries
- Configuring how MQA communicates with your app
- Testing your app
- Further discovery
Creating a simple iOS app
If you do not have an app that you would like to use for this procedure, you can create a simple app by completing the following steps:
- Create a new project by using Xcode Project.
- Select a Single view application.
- Name your new application and select where you want to store your project files.
- Select your preferred programming language, and select iPhone or universal for the device type.
- Build and test your app by running it in the simulator.
Installing the iOS libraries
To run MQA with your iOS app, you must download and install the MQA iOS SDK, as follows:
- Prepare the iOS SDK.
Important: If you are using Xcode 7.x on iOS 9 and are using the Mobile Quality Assurance iOS SDK version 2.4.1 or earlier, you must set the Enable Bitcode setting to No in the Xcode Build Settings.- Create a
frameworks
folder. - Download the most recent version of the Mobile Quality Assurance SDK from Device SDKs for Mobile Quality Assurance for IBM Cloud.
For more information about downloading the SDKs, see Installing the iOS libraries in Objective-C or Installing the iOS libraries in a Swift app.Important: Ensure that you download the SDK that corresponds to your programming language.
- Extract the contents of the SDK, which includes the framework named
Q4M.framework
.
- Create a
- Add the iOS SDK to your project.
- Drag the
Q4M.framework
folder into the Frameworks group in the navigation tree. - In the Choose options window, select Create groups, and select your iOS app as the target.
- In the Xcode Project Navigator, click your project and select Build Phases.
- Click Link Binary With Libraries.
- Add the following frameworks by clicking the plus (+) symbol in the "Link Binary With Library" section:
CoreTelephony.framework
AssetsLibrary.framework
Security.framework
SystemConfiguration.framework
AudioToolbox.framework
CoreData.framework
CoreLocation.framework
CoreMedia.framework
CoreTelephony.framework
CoreText.framework
CoreVideo.framework
CorePlayer.framework
- QuartzCore.framework
- Security.framework
- SystemConfiguration.framework
CoreMotion.framework
- Set the linker flags for Debug and Release to
-ObjC
.- Click your project in the Project Navigator.
- Click Build Settings.
- Enter
Other Linker Flags
in the Search field. - In the Other Linker Flags section, expand the rows for Debug and Release.
- Enter the following line in both the Debug and Release rows:
-all_load -ObjC
- For Swift apps only: Add an Objective-C bridging header file.
- Right-click the project root node and select New file.
- In the Choose Template window with iOS section, click Source, and then click the template for a Header File.
- Name the file
project_name-Bridging-Header.h
, where project_name is the name of your Swift project file. - Select your project as the target.
- Click Save to save the file in the root of your project.
- Add the following line to the bridge header file that you created:
#import
- Click Build Settings in the Xcode Project Navigator, and search for Objective-C Bridging Header.
- In the Swift Compiler-Code Generation section, set the value of Objective-C Bridging Header to the path of your bridging header file:
$(SRCROOT)/$(PROJECT_NAME)/-Bridging-Header.h
- Save and build the app to verify that the path is correct.
- Drag the
Configuring how MQA communicates with your app
- Set the mode to either production or preproduction mode.
- Swift:
- In the
AppDelegate.swift
file, locate thedidFinishLaunchingWithOptions
method. - To use preproduction mode, add the following line to the
didFinishLaunchingWithOptions
method:MQALogger.settings().mode = MQAMode.QA
- To use production mode, add the following line to the
didFinishLaunchingWithOptions
method:MQALogger.settings().mode = MQAMode.Market
- In the
- Objective-C:
- Add the following import statement to the
AppDelegate.m
andViewController.m
files:#import
- In the
AppDelegate.m
file, locate thedidFinishLaunchingWithOptions
method. - To use preproduction mode, add the following line to the
didFinishLaunchingWithOptions
method:[[MQALogger settings] setMode:MQAModeQA];
- To use production mode, add the following line to the
didFinishLaunchingWithOptions
method:[[MQALogger settings] setMode:MQAModeMarket];
- Add the following import statement to the
- Swift:
- Launch a new MQA session each time your app starts.
- Open the
AppDelegate
file, if it is not already open. - Locate the
didFinishLaunchingWithOptions
method. - Add the following code to the
didFinishLaunchingWithOptions
method to start a new session:- Swift:
MQALogger.startNewSessionWithApplicationKey("your-application_key")
- Objective-C:
[MQALogger startNewSessionWithApplicationKey:@"your-application_key"];
The your_application_key argument is the application key that is provided by your MQA instance.
- Swift:
- Open the
Testing your app
After the environment is set up, you can load your app on your iOS device and start testing it. Complete the following steps to report a bug or provide feedback during testing:
- Shake your mobile device lightly.
- Select Report a bug or Give feedback.
- Enter the required information and select Send to send the information.
- View the bug reports and feedback in your IBM Cloud MQA instance where you retrieved the application key.
For more information about reporting bugs, see Reporting bugs on iOS devices. For more information about submitting feedback, see Enabling feedback on an iOS device.
Further discovery
After you are comfortable with the basics of setting up MQA with your app, you can read the content in IBM Knowledge Center to learn and explore some of the other things that you can do. For example:
- Managing users and testers. You can manage the roles and access of your team as they apply to your app and MQA instance.
- Distributing and managing builds. You can distribute test builds and production builds to the appropriate audience.
- Managing reports. You can automatically distribute test builds and production builds to your audience.
- User sentiment analytics. You can use MQA to analyze and monitor user comments and information about your app. You can also compare the analysis of those comments with the analysis of the user feedback from similar apps.
Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.