To create your first Appium test for an iOS device using Eclipse IDE on Windows, follow these steps:
Prerequisites
Even though you’re using Windows, testing iOS apps requires a macOS system to:
Install Xcode and iOS simulators
Run Appium server
Access iOS devices or simulators
So, either:
Use a real Mac, OR
Use a cloud device farm (example: BrowserStack, Sauce Labs)
You cannot run iOS tests from Windows directly without remote access to macOS.
| Tool | Purpose |
|---|---|
| Java JDK | Required for Java development |
| Eclipse IDE | Code editor |
| Appium Desktop | For inspecting elements & running Appium server |
| Node.js | Dependency for Appium |
| Appium Java Client | Java bindings for Appium |
| macOS with Xcode | To run iOS simulator/device |
| iOS .app or .ipa file | The app under test |
Sample App: Test App from Appium
You can use:
Appium’s sample: TestApp.app
GitHub: https://github.com/appium/sample-code
Project Setup in Eclipse
Create a Maven Project in Eclipse
Add the following dependencies to
pom.xml:
<dependencies> <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>8.3.0</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.10.0</version> </dependency> </dependencies>
Here's an example of testing a basic iOS calculator app or
TestApp.app:import io.appium.java_client.ios.IOSDriver; import io.appium.java_client.remote.IOSMobileCapabilityType; import io.appium.java_client.remote.MobileCapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import java.net.MalformedURLException; import java.net.URL; public class IOSAppTest { public static IOSDriver driver; public static void main(String[] args) { DesiredCapabilities caps = new DesiredCapabilities(); // Mandatory capabilities caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS"); caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "17.0"); // Change as per device caps.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 14"); // Simulator or real device caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest"); caps.setCapability(MobileCapabilityType.APP, "/Users/yourname/Downloads/TestApp.app"); // Path on mac // Optional caps.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000); try { driver = new IOSDriver(new URL("http://localhost:4723/wd/hub"), caps); // Add basic actions here System.out.println("App launched successfully!"); // Example action: Click a button (update with real locator) // driver.findElement(By.name("SomeButton")).click(); } catch (MalformedURLException e) { e.printStackTrace(); } finally { if (driver != null) { driver.quit(); } } } }
How to Run the Test
- Start Appium Server on Mac (
localhost:4723) - Ensure the simulator is running or real iOS device is connected
- Run the test from Eclipse on your Windows PC
Eclipse sends test to macOS Appium server
- Use SSH/Remote connection or CI tools (example: Jenkins + Mac agent) for triggering from Windows.
Next Steps
Replace
TestApp.appwith your real app.appor.ipaUse Appium Inspector to get element locators
Use JUnit or TestNG for structure and assertions