Building and testing the Symantec Mobile Management Agent application for iOS Devices

Article:TECH181435  |  Created: 2012-02-14  |  Updated: 2014-04-11  |  Article URL http://www.symantec.com/docs/TECH181435
Article Type
Technical Solution

Product(s)


Issue



You want to know how to build and test an in-house build of the Symantec Mobile Management Agent application for iOS Devices.


Solution



The build and test process consists of the following five tasks.

  1. Loading the project into Xcode.
  2. Creating and installing a Development Provisioning Profile
  3. Customizing the localized string files
  4. Customizing the Target settings
  5. Building and distributing the application

Additional information and code examples

 

Loading the Project Into Xcode

  1. Retrieve the iOSAgentFramework.zip file from the Symantec Mobile Management Server at C:\Program Files\Altiris\MobileManagement\Agents\iOSAgentFramework (or the Platform install path if different).
  2. Copy the iOSAgentFramework.zip file to the Macintosh with Xcode on it.
  3. Unzip iOSAgentFramework.zip by double-clicking it.
  4. Open the project in Xcode by double-clicking the .xcodeproj file in the extracted folder.

Xcode requires Mac OS X 10.6 or later, and Xcode 4.2 or later.

Creating and Installing a Development Provisioning Profile

NOTE: This step is needed to first test the agent build before distributing it to all users.

Apple uses the Development Provisioning Profile to specify project members and the devices to be used for testing. To create and install a Development Provisioning Profile, log in and follow the instructions at https://developer.apple.com/ios/manage/provisioningprofiles/howto.action.

Customizing the Localized String Files

The string files contain the information that appears in the settings of the application on the device.

Warning: When you edit LocalizableStrings-en.plist or localize it to a new language, do not change the names of the keys on the left. Change only the string values on the right.

To customize the localized string files

  1. Open your project in Xcode.
  2. In the left pane, under Groups & Files, expand AgentFramework-template > Resources > plists, and click LocalizableStrings-en.plist.
  3. In the right pane, modify the content of AboutView, EnrollView, HomeView, Preferences, and StatusView.
    • In HomeView, change Agent Title to the name of your agent.
    • In AboutView, Name to match the name of your agent.
  4. (Optional) If you change the name of the Mobile Management Agent, you must change the name of the agent in the string files and also in the Target settings.
    1. Under Packaging, change Product Name to match the name of your agent.
    2. Change Mobile Management Agent name in the Target Settings.

Customizing the Target settings

The Target settings determine which devices receive the agent and the app ID that is used by the agent.

To customize the Target settings

  1. Open your project in Xcode.
  2. In the left pane, click Project. In the middle pane, under Targets, select the project.
  3. Click Summary.
  4. Change the App ID Identifier for the agent. For example, com.abccorp.inhouseagent
  5. Click Build Settings.
  6. Under Code Signing, for the Code_Sign_Identity, enter the Developer Identity Name into the two columns for each of the following:
    • Debug
    • Distribution
    • Release
    NOTE: The developer identity should be a developer profile with an installed certificate. The Developer identity will be of the form: iPhone Developer: xxxxx.
  7. (Optional) The default setting is to support iOS 4.1 and above. Under Deployment, change IphoneOS_Deployment_Target to modify this, e.g. to only support 5.0 and above.
  8. (Optional) Change the Targeted Device Family if you want to only support iPads or only iPhones. By default, the setting is to support both.
  9. (Optional) If you change the name of the Mobile Management Agent under Customizing the localized string files, change the name of the Agent in the Target settings. Under Packaging, change Product Name to match the name of your agent.
  10. Connect an iOS testing device to the Macintosh computer.
  11. Make sure that the device is selected in the Tool Bar (upper left).
  12. Select Product > Run. If the application installs and launches on your testing device, the application is complete and the project is correct. If you see errors check the following:
    • Make sure the App ID and the Developer Identity are spelled correctly.
    • Make sure the Developer identity has a private-key in the login key-chain.
    • Make sure that the Developer Identity is in Xcode > Windows > Organizer under Developer Profiles.

Note: The simulator lacks the functionality required to test a build. Applications built with the Mobile Management Agent template will not load in the simulator. Only test the Agent on a physical device.

Building and distributing the application

After the application installs and launches successfully, build the application for internal deployment. Use the following steps to build your application and set up the distribution URL.

STEP 1- Creating a Distribution Certificate

NOTE: If you already have a Distribution Certificate as a Team Agent, skip this step.

  1. Go to https://developer.apple.com/membercenter/index.action#iPhoneDev and log in to your iOS Developer Enterprise Program account as the Team Agent entity.
  2. Go to https://developer.apple.com/ios/manage/distribution/index.action and follow the instructions under Obtaining your iOS Distribution Certificate.

STEP 2- Creating a Distribution Provisioning Profile

NOTE: If you already have a Distribution Provisioning Profile for a previous version of this agent, skip this step.

  1. Go to https://developer.apple.com/membercenter/index.action#iPhoneDev and log in to your iOS Developer Enterprise Program account as the Team Agent entity.
  2. Go to https://developer.apple.com/ios/manage/distribution/index.action and follow the instructions under Create and Download a Distribution Provisioning Profile for Enterprise In-House Distribution.

STEP 3- Building your Application with Xcode for Distribution

  1. Open Xcode. Go to Windows > Organizer.
  2. Select Developer Profiles on the left.
  3. Make sure you see the distribution identity in the format: iPhone Distribution: ABC Corporation
  4. Make sure that the expected distribution provisioning profile is in the list of Provisioning Profiles. If it is not, you may need to either import the profile or manually drag it into XCode.
  5. Go to Build Settings.
  6. Under Code Signing, in the Code Sign_Identity section, for each of the subsections Debug, Distribution and Release, enter the Distribution Identity Name
    NOTE: The Distribution Identity should be one of the developer profiles that has an installed certificate. The Distribution Identity will be of the form: iPhone Distribution: xxxxx .
  7. On the ToolBar choose iOS Device or one of the connected devices and then select Product > Run. If the application fails to run, check the error logs. If it is a code-signing error, make sure that the App ID and the Distribution Identity are spelled correctly.

STEP 4.- Creating the App Store package

NOTE: Only create the App Store package after successfully testing the application.

Creating the App Store package

  1. Select Product > Archive.
    NOTE: The ‘Build Succeeded’ message is displayed.
  2. In the Archives window, on the right, select Share.
  3. Select IOS APP Store Package (.IPA).
  4. Click Next.
  5. Choose the location and a filename for the .IPA and click Save.

STEP 5- Creating a distribution URL

This step uses IIS Manager to host the agent app installation. Users download the in-house agent for installation from this folder.

To distribute the application:

  1. On the server where you want to host the agent download, go to C:\inetpub\wwwroot.
  2. Create a new folder for the agent or use a folder created previously for this purpose.
  3. Copy the following items into the folder:
    • The .ipa file created in STEP 4.
    • An html file to display the required agent info. (Sample shown below).
    • A 57x57 app icon image (a .PNG) file.
    • A .plist file with dictionary items for the .ipa location, the app Id (bundle-identifier), the 57x57 app-icon image, etc. (Sample shown below).
    • A web.config file with the web application information (Sample shown below).
  4. Provide the URL to the agent download HTML file to your users, for example, http://Yourserver/Agent/Agent.html

For information about creating agent applications, see Creating the in-house Mobile Management Agent application in the Symantec Mobile Management 7.1 Implementation Guide.

Additional information

Appendix A.1 Sample html file

Replace the bolded text with values that are pertinent for your situation. 
 
<html>
<body>
<h1>Your company MDM Agent Download</h1>
 
<a href="itms-services://?action=download-manifest&url=https://<Your path>/Agent/Yourplist.plist">
<img align=middle src="Your57x57.png" /></a>
<font size=+2>Install Agent</font>
</body>
</html>
 

Appendix A.2 Sample .plist file

Replace the bolded text with values that are pertinent for your situation.
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
            <key>items</key>
            <array>
                        <dict>
                                    <key>assets</key>
                                    <array>
                                                <dict>
                                                            <key>kind</key>
                                                            <string>software-package</string>
                                                            <key>url</key>
                                                            <string>http://PathtoYourIpa.ipa</string>
                                                </dict>
                                                <dict>
                                                            <key>kind</key>
                                                            <string>full-size-image</string>
                                                            <key>needs-shine</key>
                                                            <true/>
                                                            <key>url</key>
                                                            <string>http://Pathtoyourpng.png</string>
                                                </dict>
                                                <dict>
                                                            <key>kind</key>
                                                            <string>display-image</string>
                                                            <key>needs-shine</key>
                                                            <true/>
                                                            <key>url</key>
                                                            <string>http://Pathtoyourpng.png</string>
 
                                                </dict>
                                    </array>
                                    <key>metadata</key>
                                    <dict>
                                                <key>bundle-identifier</key>
                                                <string>your AppID</string>
                                                <key>bundle-version</key>
                                                <string>1.0</string>
                                                <key>kind</key>
                                                <string>software</string>
                                                <key>subtitle</key>
                                                <string>MDM management of iOS devices</string>
                                                <key>title</key>
                                                <string>Build description</string>
                                    </dict>
                        </dict>
            </array>
</dict>
</plist>
 

Appendix A.3 Sample web.config file

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".ipa" mimeType="application/octet-stream" />
                                    <mimeMap fileExtension=".plist" mimeType="text/xml" />
        </staticContent>
    </system.webServer>
</configuration>

 





Article URL http://www.symantec.com/docs/TECH181435


Terms of use for this information are found in Legal Notices