Search code examples
iosgcloudxctestfirebase-test-lab

gcloud crashed (AttributeError): 'NoneType' object has no attribute 'androidModelId' running XCTests on Firebase Test Lab


Following the instructions for Test with the gcloud CLI on iOS, after building my app for testing and saving all test data in a zip file, I execute the command

gcloud firebase test ios run \
    --test MyTests.zip \
    --device model=iphone7,version=12.1,locale=it_IT,orientation=portrait

But, after successfull upload of tests on Firebase, I get this error:

ERROR: gcloud crashed (AttributeError): 
'NoneType' object has no attribute 'androidModelId'

It seems that gcloud is saerching for the 'androidModelId' attribute (but since I'm running tests on iOS it can't find it...


Solution

  • Looks to be a bug when gcloud wants to report to you that the device dimensions are invalid. In your case iphone7:12.1 is not a supported device. iphone7:12.0 would be. Please run

    gcloud firebase test ios models list
    

    to see a list of supported devices and versions.

    This should work:

    gcloud firebase test ios run \
        --test MyTests.zip \
        --device model=iphone7,version=12.0,locale=it_IT,orientation=portrait