Error while executing appium script in java on ios device

try to set in capability name of device

  • it is in your capability
    in appium – Users/infotech/Desktop/SafariLauncherAfterUpdate/SafariLauncher.app

You want to launch Safari?
For real device you need app.ipa

brew install libimobiledevice --HEAD – Did you do it?

@Wafe_is_7 Yes I did it.
I have provisioned profile safariLauncher. So should I use .ipa in place of .app

@Wafe_is_7 I have tried installing both MobileBanking app and Safari. For both scripts I am getting same error

For real devices you need file.ipa
For Simulators you need file.app
I don`t launch safari with appium.

Just try to launch without safari!

@Wafe_is_7 But how to launch webapp without safari?? Do you have code for it??

@Wafe_is_7 I am getting same error even after using .ipa.

how do you start appium?

@Wafe_is_7 I am starting appium from java code.

CommandLine command = new CommandLine("/Applications/Appium.app/Contents/Resources/node/bin/node");
command.addArgument("/usr/local/bin/appium",false);
command.addArgument("–address", false);
command.addArgument(“0.0.0.0”);
command.addArgument("–port", false);
command.addArgument(“4723”);
command.addArgument("-bp", false);
command.addArgument(“4724”);
command.addArgument("–full-reset", true);
command.addArgument("–session-override", true);
//command.addArgument("–no-reset", true);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
try {executor.execute(command, resultHandler);
Thread.sleep(5000);System.out.println(“Appium server started.”);}

I am using Appium 1.6.3. I am n not having UI version. Is the path of node and appium correct?? Because the path of node that I am using is from older appium version.

I don`t start appium from code!

I start appium from console!

: appium --address (your address) --port(your port) --session-override

@Wafe_is_7 It is working fine when I start server manually. But when I start using Java Code it is giving error.

Hi…I am also facing similar issue. Appium is not able to find the connected device. I am using appium 1.6.4-beta6.

[debug] [XCUITest] Xcode version set to ‘8.2.1’ (tools v8.2.0.0.1.1480973914)
[debug] [XCUITest] iOS SDK Version set to ‘10.2’
[debug] [BaseDriver] Event ‘xcodeDetailsRetrieved’ logged at 1490432945221 (14:39:05 GMT+0530 (IST))
[XCUITest] The ‘idevice_id’ program is not installed. If you are running a real device test it is necessary. Install with ‘brew install libimobiledevice --HEAD’
[debug] [XCUITest] Available devices:
[XCUITest] Error: Unknown device or simulator UDID: ‘d7e9ea82703b2905bf0f5a969d925dc8692ef56c’

however idevice_id -l does return me the device udid.

I am just not able to find the best possible configuration to get it running.

When you start appium from consol with jaca code, you have error with ‘device ID’ - ?

@Wafe_is_7 When I start appium from Terminal and then execute my java code the application is getting invoked.

I’m seeing the exact same issue. My Appium tests are written in a way that they start the server programatically. It works as expected on the simulator - no issues at all. On the real device, however, I get the [XCUITest] Error: Unknown device or simulator UDID: <udid> error.

  • Appium 1.6.4
  • I tried uninstalling/reinstalling libimobiledevice (with --HEAD, per the instructions)
  • I switched USB ports
  • I ran ios-deploy -c and my device is recognized
  • I verified my device name is correct in my capabilities

I ran Appium from the console and then attempted to run my tests on the real device, and that worked. I just can’t run them for some reason when I start the Appium server programmatically.

Did you ever find a solution to this problem?

It’s environmental issue only, so creating builder with environment.

This is the code, which solves the issue for me

	Map<String, String> env = new HashMap<>(System.getenv());
	env.put("PATH", "/usr/local/bin:" + env.get("PATH"));
                AppiumServiceBuilder builder = new AppiumServiceBuilder()
			.withIPAddress("0.0.0.0")
			.usingPort(4723)
			.withEnvironment(env)
			.usingDriverExecutable(new File("/usr/local/bin/node"))
			.withAppiumJS(new File("/Applications/Appium.app/Contents/Resources/app/node_modules/appium/build/lib/main.js"));
	
	service = AppiumDriverLocalService.buildService(builder);
                service.start();

Thanks

Have a scenario, Have the code in eclipse on windows, to start the appium server on mac from windows.
Installed appium through npm, manually if i start the server on mac and trigger the run using the eclispe code on windows is working fine. when i start the appium server though code, Im getting the below error. Also tried setting the PATH variable on mac and also in eclipse environment Run congiuration.–> No luck.
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: "Carthage not found. Install using brew install carthage". (WARNING: The server did not provide any stacktrace information)

Note: Carthage is installed. carthage version- 0.27
appium 1.7.1
node version - v6.4.0
npm version -v3.10.6

Appreicate help:slight_smile:

@Rudra any thoughts on the issue im facing?

Fixed the issue! Thanks!