Skip to content

"flutter run -d chrome" error: Could not connect to lockdownd, error code -17, targeting iOS device instead of chrome #44898

@AugustusLZJ

Description

@AugustusLZJ

Steps to Reproduce

  1. flutter run -d chrome
  2. ideviceinfo

I have also enabled my user_id's read&write in /var/db/lockdown. And I have also tried running the following command to fix the issue, but doesn't work.

brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller

Logs

$ ideviceinfo
ERROR: Could not connect to lockdownd: Password protected (-17)
$ flutter run -d Chrome
$ flutter run -d Chrome
ideviceinfo returned an error:
ERROR: Could not connect to lockdownd, error code -17
$ flutter --verbose run -d Chrome
[  +30 ms] executing: [/Applications/Flutter/flutter/] git -c
log.showSignature=false log -n 1 --pretty=format:%H
[  +45 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%H
[   +1 ms] 856a90e67c9284124d44d2be6c785bacd3a1c772
[        ] executing: [/Applications/Flutter/flutter/] git describe --match
v*.*.* --first-parent --long --tags
[  +19 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long
--tags
[        ] v1.11.0-0-g856a90e
[  +11 ms] executing: [/Applications/Flutter/flutter/] git rev-parse
--abbrev-ref --symbolic @{u}
[  +10 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/dev
[        ] executing: [/Applications/Flutter/flutter/] git ls-remote --get-url
origin
[   +7 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +60 ms] executing: [/Applications/Flutter/flutter/] git rev-parse
--abbrev-ref HEAD
[   +8 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] dev
[  +12 ms] executing: sw_vers -productName
[  +21 ms] Exit code 0 from: sw_vers -productName
[        ] Mac OS X
[        ] executing: sw_vers -productVersion
[  +19 ms] Exit code 0 from: sw_vers -productVersion
[        ] 10.15.1
[        ] executing: sw_vers -buildVersion
[  +20 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 19B88
[  +37 ms] executing: /usr/bin/xcode-select --print-path
[  +11 ms] Exit code 0 from: /usr/bin/xcode-select --print-path
[   +1 ms] /Applications/Xcode.app/Contents/Developer
[   +2 ms] executing: /usr/bin/xcodebuild -version
[ +375 ms] Exit code 0 from: /usr/bin/xcodebuild -version
[   +2 ms] Xcode 11.2
           Build version 11B52
[  +70 ms] executing: /Users/*****/Library/Android/sdk/platform-tools/adb
devices -l
[  +17 ms] Exit code 0 from:
/Users/*****/Library/Android/sdk/platform-tools/adb devices -l
[   +1 ms] List of devices attached
[  +18 ms] executing:
/Applications/Flutter/flutter/bin/cache/artifacts/libimobiledevice/idevice_id -h
[ +253 ms] "flutter run" took 873ms.
ideviceinfo returned an error:
ERROR: Could not connect to lockdownd, error code -17
#0      IMobileDevice.getInfoForDevice
(package:flutter_tools/src/ios/mac.dart:224:9)
<asynchronous suspension>
#1      IOSDevice.getAttachedDevices
(package:flutter_tools/src/ios/devices.dart:190:55)
<asynchronous suspension>
#2      IOSDevices.pollingGetDevices
(package:flutter_tools/src/ios/devices.dart:115:57)
#3      PollingDeviceDiscovery.devices
(package:flutter_tools/src/device.dart:285:52)
<asynchronous suspension>
#4      DeviceManager.getAllConnectedDevices
(package:flutter_tools/src/device.dart:140:46)
<asynchronous suspension>
#5      DeviceManager.getDevicesById
(package:flutter_tools/src/device.dart:104:40)
<asynchronous suspension>
#6      DeviceManager.getDevices (package:flutter_tools/src/device.dart:129:11)
#7      DeviceManager.findTargetDevices
(package:flutter_tools/src/device.dart:173:34)
<asynchronous suspension>
#8      FlutterCommand.findAllTargetDevices
(package:flutter_tools/src/runner/flutter_command.dart:581:48)
<asynchronous suspension>
#9      RunCommand.validateCommand
(package:flutter_tools/src/commands/run.dart:286:21)
<asynchronous suspension>
#10     FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:531:11)
<asynchronous suspension>
#11     FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:456:33)
<asynchronous suspension>
#12     AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:146:29)
<asynchronous suspension>
#13     _rootRun (dart:async/zone.dart:1124:13)
#14     _CustomZone.run (dart:async/zone.dart:1021:19)
#15     _runZoned (dart:async/zone.dart:1516:10)
#16     runZoned (dart:async/zone.dart:1463:12)
#17     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
<asynchronous suspension>
#18     FlutterCommand.run
(package:flutter_tools/src/runner/flutter_command.dart:446:20)
#19     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
<asynchronous suspension>
#20     FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:416:21)
<asynchronous suspension>
#21     AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:146:29)
<asynchronous suspension>
#22     _rootRun (dart:async/zone.dart:1124:13)
#23     _CustomZone.run (dart:async/zone.dart:1021:19)
#24     _runZoned (dart:async/zone.dart:1516:10)
#25     runZoned (dart:async/zone.dart:1463:12)
#26     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
<asynchronous suspension>
#27     FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:367:19)
<asynchronous suspension>
#28     CommandRunner.run.<anonymous closure>
(package:args/command_runner.dart:112:25)
#29     new Future.sync (dart:async/future.dart:222:31)
#30     CommandRunner.run (package:args/command_runner.dart:112:14)
#31     FlutterCommandRunner.run
(package:flutter_tools/src/runner/flutter_command_runner.dart:251:18)
#32     run.<anonymous closure>.<anonymous closure>
(package:flutter_tools/runner.dart:63:22)
<asynchronous suspension>
#33     _rootRun (dart:async/zone.dart:1124:13)
#34     _CustomZone.run (dart:async/zone.dart:1021:19)
#35     _runZoned (dart:async/zone.dart:1516:10)
#36     runZoned (dart:async/zone.dart:1500:12)
#37     run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)
<asynchronous suspension>
#38     AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:146:29)
<asynchronous suspension>
#39     _rootRun (dart:async/zone.dart:1124:13)
#40     _CustomZone.run (dart:async/zone.dart:1021:19)
#41     _runZoned (dart:async/zone.dart:1516:10)
#42     runZoned (dart:async/zone.dart:1463:12)
#43     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
<asynchronous suspension>
#44     runInContext (package:flutter_tools/src/context_runner.dart:65:24)
<asynchronous suspension>
#45     run (package:flutter_tools/runner.dart:50:10)
#46     main (package:flutter_tools/executable.dart:65:9)
<asynchronous suspension>
#47     main
(file:///Applications/Flutter/flutter/packages/flutter_tools/bin/flutter_tools.d
art:8:3)
#48     _startIsolate.<anonymous closure>
(dart:isolate-patch/isolate_patch.dart:303:32)
#49     _RawReceivePortImpl._handleMessage
(dart:isolate-patch/isolate_patch.dart:172:12)

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v1.11.0, on Mac OS X 10.15.1 19B88, locale en)
 
[!] Android toolchain - develop for Android devices (Android SDK version 27.0.3)
    ✗ Flutter requires Android SDK 28 and the Android BuildTools 28.0.3
      To update using sdkmanager, run:
        "/Users/*****/Library/Android/sdk/tools/bin/sdkmanager"
        "platforms;android-28" "build-tools;28.0.3"
      or visit https://flutter.dev/setup/#android-setup for detailed
      instructions.
[!] Xcode - develop for iOS and macOS (Xcode 11.2)
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with
        is different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods. For more info, see
        https://github.com/flutter/flutter/issues/14293.
      To re-install CocoaPods, run:
        sudo gem install cocoapods
[✓] Chrome - develop for the web
[!] Android Studio (version 3.0)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2019.2.4)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.37.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[☠] Connected device (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message
      below is not helpful, please let us know about this issue at
      https://github.com/flutter/flutter/issues.
    ✗ Exception: ideviceinfo returned an error:
      ERROR: Could not connect to lockdownd, error code -17

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consoleplatform-webWeb applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions