Genymotion HTTP API allows you to remotely control all Genymotion widgets and edit the Genymotion device Configuration.
- Access the instance from a web browser.
- Click API reference:
- From there, choose the HTTP API request you are interested in for details. You can also test an API request by using the Try it out button.
- The API reference page can also be accessed from the URL
- https://{your_instance_IP}/documentation/api
The HTTP API can be called using curl with the -u option for authentication:
curl -u {username}:{password} \
-X POST "https://{instance_IP}/api/v1/android/shell" \
-H "accept: text/plain" \
-H "Content-Type: application/json" \
-d "{\"commands\":[\"ls\"],\"timeout_in_seconds\":5}"
This will call the android/shell API endpoint and execute the command ls to the instance.
- {username} and {password} are the instance credentials.
- {instance_IP} is your instance IP.
Note If you are not using a SSL/TLS certificate, you will need to add the -k switch to your curl command:
curl -u {username}:{password} -k \
-X POST "https://{instance_IP}/api/v1/android/shell" \
-H "accept: text/plain" \
-H "Content-Type: application/json" \
-d "{\"commands\":[\"ls\"],\"timeout_in_seconds\":5}"
You can get the CURL command line (without authentication) when trying the API:
Back to top
This will call the android/shell API endpoint and execute the command ls to the instance.
The API reference page can also be accessed from the URL https://{your_instance_IP}/documentation/api.
This will call the android/shell API endpoint and execute the command ls to the instance.
Note If you are not using a SSL/TLS certificate, you will need to add the -k switch to your curl command.
You can get the CURL command line (without authentication) when trying the API:
You can try the API by using the Try it out button.
GET /android/id Get the current android id of the device.
[Image showing an Execute button in the API UI]
This will display the current Android ID via the API.
Responses
- Curl
curl -X GET "https://{instance_IP}/api/v1/android/id" -H "accept: application/json"
- You can also try the API to get responses directly in the UI.
Back to top