Error : Appium with ios on actual device

Below error is seen, for the following below code:
What is the solution to resolve this Guys, looking forward to hear from you
HELP HELP

org.openqa.selenium.SessionNotCreatedException: A new session could not
be created. (Original error: Please provide the ‘app’ or ‘browserName’
capability or start appium with the --app or --browser-name argument.
Alternatively, you may provide the ‘bundleId’ and ‘udid’ capabilities
for an app under test on a real device.) (WARNING: The server did not
provide any stacktrace information)
Command duration or timeout: 195 milliseconds

===
Code:

import io.appium.java_client.ios.IOSDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import io.appium.java_client.ios.*;

public class FB_ios {

public static IOSDriver driver;
//public static AndroidDriver driver;

public class FB_ios { public static IOSDriver driver;
//public static AndroidDriver driver; @BeforeClass
public void setUP() throws MalformedURLException { DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, “firefox”);
capabilities.setCapability(“device”, “iPhone 5”);
capabilities.setCapability(“u_did”, “9e8bf6eeb08db0fff2113c39cc828b13e2d57da5”);
capabilities.setCapability(“bundle_id”, “com.telstra.labs.treats”);
capabilities.setCapability(“deviceName”, “VIV-064”);
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“platformVersion”, “8.0”); capabilities.setCapability(“appPackage”, “com.telstra.labs.treats”);
capabilities.setCapability(“appActivity”, “au.com.vivant.telstratreats.activity.WelcomeActivity”); driver = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

@Test
public void Web_App_Test() throws InterruptedException

{
    System.out.println("Test started");

    System.out.println(" Start to identify a test");

    By.id("com.facebook.katana:id/login_username").findElement(driver).click();
    Thread.sleep(1000L);

    System.out.println("Test Completed");
}


@AfterClass
public void tearDown()
{
    driver.quit();
}

}

Try it with below capabilities:

public void setUP() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“browserName”, “iOS”);
capabilities.setCapability(“udid”, “9e8bf6eeb08db0fff2113c39cc828b13e2d57da5”);
capabilities.setCapability(“bundleId”, “com.telstra.labs.treats”);
capabilities.setCapability(“deviceName”, “VIV-064”);//deviceName is the device returned by instruments with instruments -s devices
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“platformVersion”, “8.0”);
capabilities.setCapability(“appPackage”, “com.telstra.labs.treats”);
capabilities.setCapability(“appActivity”, “au.com.vivant.telstratreats.activity.WelcomeActivity”);
driver = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

Thanks Mitesh.
Now i got the below error: what is ideviceinstaller?

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not initialize ideviceinstaller; make sure it is installed and works on your system) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.34 seconds

I think some thing wrong with the Apppackage name, i justed used the one which i provided for Android. If YES
What should i specify for iOS ? and how will i provide the App Name to launch the App?
How to Identify the AppName which is already present in the device

Regards,
Lokesh

Yes ,you don’t need to define the below capabilities they are applicable for android:

capabilities.setCapability(“appPackage”, “com.telstra.labs.treats”);
capabilities.setCapability(“appActivity”, “au.com.vivant.telstratreats.activity.WelcomeActivity”);

Use below capability to launch the app in iOS:
capabilities.setCapability(“bundleId”, “com.telstra.labs.treats”);
//You can get bundleId from info.plist file

Mitesh,

Still unsucessfully in launching the App. Below error is seen

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not initialize ideviceinstaller; make sure it is installed and works on your system) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.28 seconds
Build info: version: ‘2.46.0’, revision: ‘61506a4624b13675f24581e453592342b7485d71’, time: ‘2015-06-04 10:22:50’
System info: host: ‘snackreligion-lm-2.local’, ip: ‘10.80.5.51’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10.3’, java.version: ‘1.7.0_79’
Driver info: io.appium.java_client.ios.IOSDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)

Try passing app capability:

capabilities.setCapability(“app”,"/Path/xxx.ipa");

Try to use these-

            capabilities.setCapability("appium-version", "1.0");
	capabilities.setCapability("platformName", "iOS");
	capabilities.setCapability("platformVersion", "8.1");
	capabilities.setCapability("deviceName", "iPad Retina"); << Can use UDID for real device>>>
	capabilities.setCapability("nativeWebTap", true);
	capabilities.setCapability("browserName", "safari");
	capabilities.setCapability("app", ".ipa"); << ipa path>>
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

Note: take out the bundle id from your capabilities, Make sure the .ipa you are using is built for the device and Build the app on device from xcode before you use appium and enable UIautomation is developer settings.

ideviceinstaller was not installed
once i used
brew install ideviceinstaller
it worked
thanks Guys