Ideviceinstaller command failure multiple times

I’m trying to run my code via eclipse after starting the appium server. I’m not quite sure if the error I’m getting is appium related, but regardless of multiple installs and reinstalls, I keep getting the same error:

A new session could not be created. (Original error: Command failed: /bin/sh -c ideviceinstaller -u D98935EA-9340-46EF-B460-C3B12453C6F7 -i …/…/…/XYZ.app
) (WARNING: The server did not provide any stacktrace information)

I’ve used the following to install ideviceinstaller:

  1. brew install -v --HEAD --fresh --build-from-source ideviceinstaller
  2. brew install ideviceinstaller
  3. brew install --HEAD ideviceinstaller

but all give me the same error

What happens if you type that command in a terminal window?

/bin/sh -c ideviceinstaller -u D98935EA-9340-46EF-B460-C3B12453C6F7 -i ../.../.../XYZ.app

Also, post more of the log. There may be an error you don’t think is important but is.

This is what I get when I post /bin/sh -c ideviceinstaller -u D98935EA-9340-46EF-B460-C3B12453C6F7 -i …/…/…/XYZ.app in the terminal:

No mode/command was supplied.
Usage: ideviceinstaller OPTIONS
Manage apps on iOS devices.

-u, --udid UDID Target specific device by its 40-digit device UDID.
-l, --list-apps List apps, possible options:
-o list_user - list user apps only (this is the default)
-o list_system - list system apps only
-o list_all - list all types of apps
-o xml - print full output as xml plist
-i, --install ARCHIVE Install app from package file specified by ARCHIVE.
ARCHIVE can also be a .ipcc file for carrier bundles.
-U, --uninstall APPID Uninstall app specified by APPID.
-g, --upgrade ARCHIVE Upgrade app from package file specified by ARCHIVE.
-L, --list-archives List archived applications, possible options:
-o xml - print full output as xml plist
-a, --archive APPID Archive app specified by APPID, possible options:
-o uninstall - uninstall the package after making an archive
-o app_only - archive application data only
-o docs_only - archive documents (user data) only
-o copy=PATH - copy the app archive to directory PATH when done
-o remove - only valid when copy=PATH is used: remove after copy
-r, --restore APPID Restore archived app specified by APPID
-R, --remove-archive APPID Remove app archive specified by APPID
-o, --options Pass additional options to the specified command.
-h, --help prints usage information
-d, --debug enable communication debugging

Homepage: http://libimobiledevice.org

These are the rest of the logs:
Driver info: io.appium.java_client.ios.IOSDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
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:599)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:139)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:160)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:168)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:56)
at iOSTest.AppiumIOSTest.initializeDriver(AppiumIOSTest.java:131)
at iOSTest.AppiumIOSTest.setUp(AppiumIOSTest.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.TestRunner.beforeRun(TestRunner.java:641)
at org.testng.TestRunner.run(TestRunner.java:609)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:282)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:83)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:114)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:286)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:240)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)

Interesting. You do supply a mode/command with the ‘-i’ flag, I hate to ask but could you try it without the ‘/bin/sh -c’ stuff? Just:

ideviceinstaller -u D98935EA-9340-46EF-B460-C3B12453C6F7 -i ../.../.../XYZ.app

The other thing I would try is to change the relative path to an absolute path, like this:

/Users/wreed/XYZ/XYZ.app

Of course, change that to the correct path this app lives, and if there are any spaces in the name remember to quote it in your capabilities.

Now terminal throws me a message saying UDID is incorrect! Perhaps I’m not too clear on this, but is it a mandate to have ideviceinstaller? Is there an alternate for this? Now I’m not even able to launch the emulator through appium.

RROR: Invalid UDID specified
Usage: ideviceinstaller OPTIONS
Manage apps on iOS devices.

-u, --udid UDID Target specific device by its 40-digit device UDID.
-l, --list-apps List apps, possible options:
-o list_user - list user apps only (this is the default)
-o list_system - list system apps only
-o list_all - list all types of apps
-o xml - print full output as xml plist
-i, --install ARCHIVE Install app from package file specified by ARCHIVE.
ARCHIVE can also be a .ipcc file for carrier bundles.
-U, --uninstall APPID Uninstall app specified by APPID.
-g, --upgrade ARCHIVE Upgrade app from package file specified by ARCHIVE.
-L, --list-archives List archived applications, possible options:
-o xml - print full output as xml plist
-a, --archive APPID Archive app specified by APPID, possible options:
-o uninstall - uninstall the package after making an archive
-o app_only - archive application data only
-o docs_only - archive documents (user data) only
-o copy=PATH - copy the app archive to directory PATH when done
-o remove - only valid when copy=PATH is used: remove after copy
-r, --restore APPID Restore archived app specified by APPID
-R, --remove-archive APPID Remove app archive specified by APPID
-o, --options Pass additional options to the specified command.
-h, --help prints usage information
-d, --debug enable communication debugging

Homepage: http://libimobiledevice.org

i’ve actually uninstalled home brew and re-installed. then again uninstalled and re-installed ideviceinstaller. now i see this error:

message":"A new session could not be created. (Original error: ENOENT, no such file or directory '/Users/…/…/…/XYZ.app/

Ok, so it would be impossible for the app to exist @ ‘/Users/…/…/…/XYZ.app/’, I can explain that to you if you need.

Could you find the app and give an absolute path to it? Something like:

/Users/lostinhogwarts/XYZ.app

Without any relative (’…/’) dots in it?

  1. Yes. Appium used to use Fruitstrap for this but I believe that is no longer being maintained
  2. Not that I’m aware of

You could try getting the app onto the device before testing just to get yourself up and running. Appium should recognize that the app is already installed and just run the tests. You’ll probably need to return to this problem and solve it at some point though.

Could you find the app and give an absolute path to it? yes, I’ve tried putting it in the /users/homedir/documents/XYZ.app but even then, the error is the same: "A new session could not be created. (Original error: ENOENT, no such file or directory '/Users/…/…/…/XYZ.app/

Ok, so it would be impossible for the app to exist @ ‘/Users/…/…/…/XYZ.app/’, I can explain that to you if you need. Yes please, appreciate if you explain.

That path has elipses in it, which don’t mean anything (AFAIK) when declaring a path from the terminal. I want to make sure that I’m understanding exactly what you are doing, have you tried to give the command ‘ideviceinstaller -u -i /users/homedir/documents/XYZ.app’? And it’s getting the same error with elipses in the path? That is some weirdness.

If that’s the case I would try to go ahead and install the app as I described above just to get things working. I’ve honestly never seen anything like this. I actually use this tool all the time to sideload .app and .ipa’s on my devices.

I somewhat have the issue resolved. I just had to download a fresh build of the app I was using from the server. Although I’m not quite sure why the older build was causing issues. But I guess this issue could be closed. Thanks for your help @wreed!

1 Like

Cool, I’m glad that worked for you. And thanks for posting the solution–it helps for people who may face the same problem in the future.

@wreed : I am facing the similar issue , I am able to successfully push the app on to the device and even ios_webkit_debug proxy is working fine as I could see the device been displayed on port 9221. but when I am trying to run the code through eclipse the error is being thrown : " An unknown server-side error occurred while processing the command. Original error: Command failed: ideviceinstaller -u -l
ideviceinstaller(20621,0x7fff7dbbf000) malloc: *** error for object 0x7fed03407eb0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug" .

I can actually see the app thats being pushed when ideviceinstaller -u -l in terminal .
I am using Mac with OS ver 10.11.6 , iPad Mini 4 with iOS beta 8 , and Appium version : 1.5.3