Basic Configuration for Mobile GUI
SHAFT uses Appium under the hood for mobile automation. Configure the properties below to target a local Appium server or a cloud device farm.
- Set up your Appium server following the official Appium documentation.
- For cloud execution without managing your own devices, consider BrowserStack or LambdaTest.
Common Properties (Android & iOS)
# Address of your Appium server (default for local)
executionAddress=localhost:4723
# Target platform: ANDROID or IOS
targetOperatingSystem=ANDROID
# Automation driver — UiAutomator2 or Espresso for Android, XCUITest for iOS
mobile_automationName=UiAutomator2
Android Native App
# Install a fresh APK before each run (recommended)
mobile_app=src/test/resources/apps/MyApp.apk
# Device name as reported by `adb devices`
mobile_deviceName=Pixel_7_API_34
# Android version (optional but recommended)
mobile_platformVersion=14.0
Alternatively, launch an already-installed app by package/activity (not recommended for clean test runs):
mobile_appPackage=com.example.android.myApp
mobile_appActivity=.MainActivity
iOS Native App
targetOperatingSystem=IOS
mobile_automationName=XCUITest
# .app bundle for Simulator, .ipa for real device
mobile_app=src/test/resources/apps/MyApp.app
# Device name as shown in Xcode device list
mobile_deviceName=iPhone 15
mobile_platformVersion=17.0
# UDID required for real device
mobile_udid=00008110-001A23456789AB01
# Optional: launch an already-installed iOS app by bundle identifier
mobile_bundleId=com.example.ios.myApp
BrowserStack Native Apps
When executionAddress=browserstack, SHAFT can start native mobile sessions from either a BrowserStack app URL or a remote app value in mobile_app:
executionAddress=browserstack
targetOperatingSystem=ANDROID
mobile_automationName=UiAutomator2
mobile_deviceName=Google Pixel 7
mobile_platformVersion=13.0
# Preferred when you already know the uploaded BrowserStack app URL
browserStack.appUrl=bs://<uploaded-app-id>
# Also supported for remote app references when browserStack.appUrl is not set
# mobile_app=bs://<uploaded-app-id>
# mobile_app=https://example.com/apps/MyApp.apk
If both browserStack.appUrl and mobile_app point to remote app values, browserStack.appUrl takes precedence. Use local mobile_app paths when SHAFT should upload the app for you.
Mobile Web (Browser on Device)
For mobile browser testing, configure the same properties as Web GUI and add the mobile target:
executionAddress=localhost:4723
targetOperatingSystem=ANDROID
mobile_automationName=UiAutomator2
mobile_browserName=Chrome
mobile_deviceName=Pixel_7_API_34
baseURL=https://m.example.com
SHAFT MCP Mobile Automation
shaft-mcp can start mobile sessions through the same SHAFT Engine setup:
mobile_initialize_web_emulationruns a resized desktop browser in mobile compatibility mode.mobile_initialize_nativestarts an Appium-backed Android or iOS native session using the configured Appium server and device name, UDID, app, app package/activity, or iOS bundle ID.mobile_take_screenshotcaptures the current mobile screen, andmobile_get_accessibility_treereturns the active Appium page source/accessibility XML so the MCP client can understand the screen before acting.mobile_record_start,mobile_record_stop,mobile_replay_recording, andmobile_recording_code_blockssupport record/playback and copy-pasteable SHAFT action snippets.
You can learn more about the different property types and the full list of supported properties by visiting the related pages.