External Publication
Visit Post

Stop Editing Config Files for Every Appium Run — Use Spring Profiles

DEV Community [Unofficial] June 17, 2026
Source

If your mobile test setup requires opening a properties file and hand-editing the platform, UDID, or app path before every run, that workflow falls apart the moment you move to CI. You can't edit a file inside a pipeline, and a wall of -D flags is its own maintenance burden.

The fix is to stop treating configuration as one flat file and start treating it as independent dimensions — platform, device, environment, test phase — each a named profile that activates on its own. Spring Boot composes them from SPRING_PROFILES_ACTIVE, so switching from Android to iOS becomes a profile name, not a diff.

This guide walks through that refactor on a real Appium + Spring Boot framework:

  • 🧩 Replace scattered @Value annotations with a typed @ConfigurationProperties config object
  • 🔌 Move DriverManager to constructor injection so values have a single source
  • 📂 Split application.properties into a base file plus platforms.yml and devices.yml
  • 🔐 Keep personal UDIDs and app paths in git-ignored local profile files
  • 🧭 Understand Spring's exact precedence order so overrides are predictable
  • 🔄 Map old Article 5 property keys to the new driver.* prefix

One detail worth knowing before you start: Spring's precedence runs base file → imported profiles → auto-discovered files → environment variables → command-line properties. The article keeps one deliberate exception — driver.udid — where a local file is allowed to override the placeholder, and it explains exactly why that exception earns its place.

This is Part 1, covering the platform and device dimensions. Part 2 adds environment, test phase, and cloud credentials.

👉 Read the full guide here: https://www.mobile-automation.io/mobile-test-configuration-management-part-1/

Discussion in the ATmosphere

Loading comments...