libimobiledevice / ideviceinstaller

Manage apps of iOS devices
https://libimobiledevice.org
GNU General Public License v2.0
1.23k stars 256 forks source link

[OSX 10.11.6] Couldn't connect to lockdown #54

Open nonpafos opened 7 years ago

nonpafos commented 7 years ago

I lived with libimobiledevice/ideviceinstaller with no issues for 2 years. But 2 days ago I upgraded to OSX 10.11.6 (in order to install Xcode 8 GM) and now I always get

ERROR: Could not connect to lockdownd, error code -21 alexanders-mbp:Android Alex$ ideviceinfo ERROR: Could not connect to lockdownd, error code -19 alexanders-mbp:Android Alex$ ideviceinfo ERROR: Could not connect to lockdownd, error code -21 alexanders-mbp:Android Alex$

If I unplug device and then plug back, I'll get "trust/don't trust" dialog when libimobiledevice/ideviceinstaller. Choosing "Trust" doesn't help. I tried:

At the same time I can install apps using XCode successfully.

nonpafos commented 7 years ago

I also installed appium recently. It may be related

nikias commented 7 years ago

How did you install it? Please mind that homebrew or macports packages are not using the latest code. I assure you that it works if you compile it yourself using latest code from git master. I have it running on 10.11.6 with latest security patches. No issues at all.

nonpafos commented 7 years ago

You're right, I use brew. Doesn't "--HEAD" help to check out the latest code?

alexanders-mbp:Android Alex$ brew uninstall libimobiledevice Uninstalling /usr/local/Cellar/libimobiledevice/1.2.0... (64 files, 1.1M) alexanders-mbp:Android Alex$ brew uninstall ideviceinstaller Uninstalling /usr/local/Cellar/ideviceinstaller/1.1.0_2... (7 files, 80K) alexanders-mbp:Android Alex$ brew install --HEAD ideviceinstaller ==> Installing dependencies for ideviceinstaller: autoconf, automake, libtool, libimobiledevice ==> Installing ideviceinstaller dependency: autoconf ==> Downloading https://homebrew.bintray.com/bottles/autoconf-2.69.el_capitan.bottle.4.tar.gz ######################################################################## 100.0% ==> Pouring autoconf-2.69.el_capitan.bottle.4.tar.gz ==> Caveats Emacs Lisp files have been installed to: /usr/local/share/emacs/site-lisp/autoconf ==> Summary 🍺 /usr/local/Cellar/autoconf/2.69: 70 files, 3.1M ==> Installing ideviceinstaller dependency: automake ==> Downloading https://homebrew.bintray.com/bottles/automake-1.15.el_capitan.bottle.2.tar.gz ######################################################################## 100.0% ==> Pouring automake-1.15.el_capitan.bottle.2.tar.gz 🍺 /usr/local/Cellar/automake/1.15: 130 files, 3.2M ==> Installing ideviceinstaller dependency: libtool ==> Downloading https://homebrew.bintray.com/bottles/libtool-2.4.6.el_capitan.bottle.tar.gz ######################################################################## 100.0% ==> Pouring libtool-2.4.6.el_capitan.bottle.tar.gz ==> Caveats In order to prevent conflicts with Apple's own libtool we have prepended a "g" so, you have instead: glibtool and glibtoolize. ==> Summary 🍺 /usr/local/Cellar/libtool/2.4.6: 69 files, 3.8M ==> Installing ideviceinstaller dependency: libimobiledevice ==> Downloading https://homebrew.bintray.com/bottles/libimobiledevice-1.2.0.el_capitan.bottle.tar.gz Already downloaded: /Library/Caches/Homebrew/libimobiledevice-1.2.0.el_capitan.bottle.tar.gz ==> Pouring libimobiledevice-1.2.0.el_capitan.bottle.tar.gz 🍺 /usr/local/Cellar/libimobiledevice/1.2.0: 64 files, 1.1M ==> Installing ideviceinstaller ==> Cloning http://git.sukimashita.com/ideviceinstaller.git Cloning into '/Library/Caches/Homebrew/ideviceinstaller--git'... remote: Counting objects: 384, done. remote: Compressing objects: 100% (382/382), done. remote: Total 384 (delta 187), reused 0 (delta 0) Receiving objects: 100% (384/384), 89.33 KiB | 0 bytes/s, done. Resolving deltas: 100% (187/187), done. Checking connectivity... done. ==> Checking out branch master ==> ./autogen.sh ==> ./configure --prefix=/usr/local/Cellar/ideviceinstaller/HEAD ==> make install 🍺 /usr/local/Cellar/ideviceinstaller/HEAD: 7 files, 84K, built in 27 seconds

choppergrip commented 7 years ago

I have the same issue

nikias commented 7 years ago

Oh I think it does. I misread ideviceinstaller for libimobiledevice. Make sure to compile latest libimobiledevice

lambourn commented 7 years ago

had the same issue (also using brew). This is what I did:

$ brew uninstall ideviceinstaller
$ brew uninstall libimobiledevice
$ brew install --HEAD libimobiledevice
$ brew install ideviceinstaller

also, with disconnected iOS device I removed all files from /var/db/lockdown, then reconnected iOS device, OK'ed Trust dialog. Now it works.

nonpafos commented 7 years ago

@lambourn thank you so much. Works! (please fix a typo /val/ > /var/ for newcomers)

lambourn commented 7 years ago

@nonpafos oops, thx - fixed it.

kapil0408 commented 7 years ago

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null brew install libimobiledevice ideviceinfo idevicedate idevicesyslog

When i run all these above commands in terminal. it works fine and work properly I am using OS X El Capitan 10.11.6, XCode 7.3.1

But i want to implement all these things in mac application. could anyone please tell me how to implement this in mac application to get IOS device data.

Any help would be very appreciate.

Thanks

DiptiCT commented 6 years ago

i am getting an error as could not connect to lockdownd on ios11, i have tried all of the above solutions provided to resolve the issue but no luck. $ brew uninstall ideviceinstaller $ brew uninstall libimobiledevice $ brew install --HEAD libimobiledevice $ brew install ideviceinstaller sudo chmod 777 /var/db/lockdown

Now when i execute idevice unpair, it works fine but when i execute idevice pair, i am getting lockdown error, infact when i even try to read info of idevice installed, its throwing the same error [error code -21].

Appium version : 1.7.1 ios version : 11 [latest one]

Can anyone help me out here in resolving this issue.

mleonhard commented 5 years ago

I installed Macports and tools necessary to use Android Studio to install a Flutter app onto my iPhone 6s. I got the same lockdown error.

SOLUTION: I fixed it by deleting the contents of /var/db/lockdown/*, unplugging my phone, restarting my phone, connecting the phone to my laptop, waiting about a minute for the trust popup, entering my password into the trust popup, then waiting another minute for the phone to appear in Xcode's devices view. Now I can launch my Flutter app on my iPhone using the Run button in Android Studio. :) Running 'flutter doctor' still reports 'iOS toolchain' errors, but the Flutter plugin works fine.

Here are some things I tried that did not fix the problem:

Here are the software versions that are working for me: $ sudo port installed The following ports are currently installed: autoconf @2.69_5 (active) automake @1.16.1_0 (active) bzip2 @1.0.6_0 (active) gettext @0.19.8.1_0 (active) ideviceinstaller @1.1.0_0 (active) ios-deploy @1.9.4_0 (active) libiconv @1.15_0 (active) libimobiledevice @1.2.0_1 (active) libplist @2.0.0_0 (active) libtool @2.4.6_5 (active) libusbmuxd @1.0.10_0 (active) libzip @1.5.1_0 (active) ncurses @6.1_0 (active) openssl @1.0.2q_0 (active) pkgconfig @0.29.2_0 (active) zlib @1.2.11_0 (active) I'm using a Macbook Pro with macOS Mojave 10.14.3, Xcode 10.1, Android Studio 3.3.1, and Flutter plugin 33.1.1.