Access file on android & iOS device uploading data using --type EXTERNAL_DATA and then schedule-run

0

Wanted to know how i can access the file after uploading the extra data using below command --- create-upload --project-arn <> --name "extra-data.zip" --type EXTERNAL_DATA after that i used the URL return in response to upload the zip file. And then used the " schedule-run " command to schedule the run by passing following parameteres --testSpecArn ,--testPackageArn , --extraDataPackageArn on executing the command it returns status as "status": "SCHEDULING", Wanted to know how i can access the file which i uploaded as external-data On my app i have upload feature on clicking the button it open upload window and search for file, so how i can pass the path and which path i need to provide, please help

asked 24 days ago24 views
1 Answer
0

When you upload extra data to AWS Device Farm using the EXTERNAL_DATA type, the files become accessible during your test run. Here's how you can access these files on Android and iOS devices:

For Android: The extra data files are extracted to external storage on the device. You can access them using the environment variable EXTERNAL_STORAGE. The path to your files would typically be:

$EXTERNAL_STORAGE/extra_data/

For iOS: The extra data files are extracted to the app's sandbox. You can access them within your app's bundle. The path to your files would typically be within the app's Documents directory.

To access these files in your app's upload feature:

  1. For Android, you can use the EXTERNAL_STORAGE environment variable to construct the path to your extra data files.

  2. For iOS, you can use NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) to get the path to the Documents directory, then append the path to your extra data files.

When your test runs, Device Farm will automatically extract the contents of your extra-data.zip file to these locations. You don't need to manually specify the path in your schedule-run command beyond what you've already done with the --extraDataPackageArn parameter.

In your app's upload feature, you should implement logic to check for and access these directories based on the platform (Android or iOS). This way, your app can locate and use the extra data files during the test run.
Sources
ScheduleRunConfiguration - AWS Device Farm Documentation
Adding extra files to your test package in Device Farm - AWS Device Farm

profile picture
answered 24 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions