Skip to main content

Mobile testing using an iOS simulator

Learn how to perform mobile testing in Katalon Studio using an iOS simulator.

Mobile testing using an iOS simulator allows you to test your iOS apps in a virtual environment that mimics real Apple devices. The simulator, available through Xcode, lets you check how apps work on different iPhone and iPad models and operating system versions early in development without needing physical devices.

When performing mobile testing using an iOS simulator in Katalon Studio, follow these pre-testing steps:

  1. Install Xcode: Download and install Xcode from the Mac App Store to access iOS development and testing tools.

  2. Install Appium and Xcode command-line tools: You need Appium 2.x for automating mobile tests and the Xcode command-line tools for simulator management.

  3. Set up Xcode simulator for mobile testing: Configure the Xcode simulator to mimic specific iOS devices for testing your app.

  4. Prepare the iOS application file: Build or obtain the .app or .ipa file of your iOS application to load it into the simulator for testing.

Before you begin

Before you proceed with testing your mobile app using an iOS simulator, there are a certain considerations that you need to keep in mind or configure. To begin with, you need to setup a macOS environment. You can not execute iOS mobile testing in Windows and Linux.

We recommend going to the following developer documentation for more information on app build schemes and requirements: Running your app in Simulator or a device.

To get started with mobile testing using an iOS simulator, you need to install Xcode first.

Install Xcode

Learn how to install Xcode for your mobile testing using an iOS simulator.

Xcode is the integrated development environment used for building apps across all Apple platforms. Xcode includes iOS, iPadOS, and visionOS simulators (on Macs with Apple silicon), and is available for free on the Mac App Store.

  1. Go to the Mac App Store or click on the link to download Xcode: Xcode.
    Note:
  2. Launch Xcode. A dialog will show which Simulator runtimes are built-in and available for download. Select Continue to finish setting up Xcode.

  3. Once Xcode setup is complete, relaunch Safari to use Open Page With > [Your selected simulator] in the Develop menu and Open with Simulator in Responsive Design Mode.

Install Appium 2.x and Xcode command-line tools

Learn how to install Appium 2.x and XCode command-line tools for your mobile testing using an iOS simulator.

There are two ways to go about installing these pre-testing tools. You have the option to install them using the built-in tools function in Katalon Studio, or you can install each manually.

Install with built-in tools

From Katalon Studio version 8.3.0 onwards, you can install Appium and Xcode command-line tools (Xcode CLT) via Katalon built-in tools. To do so:
  1. Go to Tools > Set up iOS environment and select Install Dependencies.
    Install dependencies via Katalon built-in tools
  2. Katalon will automatically install the latest version of Xcode CLT, Appium, Homebrew, NodeJS, and other iOS dependencies.
    KS installs dependencies

Install manually

  1. Install the command-line tool for Xcode. You can download the command-line tool compatible with your Xcode version from the Apple Developer website here: Download.
    Alternatively, you can copy and paste the following command-line arguments in this order in the Terminal to install the command-line tool for Xcode:
    xcode-select --instal
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  2. Download and install Node.js from the Node.js website: Node.js Downloads.
    Make sure you install Node.js into a location where you have full Read/Write permissions.
  3. Install Appium with the following commands in the Terminal:
    • For Katalon Studio 9.1.0 onwards, install the latest Appium version:
      npm install -g appium
    • For Katalon Studio before 9.1.0, install Appium 1.12.1+:
      npm install -g appium@version
    Note:
    • If you are using emulators other than Xcode simulators, some emulators come with Appium installed. If you want to run an application on an emulator, check your emulator settings before installing Appium.

Set up Xcode simulators for mobile testing in Katalon Studio

After installing Xcode, Katalon automatically recognizes Xcode simulators as iOS devices.

To check whether Katalon Studio successfully recognizes Xcode simulators, on the main toolbar, select the iOS device in the dropdown list next to Run.

Katalon recognizes Xcode simulators

You should see a list of pre-installed Xcode simulators appearing as iOS devices.

Katalon recognizes Xcode simulators

Prepare the iOS application file

To execute mobile testing with Xcode simulators, prepare your .app or .ipa file.
  1. Open the .xcodeproj project file with Xcode. In the example below, we will open our sample Coffee Timer.xcodeproj project file.
    Open Xcode project
  2. After opening the project in Xcode, choose one of the iOS simulators to launch the apps.
    Choose simulators
  3. To build the .app file, click Product > Build.
    Wait for the build to finish, to find the app file, go to ~/Library/Developer/Xcode/DerivedData/{app name}/Build/Products/{scheme}-iphonesimulator/{app name}.app. In this example, we can find our sample Coffee Timer.app file at: ~/Library/Developer/Xcode/DerivedData/Coffee Timer/Build/Products/Debug-iphonesimulator/Coffee Timer.app.
    Tip:
    • To quickly search for the DerivedData folder, copy and paste the following path ~/Library/Developer/Xcode/DerivedData into the Spotlight.
Congratulations! You may now proceed to recording a mobile test using your iOS simulator. See the following cookbook topic for more information: Record a mobile test case.
Was this page helpful?