# How to set up a Mobile Device Connection - HeadSpin

## Introduction
In this article, you will learn how to configure **HeadSpin** for mobile app testing using **Leapwork Studio**. If you're not using a physical device, HeadSpin provides an excellent alternative by allowing users to perform end-to-end testing and monitoring on real devices, located in hundreds of locations, and connected to real carrier and Wi-Fi networks. You'll learn the steps to set up a HeadSpin instance in **Leapwork Studio**, including creating an account, fetching the necessary credentials such as the **API Token**, and configuring the **HeadSpin connection**. You will also learn how to retrieve device details (like device name, platform version, and UDID) from the **Automation Configuration** page on the HeadSpin platform.

## Steps to Configure HeadSpin Instance
Create account on HeadSpin (internally we are using Leapwork subscription, in which we have two devices configured) Below is the HeadSpin Home page after login:

Below is the Remote-Control page of HeadSpin:

## HeadSpin Connection in Leapwork Studio:

- **Type**: Set type as HeadSpin Server.
- **Hostname**: Navigate to Remote control page of HeadSpin. For corresponding mobile device, open **‘More action**’ by clicking on the three dots icon.

Now select ‘ **Automation Configuration**’ as shown in the following image.

- **Hostname:** In the image below, under Device Configuration, the Hostname would be the partial Web Driver URL “ **[dev-us-pao-1.headspin.io](https://dev-us-pao-1.headspin.io/)**”
- **Port**: It's mentioned in Web Driver URL: “ **7019**”

## HeadSpin API Token:
Kindly follow the steps below to fetch HeadSpin API token:
1. Click on your name on top left side of the HeadSpin page.
   
   
2. Click on Settings.
  
   
3. Click on “+ New Token”

## HeadSpin Configuration in Leapwork Studio:

- **Cloud connection**: Connection created for HeadSpin.
- **OS type**: Platform type (iOS/Android)
- **Device name/Platform version/ UDID**: These details can be fetched from ‘Automation Configuration’ page of HeadSpin -> Device. (Platform version can be ignored if not mentioned on the page)

If you have any questions, please reach out to our [Priority Support](mailto:prioritysupport@leapwork.com)  team.
