How to add the platform version in appium for iOS

Hi,

I am trying to launch the app using simulator on appium and which ever devices I select it is showing the following error.

You requested ‘iPhone 6 (8.2)’, but the available devices were: [“iPad 2 (9.2) [476F2889-559A-44AF-AE34-88AA2AEDD0DD]”,“iPad Air (9.2) [48741345-840C-4AF1-AE8F-96557B1B3B0B]”,“iPad Air 2 (9.2) [32DD45BB-640A-46C1-B0D8-D6751012DEAF]”,“iPad Pro (9.2) [BD18923B-51A2-4D53-B8DB-E47B37F03C1F]”,“iPad Retina (9.2) [D4658A1D-DA96-4CED-9031-78BBF30B0C58]”,“iPhone 4s (9.2) [C22F7E14-BBFF-4EBD-819E-EF102C70F20C]”,“iPhone 5 (9.2) [6E11FD51-18E3-4269-8297-061AFA7A3A50]”,“iPhone 5s (9.2) [B20D7FD5-E251-411C-91C3-A070DBFAB87B]”,“iPhone 6 (9.2) [D98AAFC5-343C-447F-ABE8-82CCBCDD4C43]”,“iPhone 6 Plus (9.2) [B02FE693-6BA4-4421-B1D4-69C1E51C341A]”,“iPhone 6s (9.2) [69370BF6-9E10-4E36-91E4-B3CD4C7CCA49]”,“iPhone 6s (9.2) + Apple Watch - 38mm (2.1) [979A5FB1-A480-472F-8C77-CE47CA5BAB53]”,“iPhone 6s Plus (9.2) [6FC9904D-69E6-46B4-822D-830906F202B2]”,“iPhone 6s Plus (9.2) + Apple Watch - 42mm (2.1) [8C922572-6846-4E4B-A72F-8B74B87C1D68]”]

2F7E14-BBFF-4EBD-819E-EF102C70F20C]",“iPhone 5 (9.2) [6E11FD51-18E3-4269-8297-061AFA7A3A50]”,“iPhone 5s (9.2) [B20D7FD5-E251-411C-91C3-A070DBFAB87B]”,“iPhone 6 (9.2) [D98AAFC5-343C-447F-ABE8-82CCBCDD4C43]”,“iPhone 6 Plus (9.2) [B02FE693-6BA4-4421-B1D4-69C1E51C341A]”,“iPhone 6s (9.2) [69370BF6-9E10-4E36-91E4-B3CD4C7CCA49]”,“iPhone 6s (9.2) + Apple Watch - 38mm (2.1) [979A5FB1-A480-472F-8C77-CE47CA5BAB53]”,“iPhone 6s Plus (9.2) [6FC9904D-69E6-46B4-822D-830906F202B2]”,“iPhone 6s Plus (9.2) + Apple Watch - 42mm (2.1) [8C922572-6846-4E4B-A72F-8B74B87C1D68]”]"},“sessionId”:null}

So I could see all the version number above 9.2 in the above console. But in appium showing till iOS version 8.4. So how could I add the version so that I can run the simulator build. Please help

Click on the box and type in ‘9.2’.

Nope I am unable to add 9.2, If I add also it gets changed to 8.2 and getting the same error.

[debug] Responding to client with error: {“status”:33,“value”:{“message”:"A new session could not be created. (Original error: Could not find a device to launch.

You requested ‘iPhone 6 (8.2)’, but the available devices were: [“iPad 2 (9.2) [476F2889-559A-44AF-AE34-88AA2AEDD0DD]”,“iPad Air (9.2) [48741345-840C-4AF1-AE8F-96557B1B3B0B]”,“iPad Air 2 (9.2) [32DD45BB-640A-46C1-B0D8-D6751012DEAF]”,“iPad Pro (9.2) [BD18923B-51A2-4D53-B8DB-E47B37F03C1F]”,“iPad Retina (9.2) [D4658A1D-DA96-4CED-9031-78BBF30B0C58]”,“iPhone 4s (9.2) [C22F7E14-BBFF-4EBD-819E-EF102C70F20C]”,“iPhone 5 (9.2) [6E11FD51-18E3-4269-8297-061AFA7A3A50]”,“iPhone 5s (9.2) [B20D7FD5-E251-411C-91C3-A070DBFAB87B]”,“iPhone 6 (9.2) [D98AAFC5-343C-447F-ABE8-82CCBCDD4C43]”,“iPhone 6 Plus (9.2) [B02FE693-6BA4-4421-B1D4-69C1E51C341A]”,“iPhone 6s (9.2) [69370BF6-9E10-4E36-91E4-B3CD4C7CCA49]”,“iPhone 6s (9.2) + Apple Watch - 38mm (2.1) [979A5FB1-A480-472F-8C77-CE47CA5BAB53]”,“iPhone 6s Plus (9.2) [6FC9904D-69E6-46B4-822D-830906F202B2]”,“iPhone 6s Plus (9.2) + Apple Watch - 42mm (2.1) [8C922572-6846-4E4B-A72F-8B74B87C1D68]”])",“origValue”:“Could not find a device to launch. You requested ‘iPhone 6 (8.2)’, but the available devices were: [“iPad 2 (9.2) [476F2889-559A-44AF-AE34-88AA2AEDD0DD]”,“iPad Air (9.2) [48741345-840C-4AF1-AE8F-96557B1B3B0B]”,“iPad Air 2 (9.2) [32DD45BB-640A-46C1-B0D8-D6751012DEAF]”,“iPad Pro (9.2) [BD18923B-51A2-4D53-B8DB-E47B37F03C1F]”,“iPad Retina (9.2) [D4658A1D-DA96-4CED-9031-78BBF30B0C58]”,“iPhone 4s (9.2) [C22F7E14-BBFF-4EBD-819E-EF102C70F20C]”,“iPhone 5 (9.2) [6E11FD51-18E3-4269-8297-061AFA7A3A50]”,“iPhone 5s (9.2) [B20D7FD5-E251-411C-91C3-A070DBFAB87B]”,“iPhone 6 (9.2) [D98AAFC5-343C-447F-ABE8-82CCBCDD4C43]”,“iPhone 6 Plus (9.2) [B02FE693-6BA4-4421-B1D4-69C1E51C341A]”,“iPhone 6s (9.2) [69370BF6-9E10-4E36-91E4-B3CD4C7CCA49]”,“iPhone 6s (9.2) + Apple Watch - 38mm (2.1) [979A5FB1-A480-472F-8C77-CE47CA5BAB53]”,“iPhone 6s Plus (9.2) [6FC9904D-69E6-46B4-822D-830906F202B2]”,“iPhone 6s Plus (9.2) + Apple Watch - 42mm (2.1) [8C922572-6846-4E4B-A72F-8B74B87C1D68]”]”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 20593.628 ms - 2102

Tried again and was working now getting a new error that ‘Inspector crashed on launch’ as per the attached screenshot.

Screenshot link: http://screencast.com/t/djBeCQWlE

Can’t help you then. Everyone else just types it in.

Able to now set the version. But unable to launch the inspector … any idea on that please

@Rock Try Resetting Content and settings of the simulator manually and then relaunch using appium.

@hemche, How can I do that … I am new so I am not aware of it

Open Xcode --> Open Developer Tool --> Simulator

Once Simulator is opened, see if it is the device name you wanted, if not change it from the Hardware–> Device Menu .

After changing go to Simulator --> Click Reset Content and Settings

Tried, still the same… unable to launch inspector

shows this error

info: [debug] [INSTSERVER] Instruments exited with code null

info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #3
info: [debug] Killall iOS Simulator

i doubt you have installed ios8.2 simulators? Can you check manually and see the list of devices contain ios 8.2 ?

There is no 8.2 in the below list from your error log
`the available devices were: [“iPad 2 (9.2)
[476F2889-559A-44AF-AE34-88AA2AEDD0DD]”,“iPad Air (9.2)
[48741345-840C-4AF1-AE8F-96557B1B3B0B]”,“iPad Air 2 (9.2)
[32DD45BB-640A-46C1-B0D8-D6751012DEAF]”,“iPad Pro (9.2)
[BD18923B-51A2-4D53-B8DB-E47B37F03C1F]”,“iPad Retina (9.2)
[D4658A1D-DA96-4CED-9031-78BBF30B0C58]”,“iPhone 4s (9.2)
[C22F7E14-BBFF-4EBD-819E-EF102C70F20C]”,“iPhone 5 (9.2)
[6E11FD51-18E3-4269-8297-061AFA7A3A50]”,“iPhone 5s (9.2)
[B20D7FD5-E251-411C-91C3-A070DBFAB87B]”,“iPhone 6 (9.2)
[D98AAFC5-343C-447F-ABE8-82CCBCDD4C43]”,“iPhone 6 Plus (9.2)
[B02FE693-6BA4-4421-B1D4-69C1E51C341A]”,“iPhone 6s (9.2)
[69370BF6-9E10-4E36-91E4-B3CD4C7CCA49]”,"iPhone 6s (9.2) + Apple Watch

  • 38mm (2.1) [979A5FB1-A480-472F-8C77-CE47CA5BAB53]",“iPhone 6s Plus
    (9.2) [6FC9904D-69E6-46B4-822D-830906F202B2]”,“iPhone 6s Plus (9.2) +
    Apple Watch - 42mm (2.1)
    [8C922572-6846-4E4B-A72F-8B74B87C1D68]”])",“origValue”:"Could not find a
    device to launch. You requested ‘iPhone 6 (8.2)’, but the available
    devices were: [“iPad 2 (9.2)
    [476F2889-559A-44AF-AE34-88AA2AEDD0DD]”,“iPad Air (9.2)
    [48741345-840C-4AF1-AE8F-96557B1B3B0B]”,“iPad Air 2 (9.2)
    [32DD45BB-640A-46C1-B0D8-D6751012DEAF]”,“iPad Pro (9.2)
    [BD18923B-51A2-4D53-B8DB-E47B37F03C1F]”,“iPad Retina (9.2)
    [D4658A1D-DA96-4CED-9031-78BBF30B0C58]”,“iPhone 4s (9.2)
    [C22F7E14-BBFF-4EBD-819E-EF102C70F20C]”,“iPhone 5 (9.2)
    [6E11FD51-18E3-4269-8297-061AFA7A3A50]”,“iPhone 5s (9.2)
    [B20D7FD5-E251-411C-91C3-A070DBFAB87B]”,“iPhone 6 (9.2)
    [D98AAFC5-343C-447F-ABE8-82CCBCDD4C43]”,“iPhone 6 Plus (9.2)
    [B02FE693-6BA4-4421-B1D4-69C1E51C341A]”,“iPhone 6s (9.2)
    [69370BF6-9E10-4E36-91E4-B3CD4C7CCA49]”,"iPhone 6s (9.2) + Apple Watch
  • 38mm (2.1) [979A5FB1-A480-472F-8C77-CE47CA5BAB53]",“iPhone 6s Plus
    (9.2) [6FC9904D-69E6-46B4-822D-830906F202B2]”,“iPhone 6s Plus (9.2) +
    Apple Watch - 42mm (2.1) [8C922572-6846-4E4B-A72F-8B74B87C1D68]”]"}`

how can I check that?

Applications --> Xcode --> Preferences --> Components

In the Components window, check if iOS 8.2 simulator is installed. if not, click on the 8.2 line and install.

Ok … I have placed it for download it is something around 1+GB. So how can I run the simulator with the existing one for now.

Whatever simulator version is already there in the list(components window list), you can put it in the Appium dropdown and run.

How can I know that? where is components window list

It is the same window, where you have clicked for download. if you don’t see Blue tick mark for any of the lines in this Components window, it means you don’t have any simulators installed. if you see any blue ticks, you can use that simulator version.

oh thanks… I could not see any blue tick. Ok then fine I am downloading 8.2. Then after download I can include any device with iOS8.2 version and start appium right? then it will work or anyother settings required.

Once 8.2 is downloaded, you will see blue tick. Then you can select 8.2 in Appium dropdown. Then try launching the simulator. Paste the error log here if you are facing issues in launching.