I am using AWS CLI for scheduling the project build. I have successfully executed Test Cases using the AWS CLI using Device Pool(All Android devices)
Now I want only one device in my device pool, So I have tried to get the Device ARN.
To get ARN for All Devices under Project using:
aws devicefarm list-devices --arn arn:aws:devicefarm:us-west-2:871290565691:project:8edf9575-3290-45f6-90d0-cb36edc0c2c0
I have tried below command in order to create Device pool for only one device(Google Pixel2 8.1):
aws devicefarm create-device-pool --project-arn arn:aws:devicefarm:us-west-2:871290565691:project:8edf9575-3290-45f6-90d0-cb36edc0c2c0 --name pixel2_81 --rules '[{"attribute": "INSTANCE_ARN", "operator": "IN", "value": "[arn:aws:devicefarm:us-west-2::device:4B2B87829E99484DBCD853D82A883BF5]"}]'
aws devicefarm create-device-pool --project-arn arn:aws:devicefarm:us-west-2:871290565691:project:8edf9575-3290-45f6-90d0-cb36edc0c2c0 --name pixel2_81 --rules '[{"attribute": "INSTANCE_ARN", "operator": "EQUALS", "value": "arn:aws:devicefarm:us-west-2::device:4B2B87829E99484DBCD853D82A883BF5"}]'
aws devicefarm create-device-pool --project-arn arn:aws:devicefarm:us-west-2:871290565691:project:8edf9575-3290-45f6-90d0-cb36edc0c2c0 --name pixel2_81 --rules '[{"attribute": "INSTANCE_ARN", "operator": "EQUALS", "value": "\"arn:aws:devicefarm:us-west-2::device:4B2B87829E99484DBCD853D82A883BF5\""}]'
aws devicefarm create-device-pool --project-arn arn:aws:devicefarm:us-west-2:871290565691:project:8edf9575-3290-45f6-90d0-cb36edc0c2c0 --name pixel2_81 --rules '[{"attribute": "ARN", "operator": "IN", "value": "[arn:aws:devicefarm:us-west-2::device:4B2B87829E99484DBCD853D82A883BF5]"}]'
aws devicefarm create-device-pool --project-arn arn:aws:devicefarm:us-west-2:871290565691:project:8edf9575-3290-45f6-90d0-cb36edc0c2c0 --name pixel2_81 --rules '[{"attribute": "ARN", "operator": "EQUALS", "value": "arn:aws:devicefarm:us-west-2::device:4B2B87829E99484DBCD853D82A883BF5"}]'
aws devicefarm create-device-pool --project-arn arn:aws:devicefarm:us-west-2:871290565691:project:8edf9575-3290-45f6-90d0-cb36edc0c2c0 --name pixel2_81 --rules '[{"attribute": "ARN", "operator": "EQUALS", "value": "\"arn:aws:devicefarm:us-west-2::device:4B2B87829E99484DBCD853D82A883BF5\""}]'
But all of them giving same error:
An error occurred (ArgumentException) when calling the CreateDevicePool operation: Invalid request, please check the arn and the device pool rule
I think I am missing small thing here.
Really appreciate the help on this or Please provide me an alternate way to create the Device Pool for Single Google Pixel2 8.1 device.
Thank you.
Here is an example that I had in my notes but it's not for the Google pixel. However, its arn can be found using the list devices API
Single device
aws devicefarm create-device-pool --project-arn arn:aws:devicefarm:us-west-2:111122223333:project:fb906e56-a39f-4976-9583-8c520bb534cb --name testOfCli --rules '[{"attribute": "ARN","operator":"IN","value":"[\"arn:aws:devicefarm:us-west-2::device:B494940EA8AA4DA4B4DC45CE4E47D760\"]"}]' --region us-west-2
Hth
-James