与设备失去连接

问题描述 投票:0回答:1

我尝试在 iOS 模拟器中运行 flutter 应用程序... 但它每次都显示我与设备错误连接丢失...

Lost connection to device.
Error: Unable to terminate com.myPackageName.Dev on 6EAC7BBF-3767-44C4-886A-35D72D963210:
ProcessException: Process exited abnormally with exit code 3:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Simulator device failed to terminate com.myPackageName.Dev.
found nothing to terminate
Underlying error (domain=NSPOSIXErrorDomain, code=3):
    The request to terminate "com.myPackageName.Dev" failed. found nothing to terminate
    found nothing to terminate
  Command: /usr/bin/arch -arm64e xcrun simctl terminate 6EAC7BBF-3767-44C4-886A-35D72D963210 com.myPackageName.Dev
the Dart compiler exited unexpectedly.

此错误仅发生在 iOS 模拟器上...在 Android 模拟器上工作正常...

我尝试了所有可能的解决方案......

flutter clean , flutter doctor , flutter run 

重新启动机器 删除驱动器数据

Android Studio 鬣蜥 | 2023.2.1 补丁 2 飞镖 3.3.3

颤动医生结果:

[✓] Flutter (Channel stable, 3.19.5, on macOS 14.4.1 23E224 darwin-arm64, locale en-PK)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.88.1)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for Johnny’s iPhone 12 mini. Ensure the device is unlocked and attached with a cable or
      associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for Johnny ipad. Ensure the device is unlocked and attached with a cable or associated with
      the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for iPhone  14 pro. Ensure the device is unlocked and attached with a cable or associated with
      the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
ios flutter xcode dart ios-simulator
1个回答
0
投票

重置模拟器(设备 -> 删除所有内容和设置),然后在终端中运行

flutter clean

如果它不适合你,那就去吧

完全关闭模拟器(从扩展坞中右键单击 ->“退出”) 关闭 XCode(如果适用) 运行 flutter 干净 重新打开模拟器 重新打开XCode并让它编译 再次运行应用程序 如果仍然不起作用,请尝试在模拟器菜单中的“设备”->“擦除所有内容和设置...”中重置设备。

快乐编码:)

© www.soinside.com 2019 - 2024. All rights reserved.