Appium throws "ideviceinstaller" not found when launched through Eclipse – Java

While launching an app on real device through Appium Inspector there are no issues. It works perfect. The issue lies when I invoke to launch an app through Java. I’m specifying standard set of desired capabilities, port etc. Appium is launched but the moment it tries to open app – it throws an error stating Could not initialize ideviceinstaller; make sure it is installed and works on your system

Btw, idevideinstaller is perfectly installed on my Mac.

I guess issue in config or something, any inputs will be appreciated.

Appium Version : 1.4.0

Code used to start Appium Server: : Appium Server is started successfully using this code

public class appiumserver {

public void startserver()
{

	CommandLine command = new CommandLine("/Applications/Appium.app/Contents/Resources/node/bin/node");
	command.addArgument("/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js");
	command.addArgument("--address");
	command.addArgument("127.0.0.1");
	command.addArgument("--port");
	command.addArgument("4723");
	command.addArgument("--no-reset");
	DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
	DefaultExecutor executor = new DefaultExecutor();
	executor.setExitValue(1);


 try {
	   executor.execute(command, resultHandler);
	  } catch (IOException e) {
	   e.printStackTrace();
	  }

}

public static void main(String[] args) {

appiumserver server=new appiumserver();
  System.out.println("---- Starting appium server ----");
  server.startserver();
  System.out.println("---- Appium server started Successfully ! ----");
  
  try {
    Thread.sleep(2000L);
  } catch (InterruptedException e) {
    e.printStackTrace();
  }

}

> Desired capabilities used for launching iOS application:

DesiredCapabilities capabilities = new DesiredCapabilities();

	Config configdta =new Config();

	capabilities.setCapability("appium-version", configdta.getAppiumversion());
	capabilities.setCapability("platformName", configdta.getPlatformname());
	capabilities.setCapability("platformVersion", configdta.getPlatformversion());
	capabilities.setCapability("deviceName", configdta.getDevicename());
	capabilities.setCapability("bundleId", configdta.getBundleID());
	capabilities.setCapability("udid", configdta.getUdid());
	return wd = new IOSDriver(new URL("http://localhost:4723/wd/hub"), capabilities);

***Appium Console logs ***

---- Starting appium server ----
---- Appium server started Successfully ! ----
e[36minfoe[39m: Welcome to Appium v1.4.1 (REV ce6220829063679bcccf5724515c29569c4a16d9)
e[36minfoe[39m: Appium REST http interface listener started on 127.0.0.1:4723
e[36minfoe[39m: [debug] Non-default server args: {“address”:“127.0.0.1”,“noReset”:true}
e[36minfoe[39m: Console LogLevel: debug
e[36minfoe[39m: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m e[90m{“desiredCapabilities”:{“appium-version”:“1.0”,“platformVersion”:“8.1.2”,“bundleId”:“com.itc.generic4”,“platformName”:“iOS”,“udid”:"******************************",“deviceName”:“iPhone 5s”}}e[39m
e[36minfoe[39m: Client User-Agent string: Apache-HttpClient/4.3.6 (java 1.5)
e[36minfoe[39m: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appium-version
e[36minfoe[39m: [debug] App is an iOS bundle, will attempt to run as pre-existing
e[36minfoe[39m: [debug] Creating new appium session 1ecfd6e6-1a26-47af-b34e-0801211755ac
e[36minfoe[39m: [debug] Removing any remaining instruments sockets
e[36minfoe[39m: [debug] Cleaned up instruments socket /tmp/instruments_sock
e[36minfoe[39m: [debug] Auto-detecting iOS udid…
e[36minfoe[39m: [debug] Not auto-detecting udid, running on sim
e[36minfoe[39m: [debug] Localizable.strings is not currently supported when using real devices.
e[36minfoe[39m: [debug] Creating instruments
e[36minfoe[39m: [debug] Preparing uiauto bootstrap
e[36minfoe[39m: [debug] Dynamic bootstrap dir: /Users/i3lsmg/Library/Application Support/appium/bootstrap
e[36minfoe[39m: [debug] Dynamic env: {“nodePath”:"/Applications/Appium.app/Contents/Resources/node/bin/node",“commandProxyClientPath”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js",“instrumentsSock”:"/tmp/instruments_sock",“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“autoDismissAlerts”:false,“sendKeyStrategy”:“grouped”}
e[36minfoe[39m: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

e[36minfoe[39m: [debug] Dynamic bootstrap path: /Users/i3lsmg/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js
e[36minfoe[39m: [debug] Reusing dynamic bootstrap: /Users/i3lsmg/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js
e[36minfoe[39m: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog
e[33mwarne[39m: Could not capture device log using libimobiledevice idevicesyslog. Libimobiledevice probably isn’t installed
e[36minfoe[39m: [debug] Attempting iOS device log capture via deviceconsole
e[36minfoe[39m: [debug] Creating iDevice object with udid ********************************************
e[36minfoe[39m: [debug] Couldn’t find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
e[31merrore[39m: Could not initialize ideviceinstaller; make sure it is installed and works on your system
e[36minfoe[39m: [debug] Cleaning up appium session
e[31merrore[39m: Failed to start an Appium session, err was: Error: Could not initialize ideviceinstaller; make sure it is installed and works on your system
e[36minfoe[39m: [debug] Error: Could not initialize ideviceinstaller; make sure it is installed and works on your system
at [object Object].IOS.getIDeviceObj (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:909:13)
at [object Object].IOS.installToRealDevice (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:856:32)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:607:21
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:246:17
at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:146:13)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:157:25
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:248:21
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:612:34
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-crash-log.js:52:5)
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-crash-log.js:27:5)
at f (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/node_modules/once/once.js:17:25)
at Glob. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/glob.js:131:7)
at Glob.emit (events.js:107:17)
at Glob._finish (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/glob.js:168:8)
at done (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/glob.js:157:12)
at Glob._processReaddir2 (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/glob.js:351:12)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/glob.js:288:17
at RES (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/node_modules/inflight/inflight.js:23:14)
at f (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/node_modules/once/once.js:17:25)
at Glob._readdirEntries (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/glob.js:480:10)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/glob/glob.js:457:12
at FSReqWrap.oncomplete (fs.js:95:15)
e[36minfoe[39m: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not initialize ideviceinstaller; make sure it is installed and works on your system)”,“origValue”:“Could not initialize ideviceinstaller; make sure it is installed and works on your system”},“sessionId”:null}
e[36minfoe[39m: e[37m<-- POST /wd/hub/session e[39me[31m500e[39me[90m 1195.391 ms - 300e[39m e[90me[39m

Hi @deepaelenor,

Please make sure the user on Mac launching the app has read/write permissions to folder where ideviceinstaller resides.

Also make sure /usr/bin is part of PATH variable on Mac machine.

Thanks,
Sujata

Hi Sujata,

I have below permissions

drwxr-xr-x@ 3 i3lsmg admin 102 Jun 24 10:22 chromedriver
drwxr-xr-x@ 3 i3lsmg admin 102 Jun 24 10:22 android_bootstrap
drwxr-xr-x@ 3 i3lsmg admin 102 Jun 24 10:22 deviceconsole
drwxr-xr-x@ 3 i3lsmg admin 102 Jun 24 10:22 unlock_apk
drwxr-xr-x@ 3 i3lsmg admin 102 Jun 24 10:22 unicode_ime_apk
drwxr-xr-x@ 3 i3lsmg admin 102 Jun 24 10:22 settings_apk
drwxr-xr-x@ 4 i3lsmg admin 136 Jun 24 10:22 selendroid
drwxrwxrwx@ 38 i3lsmg admin 1292 Jun 24 10:22 libimobiledevice-macosx

Under libimobiledevice-macosx folder idevice installer is located.

ideviceinstaller has below permissions

-rwxr-xr-x@ 1 i3lsmg admin 18188 Jun 24 10:22 idevicepair
-rwxr-xr-x@ 1 i3lsmg admin 32964 Jun 24 10:22 ideviceinstaller

I tried launching the application through this approach but still it is giving the same error

Hi @deepaelenor

Have you got any solution for this.I have the same issue as I am using the same code to start Appium please let me know if you resolve it.

Regards,
Nishant Singh

Hi @deepaelenor!

I’m having the exact same problem, so any help is really appreciated!

Thanks in advance,

Please provide read/write permisssions to all user groups and check.

Thanks,
Sujata

For Android also i a getting an error as "e[31merrore[39m: Failed to start an Appium session, err was: Error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path"

ANDROID_HOME is set to

echo $ANDROID_HOME
/Users/i3lsmg/Downloads/android-sdk-macosx/

which adb
/Users/i3lsmg/Downloads/android-sdk-macosx/platform-tools/adb

PATH is set to:****
/System/Library/Java/JavaVirtualMachines/1.8.0_20.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/i3lsmg/Downloads/android-sdk-macosx/tools:/Users/i3lsmg/Downloads/android-sdk-macosx/platform-tools:/Users/i3lsmg/Downloads/android-sdk-macosx/build-tools

Bash_profile file contents

export ANDROID_HOME="/Users/i3lsmg/Downloads/android-sdk-macosx/"

export PATH=${PATH}:/Users/i3lsmg/Downloads/android-sdk-macosx/tools
export PATH=${PATH}:/Users/i3lsmg/Downloads/android-sdk-macosx/platform-tools
export PATH=${PATH}:/Users/i3lsmg/Downloads/android-sdk-macosx/build-tools

export JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.8.0_20.jdk/Contents/Home"

export PATH=$JAVA_HOME/bin:$PATH

All the sdk folders have given with read, write permission for all groups

APpium server logs

---- Starting appium server ----
---- Appium server started Successfully ! ----
e[36minfoe[39m: Welcome to Appium v1.4.1 (REV ce6220829063679bcccf5724515c29569c4a16d9)
e[36minfoe[39m: Appium REST http interface listener started on 127.0.0.1:4723
e[36minfoe[39m: [debug] Non-default server args: {“address”:“127.0.0.1”,“noReset”:true}
e[36minfoe[39m: Console LogLevel: debug
e[36minfoe[39m: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m e[90m{“desiredCapabilities”:{“app”:"/Users/i3lsmg/Desktop/com.nbty.detuinen_0.0.3.apk",“appPackage”:“com.nbty.detuinen”,“appActivity”:“com.nbty.detuinen.ui.activities.SplashActivity”,“appium-version”:“1.0”,“platformVersion”:“4.3”,“platformName”:“Android”,“deviceName”:“CB5124DZPB”}}e[39m
e[36minfoe[39m: Client User-Agent string: Apache-HttpClient/4.3.6 (java 1.5)
e[36minfoe[39m: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appium-version
e[36minfoe[39m: [debug] Using local app from desired caps: /Users/i3lsmg/Desktop/com.nbty.detuinen_0.0.3.apk
e[36minfoe[39m: [debug] Creating new appium session 012bb7dd-97a1-41b5-b4bf-6c44c6a19459
e[36minfoe[39m: Starting android appium
e[36minfoe[39m: [debug] Getting Java version
e[36minfoe[39m: Java version is: 1.8.0_20
e[36minfoe[39m: [debug] Checking whether adb is present
e[33mwarne[39m: The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
e[36minfoe[39m: [debug] executing cmd: which adb
e[36minfoe[39m: [debug] Cleaning up android objects
e[36minfoe[39m: [debug] Cleaning up appium session
e[31merrore[39m: Failed to start an Appium session, err was: Error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
e[36minfoe[39m: [debug] Error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:126:12)
at ChildProcess.exithandler (child_process.js:758:5)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Socket. (child_process.js:1183:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:485:12)
e[36minfoe[39m: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.)”,“origValue”:“Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.”},“sessionId”:null}
e[36minfoe[39m: e[37m<-- POST /wd/hub/session e[39me[31m500e[39me[90m 262.926 ms - 342e[39m e[90me[39m

Anybody have insight on these problems, please help

Hi,

Can u try this to solve both ANDROID_HOME and ideviceinstaller error.

CommandLine command = new CommandLine(
“/usr/local/bin/node”);
command.addArgument(
“pathto/main.js”,
false);
command.addArgument("–udid", false);
command.addArgument();
command.addArgument("–address", false);
command.addArgument(“127.0.0.1”);
command.addArgument("–port", false);
command.addArgument(appiumPortVal);
command.addArgument("–no-reset", false);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
ProcessBuilder pb = new ProcessBuilder();
executor.setExitValue(1);
Map<String, String> env = pb.environment();

		env.put("ANDROID_HOME", "/Applications/android-sdk-macosx");
		env.put("PATH", "<value of path environment variable>:/usr/local/Cellar/libimobiledevice/1.2.0/bin:");
		executor.execute(command, env, resultHandler);
		Thread.sleep(10000);

Did anyone solve the original problem posted here? I think the real cause of the issue is these two log lines:

info: [debug] Auto-detecting iOS udid…
info: [debug] Not auto-detecting udid, running on sim

and I’m getting the same problem with Appium.app version 1.4.8 when trying to get it to recognize my USB-attached iPad 4 with iOS 8.1.2. I heard something about Apple deprecating the identification of devices by UDID. Did this happen? Has this broken real iPad testing with Appium?

If any of you with this problem previously has ANY solution, please post it here.

Thanks,
Martin

Hi,

Please try passing udid value as “auto” in DesiredCapability. I think this would work.

Hi, I am using appium 1.4.13 and facing the same issue.

idevice installer working with UI but not with eclipse. Please help.

Hi, I am getting the same issue through eclipse; please help!! Thanks

Hi Sujata,

I am getting the same error thru eclipse; but working fine through UI. Can you please provide the steps to resolve this issue. Thanks in Advance !!

Hi @Ank,

Can you elaborate what steps you are performing for eclipse and UI?

Thanks,
Sujata

I am finding the same issue with ideviceinstaller being installed in my system and I have given all the permission for the folder. Still the issue persists and I am not able to move forward. Is there a solution to this problem. I am stuck in this place,.

@Ank, @vinyas_jain

Please try below steps and see what happens.

Just a workaround for those who need it when facing same issue.

  1. Open terminal from your Mac and enter the command:
    printf “%s\n” $PATH

    –>The purpose is to print the current setting for you Mac’s path

  2. Get the value from the Terminal out put. In my case was:
    /usr/local/bin:/usr/bin:/usr/sbin:/sbin

  3. Right click on the execution.java file in Eclipse then choose [Run Configuration]

  4. Click to tab [Environment] then click on [New]

    • Name: PATH
    • Value: /usr/local/bin:/usr/bin:/usr/sbin:/sbin
  5. Apply then run

1 Like

I have tried this code, However i have got the same thing back again " Couldn’t find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
e[36minfoe[39m: [debug] Cleaning up appium session
e[31merrore[39m: Could not initialize ideviceinstaller; make sure it is installed and works on your system"

Guys… I found the solution.

1.Add the idevice isntaller path to the Environment variable along with the Above code sent by @TuHuynh

So the whole path will look like this…
Name: PATH
Value: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller

Dear @Shiva_Dasoju ,

I have tried all the possibilities mentioned in this thread.

I could not find the path Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller.

Because “build/libimobiledevice-macosx” is not created.

My installed appium path separated form the folder "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules"

Could you please guide me to get this path "Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller"

Looking forward to hear from you.

Thank you.

Dear @rao03.pec,

I have tried with your executor option.

But still it searches in this folder "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller"

But this folder is not exist.

Could you please help me on this.