T-Plan Home
T-Plan Robot Enterprise 3.4.2
Doc Collection

02/09/13

iOS Mirror Automation

Last update: 5 June 2013

Contents:
1. Introduction
2. Robot Machine Configuration
3. iOS Device Configuration
4. Automation

APPENDIX:
A. T-Plan Server Re-signing Process


1. Introduction

T-Plan Robot Enterprise version 3.3 introduced a new hybrid connection called "iOS Mirror". It allows to test Apple iOS devices over a T-Plan Server or VNC connection where the device screen is displayed on the local desktop using the AirPlay Mirroring technology. This connection allows to test iOS applications which don't work over the classic VNC Server connection well, for example games relying on the OpenGL technology. It is recommended to use the T-Plan Server instead of VNC due to a number of advantages.

iOS Mirror connection w/
T-Plan Server
iOS Mirror connection w/
VNC server (Veency)
VNC Server connection w/n
VNC server (Veency)
Supported since
Robot v3.5
Robot v3.3
Robot v2.0
Jailbroken device required
NO
YES
YES
Support of apps with OpenGL content
YES
NO
NO
Pinch/Zoom support
YES
NO
NO
UTF-8 character support
YES
NO*
NO*
Display orientation support
YES
LIMITED**
NO
Connections per machine
1***
1***
NO LIMIT***
* The RFB (VNC) protocol is limited to ISO 8859-1 characters.
** Only the portrait & counterclockwise landscape modes are supported.
*** One machine running Robot can automate only one iOS device over the iOS Mirror connection at a time because it relies on an exclusive access to the local desktop. The standard VNC Server connection doesn't apply any limit to the number of connections and one Robot machine may automate any number of iOS devices at a time up to the limit given by the license key as long as there are sufficient system resources (CPU, RAM).
Device Requirements:
Robot Machine Requirements:

2. Robot Machine Configuration


MS Windows Set Up

Mac OS X Configuration

Accessibility Configuration


AirServer / Reflector Set Up

While the mirror app is disconnected right click its icon in the system tray (Windows) or go to the Device menu (Mac OS). Select Preferences/Settings. Set the options as follows:

Connect the Apple device to the mirror app: Post connection configuration:

Robot Set Up


3. iOS Device Configuration

Device Configuration

It is recommended to set off the Auto Lock feature to prevent the device from going to sleep after the specified idle time:

VNC Set Up

T-Plan Server Set Up

The T-Plan Server is being distributed as an "Ad Hoc" iOS application (.ipa) signed by the T-Plan certificate. To use the server within your organization you will have to re-sign it with your own company certificate and create a provisioning profile with the list of devices allowed to run the server. This is a one time process and the re-signed application and the profile may be then freely distributed to your testers.

The T-Plan Server application and the provisioning profile can be installed onto the device from a Mac OS X 10.7+ or a MS Windows machine. An alternative installation of the profile is to mail it to the device as an email attachment and tap it in the mail client.

Installation from Mac OS X

Drag the server and profile to iTunes
  1. Reselect the device under the DEVICES section in the left tree view.
  2. Switch to the Apps tab.
  3. Click the Install button next to the T-Plan Server application. The label will change to "Will Install".
  4. Select Apply to install and start the server on the device.
Installation thru
        iTunes

Installation From MS Windows
The server and the profile may be installed using iTunes for Windows. The process is same as the Mac OS one above. The only difference is that you have to drag the files to the Apps folder under the LIBRARY section of the left menu.

Another option is the iPhone Configuration Utility:
  1.  Select the device under the DEVICES section.
  2. Click Add on the tool bar. Select the "Mobile Provision (.mobileprovision)" item in the "Files of type" drop down at the bottom of the file selector. Then select the downloaded provisioning profile.
  3. Switch to the Provisioning Profiles tab.
  4. Click the Install button next to the profile.
Provisioning profile installation on Windows
  1. Click Add again. Select the "Mobile Application (.ipa)" item in the "Files of type" drop down. Then select the server .ipa file.
  2. Switch to the Applications tab.
  3. Click the Install button next to the server application.


3. Automation

Connection from Robot
Connection from Robot to iOS
TPR test scripts:     Connect apple://192.168.100.1:5909
Java test scripts:    connect("apple://192.168.100.1:5909");

Troubleshooting
Automation Tips
  1. Double press the Home button on the iOS device to open the list of running applications.
  2. Scroll to the right (swipe to the left) if needed to locate the T-Plan Server application.
  3. Long press the application icon until it starts shaking. Then press the "red minus" icon to kill it. Finally press Home to go back.
Kill T-Plan Server


APPENDIX A

T-Plan Server Re-signing Process

Requirements:
  1. Start Xcode and select Xcode->Preferences in the menu.
  2. Switch to the Downloads tab.
  3. Select Install next to the Command Line Tools package.
Xcode CLI Tools Installation

Re-signing Process


Step 1:
Register the test devices

        NOTE: This step is required only if the test iOS device(s) haven't been registered yet.

  1. Sign in to the Apple Developer Center using your Apple ID.
  2. Select the Devices link under the Member Center->Certificates, Identifiers & Profiles section of the Apple Developer Center.
  3. Register the device(s) that you plan to run the T-Plan Server on. You will need the device UDID (Unique Device Identification Number). One of the many ways to get it is to connect the device over the USB cable to the Mac and use iTunes:
    1. Start iTunes and select the device under the DEVICES section in the left tree view.
    2. Switch to the Summary tab.
    3. Click the Serial Number field. It will change to Identifier (UDID) and display the UDID.
    4. Right click the number and select Copy Identifier (UDID).
Finding the UDID in iTunes
  1. Alternative way to get the number is to install an iOS application providing the UDID, such as Emonster's UDID+.
  2. Once you have the UDID click the "+" button under the Devices section of the portal and complete the device registration.


Step 2:
Create the provisioning profile

  1. Switch to the Provisioning Profiles section.
  2. Click the "+" button to create a new profile:
    1. Select the "Ad Hoc" profile type.
    2. Select the iOS Wildcard Aple ID.
    3. Select the appropriate distribution certificate.
    4. Select the devices you wish to allow to run the server on. You must add at least one device.
    5. Provide the profile name, for example "T-Plan Server" and select Generate.
    6. Select Download to download the "T-Plan Server.mobileprovision" file to your local file system.


Step 3: Get the certificate

  1. Go to Member Center->Certificates, Identifiers & Profiles and select the Certificates link in the iOS Apps group.
  2. Download the iOS (iPhone) distribution certificate.
  3. Open the certificate from Downloads or Finder. This will import it into your key chain. Then look at the certificate under the My Certificates screen of the Keychain Access window and jot down the name. It should look like "iPhone Distribution: <name>".
Keychain Access


Step 4: Resign the application

NOTE: This step can be alternatively performed using other applications/scripts allowing to resign an .ipa file, such as iResign, AppResigner or the ota-tools. Another option is to call the codesign utility manually from the command line (see here). The script we provide is usually the fastest option.

  1. Create an empty folder and copy the provisioning profile into it.
  2. Download the T-Plan server ZIP file and extract it to the folder. The download link will be provided by the T-Plan support. The archive will contain the server application (.ipa) and the signing script (resign.sh).
  3. Open a terminal window (Applications->Utilities->Terminal) and switch to the folder.
  4. Execute the resign.sh script with the certificate name specified as its argument:
chmod a+x resign.sh; ./resign.sh "iPhone Distribution: Company XYZ"
The script will create a new resigned .ipa file with the "Resigned-" prefix.

TROUBLESHOOTING:

The script reports "no identity found"

The script reports "object file format unrecognized, invalid, or unsuitable"

xcode-select --print-path
To set the active Xcode installation execute:
xcode-select --switch <path>