Need help with update of appium 1.6.0 for running tests for iOS (XCUITest)

When I try to run the Sanity Tests for iOS, I am required to open a terminal and get in the directory of appium-1.6.0 and run an instance of the appium driver (command: appium &) before I start running the tests. If I don’t do this process, I get an error (as mentioned below) and I am not able to run the tests. I have started facing this problem after I updated my version of Appium. I have also mentioned below, the environment I am currently using to run these tests.

Error:

Failed tests: setUp(com.automationtests.tests.iOS.iOSSanityTests): A new session could not be created. (Original error: Could not find a device to launch. You requested ‘iPhone (9.3 Simulator)’, but the available devices were: [“iPad 2 (9.3) [7094D1EC-8EC8-4627-87A5-58C4D969428C] (Simulator)”,“iPad Air (10.1) [16FD9D0C-3E82-4EBC-AD88-85AC9D72B396] (Simulator)”,“iPad Air (9.3) [E1B752CE-6E96-43DB-9A0E-45745D04E514] (Simulator)”,“iPad Air 2 (10.1) [F9FF0624-C090-477D-AFC0-760112AFA0E3] (Simulator)”,“iPad Air 2 (9.3) [D740F944-0003-4E6F-ABCB-CC07DDF85815] (Simulator)”,“iPad Pro (12.9 inch) (10.1) [C3601AB5-ABF2-492D-8BD9-E3E4606B4A41] (Simulator)”,“iPad Pro (9.3) [732D02D2-FDE4-44ED-B5D0-A18E0EA55CF5] (Simulator)”,“iPad Pro (9.7 inch) (10.1) [D65F7C56-CC4B-44BC-AB76-F1E1727C3AA4] (Simulator)”,“iPad Retina (10.1) [1C84972A-73E1-4475-B42A-4E852E3C2177] (Simulator)”,“iPad Retina (9.3) [2E4F8AEB-1A59-4E47-8888-E0A4687BB952] (Simulator)”,“iPhone 4s (9.3) [A24DB436-29C4-4C28-AC24-15964F3F979D] (Simulator)”,“iPhone 5 (10.1) [D604DF5F-3E78-45ED-A1AE-11DD81F30F03] (Simulator)”,“iPhone 5 (9.3) [84DB686E-D594-4181-9C41-6065B82B167A] (Simulator)”,“iPhone 5s (10.1) [18DA3A80-35F0-44B9-86B5-A8966B88B3FD] (Simulator)”,“iPhone 5s (9.3) [8BEB69C4-AB15-4A62-A764-602F48300AD6] (Simulator)”,“iPhone 6 (10.1) [B26D8D4D-31BB-4CFE-9386-22FDB411D3F4] (Simulator)”,“iPhone 6 (9.3) [3D630ECE-EBAB-4302-978D-5AED6286A687] (Simulator)”,“iPhone 6 Plus (10.1) [BEC15EBD-234D-4DBD-B3B1-92DA3C81FBCF] (Simulator)”,“iPhone 6 Plus (9.3) [DE1A4BB2-5A7B-4EDA-8708-BEB46D37C7F3] (Simulator)”,“iPhone 6s (10.1) [4599480D-25B1-496B-A998-2ED2A429124B] (Simulator)”,“iPhone 6s (9.3) [553066BC-95F8-4FAD-9B71-CD02EB1CBFEB] (Simulator)”,“iPhone 6s Plus (10.1) [BC92612F-6908-45C4-A5E0-3DDB5C887A53] (Simulator)”,“iPhone 6s Plus (9.3) [27898820-E0A8-4C37-9A9A-7C14FBF93675] (Simulator)”,“iPhone 7 (10.1) [8F8C8D0F-80FF-46D5-A4C4-2433BB13730D] (Simulator)”,“iPhone 7 (10.1) + Apple Watch Series 2 - 38mm (3.1) [35DB16DD-BD5F-49F0-B6F0-F44DE0FAA289] (Simulator)”,“iPhone 7 Plus (10.1) [DD6574B8-B55B-473B-84A8-4E0370759677] (Simulator)”,“iPhone 7 Plus (10.1) + Apple Watch Series 2 - 42mm (3.1) [B01F66B9-A7FF-45CF-BBD1-C627BBFD2244] (Simulator)”,“iPhone SE (10.1) [5B685545-A4B6-451E-8C3C-3977231FE7DF] (Simulator)”]) (WARNING: The server did not provide any stacktrace information)

Environment:
Appium version: 1.6.0
Xcode version: 8.1

For the record I can run the tests for android without any issues. Can anyone help me with my issue for running the iOS tests?

Thank you for your help in advance & have a great day ahead!

Regards,
Sidd

By the looks of it you didn’t pass the full device name.
The error says you requested ‘iPhone (9.3 Simulator)’. It can’t find it on the list of available devices since the iPhone model number is missing.

@idan Thank you for your reply. These are the parameters that I’m passing in the ‘.xml’ file:

<!--<parameter name="testType" value="NonGUI" />-->
<parameter name="platformName" value="iOS"/>
<parameter name="platformVersion" value="9.3"/>
<parameter name="deviceName" value="iPhone 6"/>
<parameter name="automationName" value="XCUITest"/>
<parameter name="app" value="/Users/sidd/Library/Developer/Xcode/DerivedData/xxxxxxxxxSDK-fspumibiqdpeowcifcncplnjlbeb/Build/Products/Debug-iphonesimulator/xxxxxxxxxxxSDK.app"/>
<parameter name="udid" value=""/>
<parameter name="bundleId" value=""/>
<classes>

You have 2 simulators with the exact same name. Can you try deleting the one you don’t want to run this test on & try again. You can always recreate the one you delete later with a more unique name.

@wreed
I tried removing the iPhone 6 (10.1) from my list of simulators, but unfortunately it didn’t help. It displayed me the same error without iPhone 6 (10.1) in the error message. The error message is as follows:

setUp(com.automationtests.tests.iOS.iOSSanityTestsCaptureReceipt): A new session could not be created. (Original error: Could not find a device to launch. You requested ‘iPhone (9.3 Simulator)’, but the available devices were: [“iPad 2 (9.3) [7094D1EC-8EC8-4627-87A5-58C4D969428C] (Simulator)”,“iPad Air (10.1) [16FD9D0C-3E82-4EBC-AD88-85AC9D72B396] (Simulator)”,“iPad Air (9.3) [E1B752CE-6E96-43DB-9A0E-45745D04E514] (Simulator)”,“iPad Air 2 (10.1) [F9FF0624-C090-477D-AFC0-760112AFA0E3] (Simulator)”,“iPad Air 2 (9.3) [D740F944-0003-4E6F-ABCB-CC07DDF85815] (Simulator)”,“iPad Pro (12.9 inch) (10.1) [C3601AB5-ABF2-492D-8BD9-E3E4606B4A41] (Simulator)”,“iPad Pro (9.3) [732D02D2-FDE4-44ED-B5D0-A18E0EA55CF5] (Simulator)”,“iPad Pro (9.7 inch) (10.1) [D65F7C56-CC4B-44BC-AB76-F1E1727C3AA4] (Simulator)”,“iPad Retina (10.1) [1C84972A-73E1-4475-B42A-4E852E3C2177] (Simulator)”,“iPad Retina (9.3) [2E4F8AEB-1A59-4E47-8888-E0A4687BB952] (Simulator)”,“iPhone 4s (9.3) [A24DB436-29C4-4C28-AC24-15964F3F979D] (Simulator)”,“iPhone 5 (10.1) [D604DF5F-3E78-45ED-A1AE-11DD81F30F03] (Simulator)”,“iPhone 5 (9.3) [84DB686E-D594-4181-9C41-6065B82B167A] (Simulator)”,“iPhone 5s (10.1) [18DA3A80-35F0-44B9-86B5-A8966B88B3FD] (Simulator)”,“iPhone 5s (9.3) [8BEB69C4-AB15-4A62-A764-602F48300AD6] (Simulator)”,“iPhone 6 (9.3) [3D630ECE-EBAB-4302-978D-5AED6286A687] (Simulator)”,“iPhone 6 Plus (10.1) [BEC15EBD-234D-4DBD-B3B1-92DA3C81FBCF] (Simulator)”,“iPhone 6 Plus (9.3) [DE1A4BB2-5A7B-4EDA-8708-BEB46D37C7F3] (Simulator)”,“iPhone 6s (10.1) [4599480D-25B1-496B-A998-2ED2A429124B] (Simulator)”,“iPhone 6s (9.3) [553066BC-95F8-4FAD-9B71-CD02EB1CBFEB] (Simulator)”,“iPhone 6s Plus (10.1) [BC92612F-6908-45C4-A5E0-3DDB5C887A53] (Simulator)”,“iPhone 6s Plus (9.3) [27898820-E0A8-4C37-9A9A-7C14FBF93675] (Simulator)”,“iPhone 7 (10.1) [8F8C8D0F-80FF-46D5-A4C4-2433BB13730D] (Simulator)”,“iPhone 7 (10.1) + Apple Watch Series 2 - 38mm (3.1) [35DB16DD-BD5F-49F0-B6F0-F44DE0FAA289] (Simulator)”,“iPhone 7 Plus (10.1) [DD6574B8-B55B-473B-84A8-4E0370759677] (Simulator)”,“iPhone 7 Plus (10.1) + Apple Watch Series 2 - 42mm (3.1) [B01F66B9-A7FF-45CF-BBD1-C627BBFD2244] (Simulator)”,“iPhone SE (10.1) [5B685545-A4B6-451E-8C3C-3977231FE7DF] (Simulator)”]) (WARNING: The server did not provide any stacktrace information)

I would welcome any other suggestions…!!

Thank you in advance & have a great day ahead.!

Regards,
Sidd

@idan
I have mentioned the parameters I’m passing in the ‘.xml’ file. If you feel that I’m doing something wrong. Please point it out to me, it would be very helpful.

Looking forward to your suggestions.

Thank you in advance & have a great day!

Regards,
Sidd

Hi Sidd,

Can you try creating a new 9.3 Simulator and giving it a name without a space in it? In looking at the capabilities (or parameters) that you’ve posted, I’ve noticed that the above one is the only one with a space. Call the Simulator something like “Sidd_iPhone_6” or something similar and then change your xml file and run the test again. I’m curious if that could be the problem.

@wreed I tried exactly as you suggested. Few of the parameters that I passed are ::

    <parameter name="platformVersion" value="9.3"/>
    <parameter name="deviceName" value="Sidd_iPhone_6"/>
    <parameter name="automationName" value="XCUITest"/>

The same error poped up, which is as follows:

Failed tests: setUp(com.automationtests.tests.iOS.iOSSanityTestsCaptureReceipt): A new session could not be created. (Original error: Could not find a device to launch. You requested ‘iPhone (9.3 Simulator)’, but the available devices were: [“iPad 2 (9.3) [7094D1EC-8EC8-4627-87A5-58C4D969428C] (Simulator)”,“iPad Air (10.1) [16FD9D0C-3E82-4EBC-AD88-85AC9D72B396] (Simulator)”,“iPad Air (9.3) [E1B752CE-6E96-43DB-9A0E-45745D04E514] (Simulator)”,“iPad Air 2 (10.1) [F9FF0624-C090-477D-AFC0-760112AFA0E3] (Simulator)”,“iPad Air 2 (9.3) [D740F944-0003-4E6F-ABCB-CC07DDF85815] (Simulator)”,“iPad Pro (12.9 inch) (10.1) [C3601AB5-ABF2-492D-8BD9-E3E4606B4A41] (Simulator)”,“iPad Pro (9.3) [732D02D2-FDE4-44ED-B5D0-A18E0EA55CF5] (Simulator)”,“iPad Pro (9.7 inch) (10.1) [D65F7C56-CC4B-44BC-AB76-F1E1727C3AA4] (Simulator)”,“iPad Retina (10.1) [1C84972A-73E1-4475-B42A-4E852E3C2177] (Simulator)”,“iPad Retina (9.3) [2E4F8AEB-1A59-4E47-8888-E0A4687BB952] (Simulator)”,“iPhone 4s (9.3) [A24DB436-29C4-4C28-AC24-15964F3F979D] (Simulator)”,“iPhone 5 (10.1) [D604DF5F-3E78-45ED-A1AE-11DD81F30F03] (Simulator)”,“iPhone 5 (9.3) [84DB686E-D594-4181-9C41-6065B82B167A] (Simulator)”,“iPhone 5s (10.1) [18DA3A80-35F0-44B9-86B5-A8966B88B3FD] (Simulator)”,“iPhone 5s (9.3) [8BEB69C4-AB15-4A62-A764-602F48300AD6] (Simulator)”,“iPhone 6 Plus (10.1) [BEC15EBD-234D-4DBD-B3B1-92DA3C81FBCF] (Simulator)”,“iPhone 6 Plus (9.3) [DE1A4BB2-5A7B-4EDA-8708-BEB46D37C7F3] (Simulator)”,“iPhone 6s (10.1) [4599480D-25B1-496B-A998-2ED2A429124B] (Simulator)”,“iPhone 6s (9.3) [553066BC-95F8-4FAD-9B71-CD02EB1CBFEB] (Simulator)”,“iPhone 6s Plus (10.1) [BC92612F-6908-45C4-A5E0-3DDB5C887A53] (Simulator)”,“iPhone 6s Plus (9.3) [27898820-E0A8-4C37-9A9A-7C14FBF93675] (Simulator)”,“iPhone 7 (10.1) [8F8C8D0F-80FF-46D5-A4C4-2433BB13730D] (Simulator)”,“iPhone 7 (10.1) + Apple Watch Series 2 - 38mm (3.1) [35DB16DD-BD5F-49F0-B6F0-F44DE0FAA289] (Simulator)”,“iPhone 7 Plus (10.1) [DD6574B8-B55B-473B-84A8-4E0370759677] (Simulator)”,“iPhone 7 Plus (10.1) + Apple Watch Series 2 - 42mm (3.1) [B01F66B9-A7FF-45CF-BBD1-C627BBFD2244] (Simulator)”,“iPhone SE (10.1) [5B685545-A4B6-451E-8C3C-3977231FE7DF] (Simulator)”]) (WARNING: The server did not provide any stacktrace information)

The important thing to note is that…Appium still thinks that I’m looking for ‘iPhone (9.3 Simulator)’ and there is no mention of the simulator that I created ‘Sidd_iPhone_6’.
Again, when I use the terminal to get into the directory of appium-1.6.0 and run an instance of the appium driver (command: appium &) and then try to run the tests; the tests start running.

Would welcome any other suggestions.

Thank you in advance & have a great day!

Regards,
Sidd

Oh, I absolutely agree. Could you post the full log? I’m not really sure what’s going on here but maybe a little more info could help.

Indeed weird. Can you attach the list of capabilities as listed on the server log?
Does the deviceName looks okay there?