HeadSpin Documentation
Documentation

iOS and Android Device API

Deprecated App API Commands - iOS and Android

Overview

As we (and you!) transition into using the new App Management API as our primary app management methodology, we are deprecating our older App API program--however, we know that this information is still important for functionality in some environments as the transition to App Management API is completed. Therefore, deprecated sections of the App API that may have appeared in documentation referencing App API will be removed from their respective documents and relocated here for ease of access.

iOS

Install your app on a device

Route Method
/v0/idevice/{device_id}/installer/install POST

Request Body

The request's body should include the binary of your app's IPA file. To include the binary, use <code class="dcode">curl</code>'s optional flag <code class="dcode">--data-binary &lt;path-to-ipa></code>.

Optional Parameters

  • <code class="dcode">/v0/idevice/{device_id}/installer/install?ipa_id={id}</code>: use the previously uploaded ipa id
  • <code class="dcode">/v0/idevice/{device_id}/installer/install?sign=false</code>: disable automated signing

Automated Signing

Your IPA will be signed by us to ensure that it can install on the target device. If you would like to manage signing yourself, register the device UDID in your Apple Developer Account and add the device to a provisioning profile. An IPA provisioned for the target device will disable automated signing but you can explicitly disable it with the optional ?sign=false parameter. Automated signing does not support app capabilities.

.app iOS builds

Please see the App API to learn how to upload a .app iOS build. Once uploaded, the packaged .app iOS build may be installed with the ipa_id parameter documented above. You may refer to the previously uploaded ipa example in the Examples section.

Examples

Upload and install a local IPA file:


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/idevice/a5c7e0e83bce8884718982a3511ac3f03268edf1/installer/install --data-binary "@HealthTest.ipa"

Install a previously uploaded IPA file through the IPA API:


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/idevice/a5c7e0e83bce8884718982a3511ac3f03268edf1/installer/install?ipa_id=aed6dcd3-e668-44c1-857f-542a3d3f311f

Install IPA file without automated signing:


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/idevice/a5c7e0e83bce8884718982a3511ac3f03268edf1/installer/install?sign=false --data-binary "@HealthTest.ipa"

Optional Parameters

  • <code class="dcode">/v0/idevice/{device_id}/installer/install?ipa_id={id}</code>: use the previously uploaded ipa id

Uninstall your app from a device

Route Method
/v0/idevice/ POST

Example


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/idevice/a5c7e0e83bce8884718982a3511ac3f03268edf1/installer/uninstall?appid=io.headspin.healthtests

Install your dSYMs

Route Method
/v0/idevice/ POST

Package your dSYMs

When you archive your app in Xcode to export an IPA, Xcode will generate Debug Symbol files (dSYMs) for that build. You should be able to find your archive in Xcode's Organizer (right-click it and select Show in Finder, then right-click the .xcarchive itself to Show Package Contents.) Right-click the dSYMs directory and select Compress "dSYMs" or do so via the command line with <code class="dcode">zip -r dSYMs.zip dSYMs</code>. A debuggable IPA and matching debug symbols are required to generate a Function Call Timeline for a given app. If not using the Automated Signing feature, you must sign the app with an <code class="dcode">iOS App Development</code> profile.

Request Body

The request's body should be multipart/form-data that passes the binary of your app's IPA file and the associated dSYMs zip file. To perform a multipart request, use curl's optional flag -F ipa=@ -F dsyms=@. Alternatively, the ipa_id and dsyms_id of a previously uploaded pair of ipa and dSYMs may be provided via optional query parameters.

Optional Query Parameters

  • ipa_id={ipa_id}: use a previously uploaded IPA ID. This can be passed in lieu of the IPA file binary.
  • dsyms_id={dsyms_id}: use a previously uploaded dSYMs ID. This can be passed in lieu of the dSYMs zip.
  • sign=false: disable automated signing.

Example

Upload and install an IPA and dSYMs zip file pair:


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/idevice/a5c7e0e83bce8884718982a3511ac3f03268edf1/dsyms/install -F ipa="@HealthTest.ipa" -F dsyms=@"dSYMs.zip"

Install an IPA and dSYMs zip file pair previously uploaded using the app API:


curl -X POST "https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/idevice/a5c7e0e83bce8884718982a3511ac3f03268edf1/dsyms/install?ipa_id=aed6dcd3-e668-44c1-857f-542a3d3f311f&dsyms_id=a4190dfb-eae5-4d2c-91ad-0b1c8015d287"

Install an IPA and dSYMs zip file pair without automated signing:


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/idevice/a5c7e0e83bce8884718982a3511ac3f03268edf1/dsyms/install?sign=false -F ipa="@HealthTest.ipa" -F dsyms=@"dSYMs.zip"

Uninstall your dSYMs

Route Method
/v0/idevice/{device_id}/dsyms/uninstall?appid={app_id} POST

Example


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/idevice/a5c7e0e83bce8884718982a3511ac3f03268edf1/dsyms/uninstall?appid=io.headspin.healthtests

Android

Install and Uninstall an APK

Install

API

To install an APK on a device, you will include it in the POST body of the request as a binary file.


curl -X POST https://{your-api-token}@api-dev.headspin.io/v0/adb/{device-id}/install --data-binary "@/path/to/your/app.apk"

The path to your APK is the local path on your filesystem.

For example:


curl -X POST https://<your_api_token>@api-dev.headspin.io/v0/adb/{android-device-id}/install --data-binary "@/Users/hs/headspin.apk"

Install your app on a device

Route Method
/v0/adb/ POST

Request Body

The request's body should include the binary of your apk app. To include the binary of your app, use the <code class="dcode">--data-binary "@<path_to_your_apk>"</code>, for example <code class="dcode">--data-binary "@/Users/headspin/HealthTest.apk"</code>.

Optional Parameters

  • <code class="dcode">/v0/adb/{device_id}/install?apk_id=<id></code>: a previously uploaded app id that will be installed on the desired device. Do not pass the apk as a body to the request with --data-binary if this option is used.

Example

Install a local apk file:


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/adb/5435445559353498/install --data-binary "@HealthTest.apk"

Install an apk previously uploaded through the apk api:


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/adb/5435445559353498/install?apk_id=0dd0db2d-e314-49c9-b601-345618403dd1

Install an xapk previously uploaded through the xapk api:


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/adb/5435445559353498/install?xapk_id=7ad39a6a-8b7d-4a92-9cec-1b5ef3bc5e5f

Response

A JSON object:

<code class="dcode">{ "_headspin_progress": "..", "status": 0, "returncode": 0, "stdout": "Success\n", "summary": "ok"}</code> if the installation was successful.

Uninstall your app from a device

Uninstall

API

To uninstall an APK you will provide its App Package name in the request.


curl -X POST https://{your-api-token}@api-dev.headspin.io/v0/adb/{device-id}/uninstall?package={package-name}

For example:


curl -X POST https://<your_api_token>@api-dev.headspin.io/v0/adb/{android-device-id}/uninstall?package=io.headspin.example
Route Method
/v0/adb/ POST

Example


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/adb/5435445559353498/uninstall?package=io.headspin.healthtest

Response

A JSON object:

  • <code class="dcode">{ "_headspin_progress": ".", "status": 0, "returncode": 0, "stdout": "Success\n", "summary": "ok"}</code> if the uninstall is successful.
  • <code class="dcode">{ "_headspin_progress": ".", "status": 0, "returncode": 0, "stdout": , "summary": "ok"}</code> if the uninstall is not successful.

Uninstall an XAPK using its xapk_id

Route Method
/v0/adb/ POST

Example


curl -X POST https://be46f8f777864cb4aed7152c1a89998c@api-canary.headspin.io/v0/adb/5435445559353498/uninstall?xapk_id=7ad39a6a-8b7d-4a92-9cec-1b5ef3bc5e5f

Response

A JSON object:

  • <code class="dcode">{ "_headspin_progress": ".", "status": 0, "returncode": 0, "stdout": "Success\n\n", "summary": "ok"}</code> if uninstall is successful.
  • <code class="dcode">{ "_headspin_progress": ".", "status": 0, "returncode": 0, "stdout": , "summary": "failed to run"}</code> if uninstall is not successful.