Table of Contents


This article demonstrates the steps required to run an API Example that completes the following:

  1. Logs in to Corellium.

  2. Retrieves the available projects on that account.

  3. Retrieves the available instances on the desired project.

  4. Creates a new instance of a virtual device.

  5. Uploads a custom kernel to that virtual device.

  6. Takes a snapshot of that virtual device.

Check out our Corellium API Documentation for a list of supported flavors and more.


Setting Up

There are two ways to get set up for this tutorial. You can either:

  1. Clone the entire Corellium-API GitHub Repository and run the example within your cloned repository.

  2. Or, you can clone the device_example folder and run the example on its own.

    ** will fix this link once the example is on github**

You will also need a device tree file to upload to your device. If you don't have one handy, install our example file, and put it in the corellium-api/examples/device_example subdirectory.

Now follow the steps below to get the API example running!


Tutorial

  1. Run the following command inside the device_example directory:

    npm install @corellium/corellium-api

  2. Now, in main.js replace the values assigned to the myEndPoint, myUserName, myPassword, and myProject variables with your own account credentials and project name.

  3. Optionally, you can replace the values in myDeviceName, myFlavor, and myOS. Currently, the example creates a ranchu (Generic Android) device named API Android with the 11.0.0 OS.

  4. Optionally, if you would like to upload a different image, edit myFirmware and myFirmwarePath.

  5. If you would like to upload a different type of image, such as a kernel choose a different upload function.

  6. Run the example by entering the following command into your command line: node main.js.

  7. Check your console to see the output.

    Note: if you haven't named your devices, the example will return "Found instance named null" as seen above.


Next Steps

Find out How to Download Copies of Stock Firmwares, to see the process of getting the ranchu-8.1.0-r60-userdebug file we used in this tutorial.

Check out our GitHub Actions article for a guide on how to automate this API Example on a GitHub Runner.

Did this answer your question?