Perform Operations on your Application via API
To test your iOS (.ipa file) or Android (.apk or .aab file) application on TestMu AI, you can use our public REST APIs. In this documentation, we have listed all the operations you can perform with your application via APIs or cURL commands for both Virtual and Real Devices.
The maximum size for application should not exceed 1GB.
- If you do not have any .apk or .ipa file, you can run your sample tests on TestMu AI by using our sample 🔗 Android app or sample 🔗 iOS app.
Upload your Application
| PARAMETER | EXAMPLE | DESCRIPTION |
|---|---|---|
custom_id | -F "custom_id="Proverbial_1.0" | You do not have to remember the app_URL and only use the custom_id to run your automation on the same app. |
storage | -F "storage=file" DEFAULT: url | Used to change the way TestMu AI stores the link. Used when we Upload using App URL |
visibility | -F "visibility=team" DEFAULT: individual | Used to change the visibility of the application being uploaded. Once the app is uploaded using the team, everyone in the organisation can use the same URL to run the tests. |
Using App File
- Real Device
- Virtual Device
curl -u "undefined:undefined" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "appFile=@"/Users/macuser/Downloads/Appname.apk"" -F "name="appname""
curl -u "undefined:undefined" -X POST "https://manual-api.lambdatest.com/app/upload/virtualDevice" -F "appFile=@"/Users/macuser/Downloads/Appname.apk"" -F "name="appname""
Using App URL
- Real Device
- Virtual Device
curl -u "undefined:undefined" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "url=https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk" -F "name=Proverbial_App" -F "custom_id=sampleName" -F "storage=url" -F "visibility=individual"
curl -u "undefined:undefined" -X POST "https://manual-api.lambdatest.com/app/upload/virtualDevice" -F "url=https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk" -F "name=Proverbial_App" -F "custom_id=sampleName" -F "storage=url" -F "visibility=individual"
- Response of above cURL will be a JSON object containing the
App URLof the format -lt://APP123456789123456789
The upload time of your application can range from a few seconds to a minute, depending on the size of your application. Therefore, do not interrupt the cURL command request until you receive the response.
Run a test using the custom_id
If you set a custom_id when you upload an app, you can use it in your test in place of the lt://APP… URL. You do not need to copy the app URL from the upload response into your test.
Step 1: Upload the app with a custom_id.
curl -u "undefined:undefined" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "appFile=@/Users/macuser/Downloads/proverbial_android.apk" -F "custom_id=Proverbial_1.0"
Step 2: Read the app URL from the response. The upload response is a JSON object. The app URL is returned in the app_url field, in the format lt://APP123456789123456789.
Step 3: Use the custom_id in your test. Set the app capability to your custom_id instead of the app URL.
"lt:options": {
"platformName": "Android",
"deviceName": "Galaxy A33 5G",
"platformVersion": "13",
"app": "Proverbial_1.0",
"isRealMobile": true,
}
Use the app URL from Step 2 if you want to pin a test to one specific upload.
Fetch your Applications for Real Devices
Retrieve a list of the apps you have uploaded for real devices, by platform.
- Android
- iOS
curl --location --request GET "https://undefined:undefined@manual-api.lambdatest.com/app/data?type=android&level=user"
curl --location --request GET "https://undefined:undefined@manual-api.lambdatest.com/app/data?type=ios&level=user"
Shown below is the response to the above cURL request.
Verified{
"metaData": {
"type": "ios",
"total": 1
},
"data": [
{
"app_id": "APP100245789181570497850",
"name": "proverbial_ios.ipa",
"type": "ios",
"updated_at": "2022-05-10T11:19:30.000Z",
"shared": false,
"source": "web-client"
}
]
}
Fetch your Applications for Virtual Devices
- Android
- iOS
curl --location --request GET "https://undefined:undefined@manual-api.lambdatest.com/app/data?type=emulator&level=user"
curl --location --request GET "https://undefined:undefined@manual-api.lambdatest.com/app/data?type=simulator&level=user"
Deleting your Application
- Real Device
- Virtual Device
curl --location --request DELETE "https://undefined:undefined@manual-api.lambdatest.com/app/delete" --header 'Content-Type: application/json' --data-raw '{
"appIds" : "APPID1,APPID2"
}'
curl --location --request DELETE "https://undefined:undefined@manual-api.lambdatest.com/app/delete" --header 'Content-Type: application/json' --data-raw '{
"appIds" : "APPID1,APPID2"
}'
Shown below is the response to the above cURL request.
Verified{
"message": "Deleted successfully."
}
Processing check for your Application
- Real Device
- Virtual Device
curl --location --request POST 'https://mobile-api.lambdatest.com/mobile-automation/api/v1/fetchpatchedapkurl' --header 'Authorization: Basic <Basic>' --header 'Content-Type: application/json' --data-raw '{
"appId": "APP10160161171698993659206876",
"networkLogsEnabled": true,
"imageInjectionEnabled": true,
"screenshotUnblockEnabled": true
}'
curl --location --request POST 'https://mobile-api.lambdatest.com/mobile-automation/api/v1/fetchpatchedapkurl/virtualDevice' --header 'Authorization: Basic <Basic>' --header 'Content-Type: application/json' --data-raw '{
"appId": "APP10160161171698993659206876",
"networkLogsEnabled": true,
"imageInjectionEnabled": true,
"screenshotUnblockEnabled": true
}'
The payload allows you to check the processing status for specific features. If the patched_url is empty, the processing is still in progress. To check if the processing for image injection or screenshot unblock is complete, pass either imageInjectionEnabled or screenshotUnblockEnabled as true based on the feature you are testing.
{
"data": {
"imageinjection_ready": false, //current processing status
"patched_url": "",
"screenshotunblock_ready": false, //current processing status
"status": "success"
},
"status": "success"
}
