> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noqa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Device Preparation

> Prepare iOS and Android devices for local testing

# iOS Real Devices

Tests can be run on physical iOS devices connected with a cable.

* iOS device with iOS 15 or later
* Cable (preferably original or certified)
* Mac with Xcode and Xcode Command Line Tools
* Apple Developer account (for provisioning and signing)
* Device must be trusted and visible in Finder

## Troubleshooting

If you encounter issues connecting or running tests on your device, try the following solutions:

### Change port

Sometimes switching device to a different port can resolve connection issues.

### Reboot Device and Mac

Restart both your iOS device and your Mac to clear any temporary connection or driver issues.

### Manually Sign WebDriverAgent

If you see signing errors with WebDriverAgent, you may need to open and sign the project manually:

Run this command in Terminal:

```
open "$HOME/Library/Application Support/noqa/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj"
```

In Xcode, go to the <b>Targets</b> list and select both <b>IntegrationApp</b> and <b>WebDriverAgentRunner</b>. For each target, open the <b>Signing & Capabilities</b> tab, set your <b>Team</b>, and ensure the provisioning profile is valid. Build the project once, then retry your test run.

# iOS Simulators

You can also run tests on iOS Simulators available in Xcode:

* Create and manage simulators using Xcode's Device Manager
* Start the desired simulator before running tests
* The noqa app will automatically detect running simulatorr

# Android Real Devices

Tests can be run on physical Android devices connected with a cable. USB debugging must be enabled. The device must be visible via `adb devices` command.

* Android device with Android 6.0 (API level 23) or later
* Cable
* USB debugging enabled on the device
* Device must be visible via `adb devices` command

## Troubleshooting

### Can't connect to device

If noqa shows **"Can't connect to device"**, it could not connect to the device through `adb`. This usually means the device is not fully set up for debugging.

First, check the device setup:

* USB debugging is enabled (Settings → Developer options)
* The device is unlocked and connected via cable
* You tapped **Allow** on the "Allow USB debugging?" prompt on the device

Then verify the connection from a terminal. List devices — yours should appear as `device` (not `unauthorized` or `offline`) — and install your build onto it. With several devices or emulators connected, target one explicitly with `-s <serial>` taken from the list (a plain `adb install` fails when more than one device is present):

```
adb devices
adb -s <serial> install -r /path/to/your-app.apk
```

If the install succeeds, reconnect the device in noqa and try again. If it fails, the device still needs to be set up for debugging — re-check the steps above, try a different cable or port, or revoke and re-grant USB debugging authorizations in Developer options.

# Android Emulators

You can also run tests on Android emulators created in Android Studio:

* Create an emulator using AVD Manager in Android Studio
* Start the emulator before running tests
* The noqa app will automatically detect running emulators
* Emulators must have Google Play Services installed for app installation
