Could not find a device to launch. Cannot Launch iPhone 5 9.0 Simulator

Hi,
Could not find a device to launch error pops up when I try to open Safari on a iPhone 5 iOS 9.0 simulator using Appium.
I’m new to Selenium and Appium.
Please advise how to fix this issue?
Thanks.

Steps:

  1. Start Appium via GUI app
  2. Run following Java code in Eclipse:

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import io.appium.java_client.ios.IOSDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;

public class IOSSimulator{
WebDriver wd;

@SuppressWarnings("rawtypes")
@BeforeTest  
 public void beforeTest() throws MalformedURLException { //set capabilities required  
  DesiredCapabilities capabilities = new DesiredCapabilities();  
  capabilities.setCapability("deviceName", "iPhone 5");  
  capabilities.setCapability("platformName", "iOS"); 
  capabilities.setCapability("platformVersion", "9.0");  
  capabilities.setCapability(CapabilityType.BROWSER_NAME, "safari");  
  wd = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);//instantiate driver  
  wd.manage().timeouts().implicitlyWait( 30,TimeUnit.SECONDS);  
 }  
  
 @Test  
 public void testSearchPage() throws InterruptedException {  
  wd.get("https://www.google.com");  
  WebElement serachField = wd.findElement(By.name("q"));  
  serachField.sendKeys("Pooja Shah Selenium youtube");  
  serachField.sendKeys(Keys.ENTER);  
  System.out.println(wd.getCurrentUrl());  
 }  
  
 @AfterTest  
 public void afterTest() {  
  //wd.close();  
 }  
}  

Actual Results:
A new session could not be created. (Original error: Could not find a device to launch. You requested ‘iPhone (9.0 Simulator)’, but the available devices were: [iPhone 5 (9.0) [B3317769-0F50-4649-892B-BE0F44163F93].
Simulator does not open.

Are you using Appium 1.4.11 ?

Looks like he isn’t…

I use Appium 1.4.8 and have the same problem

iOS 9 is supported only on Appium 1.4.11 and above (1.5 beta). Refer the following link to reconfig your appium client to 1.4.11 to fix the above issue.

Upgrade Appium Client to latest appium version

1 Like

Thanks for responding.
I’m using 1.4.8 in Appium App Gui and 1.4.10 Appium if installed via the terminal.

How do I uninstall the 1.4.10 Appium version via the terminal?
I’m new to the Mac terminal. Can you provide details steps?

How do I install 1.4.11? I don’t think they have a 1.4.11 app GUI version yet.

I see Sruthi’s steps below, but I don’t understand how to get Appium client in step 3.
I don’t understand how to do step 5 and 6.
Can someone provide more step by step details.
I’m very new at this.
Thank you so much.

Here are the steps to re-config your Appium (Mac app/Windows EXE) client point to latest Appium version 1.4.11.

  1. Clone this Appium git to your local git clone https://github.com/appium/appium.git
  2. Once the download is complete, Run reset.sh
  3. Open Appium Client
  4. Select “Developer settings” and enable it.
  5. Select Use External NodeJS Binary to “Your local node bin folder path”
  6. Select Use External Appium Package to “Your Appium Local clone folder path”
  7. Start the Appium Server.

You should see the latest version of Appium on the client like below

info: Welcome to Appium v1.4.11 (REV 460994a14dfb20b2d55ff14b99c0d31f6af5a9e2)
info: Appium REST http interface listener started on 0.0.0.0:4723

The above steps are use your current app GUI to use 1.4.11 via enabling it on Developer settings

Refer the screenshot for settings.

1 Like

How do I clone Appium git? I assume through a command via the Mac terminal?
When I install 1.4.11 via the terminal, how do I get access to the app GUI?
Where do I retrieve it to copy to my applications folder?
I’m using the 1.4.8 app GUI currently where I installed via the dmg from the appium.io site.
I also installed 1.4.10 version that via the terminal, but this version I don’t know how to access its GUI app.
Where is my local node bin folder?
Where is my appium local clone folder?
Sorry for all the stupid basic questions. I’m really new at this. Thanks.

Hope you are able to follow the steps.

Thanks Sruthi. I will upgrade to new version.

While doing ./reset.sh, I encountered the following errors. How can I overcome this error?

Issue 1

WARNING: you do not appear to have iOS7/8 SDK active
A warning but no error. Do I have to make IOS7/8 SDK active? I thought we were using IOS9 now?

Issue 2

RESETTING ANDROID

  • Configuring Android bootstrap
    Running “configAndroidBootstrap” task
    Error: Target id is not valid. Use ‘android list targets’ to get the target ids.
    Warning: Setup cmd /Users/mac/Documents/android-sdk-macosx/tools/android failed with code 1 Use --force to continue.
    Aborted due to warnings.
    ---- FAILURE: reset.sh exited with status 1 ----

The path /Users/mac/Documents/android-sdk-macosx/tools/android has no android folder but an android executable.
I typed android list targets and it lists the following two targets:
Available Android targets:

id: 1 or “android-23”
Name: Android 6.0
Type: Platform
API level: 23
Revision: 1
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, default/armeabi-v7a, default/x86, default/x86_64

id: 2 or “Google Inc.:Google APIs:23”
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 6.0 (API level 23)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : google_apis/armeabi-v7a, google_apis/x86, google_apis/x86_64

If you want to use only for ios9 you can add the --ios parameter to reset.sh command.
And you can ignore the ios7/8 SDk warning.

Give ./reset.sh --ios

Thanks hemche.
Do you or anyone might know how I can fix the android targets error?
Has anyone seen this issue before? How did you guys resolved it?
Thanks for your help.

I figured out how to install version 1.4.11.

Instructions to uninstall old appium version and install new appium version

  1. Uninstall old version first by npm uninstall -g appium
  2. Install by npm install –g [email protected]
  3. Run appium –v when done to check correct version is installed
  4. Run appium-doctor to make sure everything is good
  5. Open Appium GUI App
  6. Select “Developer settings” and enable it.
  7. Select Use External NodeJS Binary to /usr/local/bin/node
  8. Select Use External Appium Package to /usr/local/lib/node_modules/appium
  9. Start the Appium Server.

Had to uninstall from previous method because the SafariLauncher.zip wasn’t there with the above method. So I used the below steps and got 1.4.11 installed. The key is what hemche said to use --ios and I added --real-safari

  1. Run npm view appium versions to see what is the latest version
  2. Uninstall old version first by npm uninstall -g appium
  3. Type git clone https://github.com/appium/appium.git
  4. Go to appium folder cd appium
  5. Type ./reset.sh --ios --real-safari –verbose
  6. Open Appium GUI App
  7. Select “Developer settings” and enable it.
  8. Select Use External NodeJS Binary to /usr/local/bin/node
  9. Select Use External Appium Package to /Users/mac/appium
  10. Start the Appium Server.

Hi Pooja,

I new to Appium. I am facing a problem to send values to a mobile safari browser on real iOS device (iPod Touch). Could you please help me in troubleshooting the issue.

I am working on a Native app. In my app we have a button called “Forgot Your PIN”. When we click on that button, the app will redirect to a default mobile browser (i,e safari browser). Where I have fields like Mobile Number text field, Last Name text field and Data of Birth picket.

I am getting elements id or xpath using Appium Inspector. But when I am trying to send values to any of fields there is not taking action performed on iPod Touch mobile safari browser.

I have seen your video’s in YouTube, I feel you can help me in solving the issue.

Appium Version : 1.3.5
iPod Touch : Version 7.1.2

Thanking you,
Bhaskar Sharma