Cloning of iOS Test Apps

Victor Bezrodin
@RosberryApps
Published in
5 min readJan 22, 2020

Hello there again! In my previous article I talked about how you can get an IPA or APK file from Fabric and install it onto your device for later use in testing. This time I want to tell how one can make sure that multiple versions of the test application are installed onto the same device.

How can you use it?

For example, while updating an app you need to check how the application works if the data is sent to the server from the older app version and opened in the new one and vice versa. You may also need to reproduce a number of bugs on a specific device and check that the new version of the app has them fixed. Of course, for each and every test you can either install and then remove a build or install each version of the application on a separate device. However, in order to save time and reduce the number of test devices, you can go the other way and install several builds of the application simultaneously.

Android platform offers a wide range of programs allowing you to clone the installed apps, so they can easily be used to solve the problem mentioned.

iOS platform has nothing of the kind, so we have found another solution I want to tell you about.

The essence of this method is that the system uses an Application ID (Bundle Identifier) to determine uniqueness of the app.

Of course, if we have access to the source code, then perhaps the easiest way would be to generate the desired build with an Application ID that is different from that of the app installed.

But if there is no access to the source code or you have a ready-made ipa-file with the necessary build and do not want to generate it again, then the following method can come in handy:

So we will need:

  1. The IPA file of the application tested.
  2. Mac OS X 10.9 and higher.
  3. Xcode 7 and higher.
  4. iPhone or iPad of any model with iOS 6 and higher.
  5. Signing Certificate and Provisioning Profile
  6. iOS App Signer

App Modification

Launch iOS App Signer:

Let’s go through the main points that we need:

Input File: Click ‘Browse’ and specify the path to the IPA file that we want to clone.

Signing Certificate: Select Signing Certificate.

Provisioning Profile: Select Provisioning Profiles. If for some reason the application could not detect it, select it manually using the ‘Choose custom file ‘ option. All Provisioning Profiles are stored in the “~/Library/MobileDevice/Provisioning\ Profiles” directory.

If you don’t have a Signing Certificate and Provisioning Profile, ask your developer(s) to share it with you, or create a Free iOS Developer Account and use the resulting Signing Certificate and Provisioning Profile.

New Application ID: specify the new Build Identifier of the app in the ‘New Application ID’ field. I usually add the build number to an existing Build Identifier. Simple Provisioning Profiles do not allow you to change the Application ID. Therefore, in order to set a different Application ID, you will have to generate another build changing the Bundle Identifier in Xcode or use the Provisioning Profile which allows the use of Wildcard App ID.

For example, the Wild card Provisioning profile looks like this in comparison with the usual one:

App Display Name: in the ‘App Display Name’ field you should specify the name that will be displayed in the application menu. To easily find it thereafter I also add the build number, for example, “ Test App 302”:

I leave the AppVersion and App Short Version fields empty, because these changes are not important for our purposes.

Start: Click on the “Start “ button to start the process of re-signing the application. You will be asked to specify the name for the new signed IPA file and the path where it will be saved.

At the bottom of the application window we see messages that show the current stage of the application signing process. When the ‘Done’ notification appears, you can start installing.

App Installation

There are two ways to install the app:

  1. Using Xcode through opening Xcode>Windows>Devices and Simulators window (Shift+Cmd+2) and clicking the ‘ + ‘ button and selecting the previously created IPA file:

2. Using ideviceinstaller (I told you about it in the previous article).

I prefer this second method, since in case of failed installation, one can see an error displayed that allows to understand what has gone wrong, instead of seeing the standard Xcode notification ’Unable to install’.

Here is how, an error is displayed if you select Certificate from one account, and the Provisioning Profile from another:

Conclusions

As they say ‘Necessity is the mother of invention’ and the saying is very descriptive of the mobile app testing realm. The industry is pretty young, so there are not so many tools fitting into every need. So, QA engineers and testers have to come up with lots of their own ideas and methods which, of course, have certain strengths and weaknesses. The methods I’ve told you about also have their pluses and minuses.

Advantages:

  • Fewer devices involved in testing.
  • Saving time needed to reinstall from one version of the build to another, if you need to check a number of changes.
  • Ease of switching between two running applications (it is easier to physically interact with one device than with two at the same time).

Disadvantages:

Changing the Bundle Identifier may affect some services. So Push notifications, Purchases and others that need the original Bundle Identifier won’t work in a cloned application.

--

--