Jenkins ideviceinstaller error

Hi everyone,

The last few Builds (about 10 or so) that I have run on my localhost Jenkins is giving me the following error:
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[iOSLog] Could not capture device log using libimobiledevice idevicesyslog. Libimobiledevice is probably not installed
[debug] [iOSLog] Attempting iOS device log capture via deviceconsole
[iOS] Could not capture logs from device. Continuing without capturing logs.
[debug] [iOS] Creating iDevice object with udid 594c69db1eec686cd22c93071a4d05ec0addea39
[debug] [iOS] Couldn’t find ideviceinstaller, trying built-in at /usr/local/lib/node_modules/appium/node_modules/build/libimobiledevice-macosx/ideviceinstaller
[iOS] Could not initialize ideviceinstaller; make sure it is installed and works on your system
[MJSONWP] Encountered internal error running command: Error: Could not initialize ideviceinstaller; make sure it is installed and works on your system

I have run it locally in the Jenkins workspace on my machine and everything works fine. I have even tried uninstalling/reinstalling home-brew/node/libimobiledevice (ideviceinstaller)/Appium…but nothing seems to work and I keep getting the exact same error. Running blank and out of options. This is being run against a real device. Any help would be greatly appreciate.

Thanks

I now put some environment variables in the Jenkins environment variables section so I do not see that ideviceinstaller anymore, BUT now Appium is not launching (is it because I need to give the node env. variable as well? If so please add to this… Here is what I added to that section:

#extending path
export PATH=/usr/local/Cellar/libimobiledevice/1.2.0/bin:/usr/local/Cellar/maven/3.3.9/libexec/bin

#comment!
FOO=BAR

@amedvedev @Mario @Arvind_Patel @RamS @wreed

What’s the log say? Can you post it?

[debug] [iOS] Running ios real device reset flow
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: ‘/usr/local/Cellar/libimobiledevice/1.2.0/bin/idevicesyslog’
[debug] [iOS] Creating iDevice object with udid 594c69db1eec686cd22c93071a4d05ec0addea39
[debug] [iOS] Couldn’t find ideviceinstaller, trying built-in at /usr/local/lib/node_modules/appium/node_modules/build/libimobiledevice-macosx/ideviceinstaller
[iOS] Could not initialize ideviceinstaller; make sure it is installed and works on your system
[MJSONWP] Encountered internal error running command: Error: Could not initialize ideviceinstaller; make sure it is installed and works on your system

this is the latest error. Maybe I am not doing something right with the Env. variables.

Thanks.

Add ‘/usr/local/bin’ to the PATH env variable and you should have ideviceinstaller.

Exactly same error log. If it helps here are some additional details.
My Env. Variables section has this in Properties Content:
#extending path
export PATH=/usr/local/Cellar/libimobiledevice/1.2.0/bin:/usr/local/Cellar/maven/3.3.9/libexec/bin:/usr/local/bin

#comment!
FOO=BAR

My Execute shell has this:
/usr/local/bin/node /usr/local/lib/node_modules/appium/build/lib/Main.js &

sleep 10
mvn test

Do you have more than one builder?

I am not sure what you mean ? How can I check for it

Typically Jenkins is used with a pool of builders. You may need to ask whoever set it up.

You can also check the ‘Console Output’ on a Jenkins job, and on the upper left you can click something like ‘Show all’, and then the beginning of that console log should say what builder that job ran on. I don’t have access to our Jenkins right now but I think that’s the way.

So ultimately what I’m saying is that if you have multiple builders you need to set each one up. If you install ideviceinstaller on one of the builders and Jenkins uses a different builder to run the job, you would get an error like you describe.

yeah I do not see any Show All on the top left of the Project…maybe its somewhere else…

Hi @Styris @wreed, i found actual causes, this is exactly due to jerking builder which run’s your jenkins job. which is nothing but a shell. which is different hence all environment variable defined in your .bash_profile/.bashrc will not be available during run. to mitigate this issue there is plugin in jenkins which needs to be installed.
Plug-in name:

The way to configure in jenkins:

Hope this helps.

Thanks,
Priyank Shah

Hi,
Looking at your logs it seems that the Target machine on which jenkins is connecting for the run doesnt have libimobiledevices . Try installing the same on the target machine.
command for installing it is brew install libimobiledevice.
As it brings all the required packages for iOS devices automation.

@akash_chaudhary this issue is not with libimobiledevice, the issue is jenkins executer do not locate ideviceinstaller in spawned shell. So when i tried to run the same thing manually by navigating Jenkins workspace it was working fine. So ideviceinstaller is already present in machine.