Physical device testing is primarily an iOS concern. Android physical devices work similarly to emulators and don’t require special configuration beyond enabling USB debugging.
Why Physical Devices?
Physical device testing is important for:- Performance testing: Real-world performance characteristics
- Hardware features: Camera, GPS, sensors, volume buttons
- Network conditions: Actual cellular and Wi-Fi behavior
- Device-specific issues: Screen sizes, gestures, OS quirks
- Production-like environment: Final validation before release
Some features like volume buttons (
$.platform.mobile.pressVolumeUp()) only work on physical iOS devices, not simulators.Prerequisites
Before testing on physical iOS devices:Apple Developer Account
You need an active Apple Developer Program membership ($99/year) to:
- Create App IDs
- Generate provisioning profiles
- Install apps on physical devices
Physical iOS Device
- iPhone or iPad running iOS 13 or newer
- Lightning or USB-C cable for connection
- Device enrolled in your Apple Developer account
Existing Patrol Setup
Complete the standard iOS setup for simulators first.
Code Signing Setup
Physical device testing requires code signing for both your app (Runner) and the test target (RunnerUITests).
Overview
You need to create:- App ID for
RunnerUITeststarget - Development Certificate (if you don’t have one)
- Provisioning Profile for the test target
We assume your app (
Runner) is already properly signed for development or release.Step-by-Step Configuration
Create App ID for RunnerUITests
In the Apple Developer Portal:
- Go to Certificates, Identifiers & Profiles
- Select Identifiers
- Click + to create a new Identifier
- Select App IDs and click Continue
- Select App and click Continue
- Set the Bundle ID to your app’s bundle ID with
.RunnerUITests.xctrunnersuffix
- Your app bundle ID:
com.example.myapp - RunnerUITests bundle ID:
com.example.myapp.RunnerUITests.xctrunner
- Configure capabilities if needed (usually none required)
- Click Continue and then Register
Verify Development Certificate
In the Apple Developer Portal:
- Go to Certificates, Identifiers & Profiles
- Select Certificates
- Verify you have a valid Apple Development certificate
- Click + to create a new certificate
- Select Apple Development
- Follow the instructions to generate a Certificate Signing Request (CSR)
- Upload the CSR and download the certificate
- Double-click the certificate to install it in Keychain
Create Provisioning Profile
In the Apple Developer Portal:
- Go to Certificates, Identifiers & Profiles
- Select Profiles
- Click + to create a new profile
- Select iOS App Development
- Click Continue
- Select the RunnerUITests App ID you created earlier
- Click Continue
- Select your Development Certificate
- Click Continue
- Select the devices you want to test on
- Click Continue
- Name the profile (e.g., “MyApp RunnerUITests Development”)
- Click Generate
- Download the provisioning profile
Configure Xcode Signing (Automatic)
If using automatic signing (recommended):
- Open
ios/Runner.xcworkspacein Xcode - Select the
RunnerUITeststarget - Go to Signing & Capabilities
- Check Automatically manage signing
- Select your Team from the dropdown
- Xcode will automatically configure signing

Configure Xcode Signing (Manual with Fastlane)
If using Fastlane for code signing:
- In Xcode, select the
RunnerUITeststarget - Go to Signing & Capabilities
- Uncheck “Automatically manage signing”
- Select your provisioning profile manually

- Open
ios/Runner.xcodeproj/project.pbxprojin a text editor - Search for all occurrences of:
- For each occurrence, add the provisioning profile specifier:
- In Xcode, go to Product > Clean Build Folder
Import Provisioning Profile (Manual Signing Only)
If using manual signing with Fastlane:
- Double-click the downloaded
.mobileprovisionfile to import it into Xcode - Verify import in Xcode:
- Go to Xcode > Preferences > Accounts
- Select your Apple ID
- Click Manage Certificates…
- Click Download Manual Profiles
You might see errors in Xcode about mismatching bundle IDs. This is expected because the
.xctrunner bundle is generated during build time.Build Tests for Physical Device
From your project directory, build the tests:If the build succeeds, your setup is complete!
Physical device tests must be built in release mode due to iOS JIT restrictions.
Release Mode Testing
Physical iOS devices require tests to run in release mode:Android Physical Devices
Android physical devices are much simpler to set up:Enable Developer Options
On your Android device:
- Go to Settings > About phone
- Tap Build number 7 times
- Developer options are now enabled
Enable USB Debugging
- Go to Settings > Developer options
- Enable USB debugging
- Connect device via USB
- Authorize the computer on the device screen
Troubleshooting
Device Not Found
iOS:Code Signing Errors
If you see “Code signing is required” errors:- Verify your Apple Developer account is active
- Check that the provisioning profile is valid and not expired
- Ensure the device is registered in your developer account
- Try cleaning the build:
Bundle ID Mismatch
If Xcode shows bundle ID errors:These warnings are expected because the
.xctrunner bundle is generated at build time. As long as your App ID in the Developer Portal matches the pattern com.example.myapp.RunnerUITests.xctrunner, the build will succeed.Build Fails with “Requires a provisioning profile”
- Open Xcode and verify both
RunnerandRunnerUITeststargets are signed - Check that your provisioning profile includes the connected device
- Ensure the provisioning profile hasn’t expired
- Try selecting “Automatically manage signing” for easier setup
Tests Pass on Simulator but Fail on Device
Some differences between simulator and device:- Performance: Devices may be slower or faster
- Permissions: Some permissions behave differently
- Hardware: Camera, GPS, sensors work differently
- Network: Real network conditions vs. simulated
Best Practices
Device Management
✅ Do:- Keep multiple devices with different iOS versions
- Test on both iPhone and iPad
- Include older devices for performance testing
- Regularly update device iOS versions
- Rely solely on simulators for final validation
- Forget to test on minimum supported iOS version
- Ignore device-specific edge cases
Code Signing
✅ Do:- Use automatic signing when possible
- Keep provisioning profiles up to date
- Document signing setup for your team
- Use Fastlane for team consistency
- Commit provisioning profiles to version control
- Share signing certificates between team members
- Use wildcard provisioning profiles for production
CI/CD with Physical Devices
For CI/CD with physical devices, consider: These services provide access to real devices in the cloud.Next Steps
iOS Platform
Complete iOS testing guide
Android Platform
Complete Android testing guide
CI Integration
Run tests in CI/CD pipelines
Firebase Test Lab
Test on cloud devices