Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ideviceinstaller fails with "Could not connect to lockdownd. Exiting."

Tags:

xcode

ios

iphone

When I try to use ideviceinstaller, the command fails with the following error message:

"Could not connect to lockdownd. Exiting."

Example commands:

ideviceinstaller -l
ideviceinstaller -i Something.ipa

I have googled more than an hour to find the solution, however nothing worked for me:

Reinstall ideviceinstaller
Reinstall libimobiledevice

Reinstall brew and reinstall again both ideviceinstaller, libimobiledevice It works only if I use sudo but it's unfortunately not acceptable in my case.

System paramereters: MacBookPro with 10.11.5 OSX El Capitan Target devices: iPhone 5, iPad 2

Note: I have installed both Xcode 7.3.1 and Xcode 8 beta 3 on my computer. And used these commands to switch between them:

sudo xcode-select -switch /Applications/Xcode-beta.app/
sudo xcode-select -switch /Applications/Xcode.app/
like image 249
TestAutomator Avatar asked Aug 19 '16 09:08

TestAutomator


4 Answers

When you try this command:

ideviceinstaller -d -i Something.ipa

you will get a detailed error. In my case the error is:

lockdown.c:218 lockdown_check_result(): ERROR: PairingDialogResponsePending
11:28:09 lockdown.c:1012 lockdownd_do_pair(): Pair failure
Could not connect to lockdownd. 
Exiting.

On further searching for this error no. 2 I found that there was a trust issue in the Iphone connected, so I opened the Iphone and gave trust device, then the issue got resolved.

like image 129
Balaji Parameswaran Avatar answered Nov 04 '22 17:11

Balaji Parameswaran


Meanwhile I found the answer. This command will add durable privileges to use ideviceinstaller:

sudo chmod -R 777 /var/db/lockdown/
like image 31
TestAutomator Avatar answered Nov 04 '22 16:11

TestAutomator


Just FYI: updates to macOS, iTunes, and probably other Apple software will (correctly) reset the permissions on /var/db/lockdown.

The best solution here is to get the latest libimobiledevice, which has a fix for this particular issue:

brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install ideviceinstaller
brew link --overwrite ideviceinstaller
like image 9
Michael Gallacher Avatar answered Nov 04 '22 15:11

Michael Gallacher


I had many problems with ideviceinstaller too, so at least I have started to use cfgutil.

It's a CLI tool of Apple Configurator 2, always up-to-date and reliable, works well with iOS beta versions.

Just download the free app from the App Store: https://itunes.apple.com/hu/app/apple-configurator-2/id1037126344

Start the app then select "Apple Configurator 2 > Install Automation Tools" from the upper left menu.

To install/uninstall apps:

cfgutil --ecid $ECID remove-app $BUNDLE_ID_OF_INSTALLED_APP;
cfgutil --ecid $ECID install-app $PATH_TO_IPA_OR_APP_FOLDER;

To get ECID, connect an iOS device and run the following command:

cfgutil list

Here are the available functions: https://pastebin.com/ZzeueLK2

like image 2
kubano Avatar answered Nov 04 '22 17:11

kubano