Switching Between iOS Apps During a Test

May 18, 2026 · 8 min read · Mobile Testing

HeadSpin Platform
Automated & amp; manual testing create leisurely through data science perceptivity.
Differentiating capableness:
  • Encompassing end-to-end automation of QA process
  • Comparative analysis of app execution against peers
  • Continuous monitoring of app execution using synthetical data for higher handiness of apps
  • Easy-to-use developer friendly program
cloudtest go
Affordable Real Device Testing for Emerging Teams
cloudtest go
Affordable Existent Device Testing for Digital Enterprises
cloudtest go
The Ultimate Solution for a Powerful Blend of Functional & amp; Performance Testing!
cyol
TEM
New
Centralized mobile examination execution in cloud
cyol
Enhance Your Accessibility Testing With HeadSpin
cyol
Automate camera-based examination

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

retail

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

Switching Between iOS Apps During a TestSwitching Between iOS Apps During a Test

Switching Between iOS Apps During a Test

Published on
April 18, 2018
Updated on
Published on
June 5, 2022
Updated on
 by 
 Jonathan LippsJonathan Lipps
Jonathan Lipps

Smartphone users use on average 9 apps per day, and 30 apps per month, according toone recent report. If your app is lucky enough to be give such care, what are the chances that it lives alone, with no integration to the rest of the user & # x27; s smartphone experience? So many apps today provide value by integrating with early aspects of the mobile phone experience, even if it & # x27; s just as simple as taking pic using the device & # x27; s camera.

For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users.

Historically, testing these kinds of multi-app desegregation with iOS has be challenging, because Apple & # x27; s automation model allowed automation but so long as the AUT was go. The 2nd you switched to another app to automate another piece of your user stream, the automation would die. Thankfully, with Appium & # x27; s XCUITest driver (available with iOS 9.3+), we & # x27; re no longer limited to this form of sandbox.

There are so many kinds of multi-app flowing we could experiment with, but let & # x27; s envisage a scenario involving the camera. Let & # x27; s say your app countenance the user to direct photos, and modifies them in some way before finally preserve them to the system-wide photo library (the Camera Roll). One key verification for testing your app will be ensuring that, after performing the necessary steps inyourapp, the photo is newly available in the Camera Roll album of thePhotosapp. So, the test would look like this on a high degree:

  1. Launch the Photos app
  2. Navigate to Camera Roll album
  3. Determine how many photos are present, and stock that number
  4. Launch your app
  5. Add and save photo by automating your app & # x27; s UI
  6. Switch back to the Photos app
  7. Navigate to Camera Roll
  8. Determine how many photos are present now
  9. Verify that the number of photos nowadays before has increase by 1

This is all possible to encode into your Appium book using two handy commands:mobile: launchApp and mobile: activateApp. We & # x27; ve realiselaunchApp before, in theAppium Pro article on testing app upgrades. activateAppis just the same, only the app must already have been launch;activateAppmerely take it back to the foreground. Here are examples of how we & # x27; d use these dictation, by incorporating the Bundle IDs of the apps we & # x27; re dealing with (having these Bundle IDs available is a pre-requisite)

// establish the pic app (with the special bundle id seen below) HashMapargs = new HashMap < > (); args.put (`` bundleId '', `` com.apple.mobileslideshow ''); driver.executeScript (`` mobile: launchApp '', args); // re-activate that AUT (in this lawsuit The App) args.put (`` bundleId '', `` io.cloudgrey.the-app ''); driver.executeScript (`` mobile: activateApp '', args);

Simple, no? With Appium we can really affect we are a user and do all the things a exploiter would do in order to check the appropriate weather. I won & # x27; t go into detail in this edition about actually navigating the Photos app UI, nor make The App currently allow you to lead photos and preserve them to the library, so filling out these specific steps will be left as an exercise to the subscriber. And opportunity are, you have a different requirement than verifying photo rescue. So the thing to take away is the principle of usingmobile: launchApp and allyto negociate apps on the iOS device during a test.

What & # x27; s nice is that this particular strategy will act not alone for simulator but also for existent devices! So if you need to hold a exploiter login to your app via Facebook, or some other third-party credential say-so, you can do so.

As always, there & # x27; s afull exampleup on GitHub. In this case, though, we only insert some cleverThread.sleepsrather of doing all the daftness with regain the number of photos and so on. Check it out hither:

import io.appium.java_client.ios.IOSDriver; import java.net.URL; import java.util.HashMap; import org.junit.Test; import org.openqa.selenium.remote.DesiredCapabilities; public stratum Edition013_iOS_Multi_App {individual String APP = `` https: //github.com/cloudgrey-io/the-app/releases/download/v1.3.0/TheApp-v1.3.0.app.zip ''; individual String PHOTOS_BUNDLE_ID = `` com.apple.mobileslideshow ''; private String BUNDLE_ID = `` io.cloudgrey.the-app ''; @ Test public void testMultiApps () shed Exception {DesiredCapabilities capabilities = new DesiredCapabilities (); capabilities.setCapability (`` platformName '', `` iOS ''); capabilities.setCapability (`` platformVersion '', `` 11.3 ''); capabilities.setCapability (`` deviceName '', `` iPhone X ''); capabilities.setCapability (`` app '', APP); IOSDriver driver = new IOSDriver < > (new URL (`` http: //localhost:4723/wd/hub ''), capabilities); try {HashMapargs = new HashMap < > (); args.put (`` bundleId '', PHOTOS_BUNDLE_ID); driver.executeScript (`` mobile: launchApp '', args); // Here is where we would navigate the Photos UI to get the number of Camera Roll exposure Thread.sleep (1000); // Now reactivate our AUT args.put (`` bundleId '', BUNDLE_ID); driver.executeScript (`` mobile: activateApp '', args); // Here is where we would induce the new photo to be taken, edited, and saved Thread.sleep (1000); // Now reactivate the Photos app args.put (`` bundleId '', PHOTOS_BUNDLE_ID); driver.executeScript (`` mobile: activateApp '', args); // Here is where we would get the new number of Camera Roll photos, and aver that it // has increased by the appropriate number Thread.sleep (1000);} finally {driver.quit ();}}}
Author & # x27; s Profile

Jonathan Lipps

LinkedIn
Author & # x27; s Profile

Piali Mazumdar

Lead, Content Marketing, HeadSpin Inc.

Piali is a dynamic and results-driven Content Marketing Specialist with 8+ years of experience in crafting engaging narratives and marketing collateral across diverse industries. She excel in cooperate with cross-functional teams to evolve groundbreaking content strategy and deliver compelling, authentic, and impactful content that vibrate with target audiences and enhances make authenticity.

LinkedIn

Switching Between iOS Apps During a Test

4 Parts

regression intelligence blog
-

Regression Intelligence hardheaded guide for advanced exploiter (Part 3)

Coming Soon
Regression Intelligence practical guide for advanced users
-

Regression Intelligence pragmatic guide for advanced users (Part 4)

Coming Soon

Discover how HeadSpin can empower your business with superior testing capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productiveness with faster ontogeny cycles
automated buil-over-build regression testing
Automate build-over-build regression testing for ordered results
gain better visibility into functional & performance issues
Gain better visibleness into functional and execution issues
reduce mean time
Reduce mean time to identify/resolve during exam, QA, and production
evaluate audio, video & qoe
Evaluate audio, video, and content quality of experience (QoE) effortlessly
The trusted alternative for global enterprises
Adobe
Hargreaves Lansdown
Truecaller
Crazylabs
Nedbank
Numeracle
Veryon
Close

Discover how HeadSpin can empower your concern with superior testing potentiality

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productivity with quicker evolution cycles
automated buil-over-build regression testing
Automate build-over-build regression try for consistent results
gain better visibility into functional & performance issues
Gain best visibility into functional and performance number
reduce mean time
Reduce mean time to identify/resolve during exam, QA, and product
evaluate audio, video & qoe
Evaluate audio, picture, and content quality of experience (QoE) effortlessly
The trusted choice for global endeavour
Close

Discover how HeadSpin can empower your job with superior testing capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productiveness with quicker development cycles
automated buil-over-build regression testing
Automate build-over-build regression prove for consistent results
gain better visibility into functional & performance issues
Gain best visibility into functional and execution issues
reduce mean time
Reduce mean time to identify/resolve during test, QA, and product
evaluate audio, video & qoe
Evaluate audio, video, and content quality of experience (QoE) effortlessly
The trusted choice for global enterprises
Close

Connet Now

Wipro LogoVMLYR Logo
Close
Book a Meeting
Products
footer down arrow
Solutions
footer down arrow
Industries
footer down arrow
Features
footer down arrow
Support
footer down arrow
Resource Center
footer down arrow
Why Choose HeadSpin?
footer down arrow
Copyright © 2026 HeadSpin, Inc. All Rights Reserved.

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free