When i run the code using appium desktop it work just fine and i can inspect elements , but i when i run using code i get this error "[XCUITest] Error: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1 " and the app won’t start even it download the app on iOS simulator , but it just don’t open , and the test case fail.
The code i use :
Runtime.getRuntime().exec("killall node");
AppiumDriverLocalService Service = AppiumDriverLocalService.buildDefaultService();
System.setProperty(AppiumServiceBuilder.NODE_PATH, "/usr/local/bin/node");
System.setProperty(AppiumServiceBuilder.APPIUM_PATH, "/usr/local/bin/appium");
Service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().withIPAddress("127.0.0.1")
.usingPort(5555).withArgument(GeneralServerFlag.LOG_LEVEL, "error")
.withArgument(GeneralServerFlag.SESSION_OVERRIDE));
Service.start();
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("appium-version", "1.0.0");
capabilities.setCapability("automationName", "XCUITest");
capabilities.setCapability("platformName", "iOS");
// capabilities.setCapability("platformVersion", "7.0");
capabilities.setCapability("autoLaunch", true);
capabilities.setCapability("platformVersion", "9.3");
capabilities.setCapability("noReset", true);
// capabilities.setCapability("xcodeConfigFile",
// "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Configurations/ProjectSettings.xcconfig");
capabilities.setCapability("keychainPath", "/Users/Username/Library/Keychains/login.keychain");
capabilities.setCapability("keychainPassword", "UserPassword");
capabilities.setCapability("newCommandTimeout", 60000);
capabilities.setCapability("deviceName", getProperty("iOSDeviceName"));
capabilities.setCapability("app", System.getProperty("user.dir") + File.separator + "Apps" + File.separator
+ "iOS" + File.separator + appName);
MDriver = (AppiumDriver) new IOSDriver(new URL("http://127.0.0.1:5555/wd/hub"), capabilities);
The error i got
[XCUITest] Error: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1
at ChildProcess. (…/…/lib/teen_process.js:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:498:12)
{ Error: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1
at ChildProcess. (…/…/lib/teen_process.js:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:498:12)
stdout: ‘\u001b[1mFetching dependencies\nPlease make sure that you have Carthage installed (https://github.com/Carthage/Carthage)\nNote: We are expecting that carthage installed in /usr/local/bin/\n’,
stderr: ‘’,
code: 1 }
[MJSONWP] Encountered internal error running command: Error: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1
at ChildProcess. (…/…/lib/teen_process.js:66:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:498:12)
(org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Command ‘/bin/bash Scripts/bootstrap.sh -d’ exited with code 1 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 4.43 seconds
Build info: version: ‘2.53.1’, revision: ‘a36b8b1cd5757287168e54b817830adce9b0158d’, time: ‘2016-06-30 19:26:09’
System info: host: ‘NaserMac2.local’, ip: ‘10.200.140.158’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.6’, java.version: ‘1.8.0_91’
Driver info: io.appium.java_client.ios.IOSDriver)
Tools version :
Xcode Version 8.2.1 (8C1002)
Appium : 1.0.0-beta.5 (1.0.0-beta.5)
Simulator device : iPhone 6 iOS 9.3
Please note that the capabilities are the same in Appium desktop and automation code.