【错误记录】flutter attach 附加设备 执行报错 ( 附加设备注意事项 )

📅 发布时间:2026/7/16 21:06:08 👁️ 浏览次数:
【错误记录】flutter attach 附加设备 执行报错 ( 附加设备注意事项 )
文章目录一、错误记录1、只能有一个终端执行 Flutter 项目2、正在运行的项目无法附加二、解决方案一、错误记录1、只能有一个终端执行 Flutter 项目执行flutter run-dPXUYD22628020934命令 , 如果在一个 命令行 正在运行 Flutter 项目 , 此时在 另外一个命令行终端 运行 上述命令 , 就会报错 :D:\002_Project\001_Flutter\client_terminal\build\app\outputs\flutter-apkflutter attach-dPXUYD22628020934 Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!Targetfilelib\main.dartnot found.2、正在运行的项目无法附加Flutter 项目正在运行 , 执行flutter attach-d PXUYD22628020934命令 , 就会报如下错误 , 会一直卡在Waiting for a connection from Flutter on CTR AL00...位置 ;D:\002_Project\001_Flutter\client_terminalflutter attach-dPXUYD22628020934 Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!Waitingfora connection from Flutter on CTR AL00... The Dart VM Service was not discovered after30seconds. This is taking much longer than expected...二、解决方案建议按照如下 的 执行顺序 执行命令 ;首先, 执行 下面的命令 , 运行一次 Flutter 项目 ;flutter run-dPXUYD22628020934然后, 按 q - 回车 , 退出应用 ;再后, 执行下面的命令 ,附加设备 :flutter attach-dPXUYD22628020934执行完命令后 , 会卡在Waiting for a connection from Flutter on CTR AL00...位置 ;D:\002_Project\001_Flutter\client_terminalflutter attach-dPXUYD22628020934 Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!Waitingfora connection from Flutter on CTR AL00...最后, 手机应用中 , 重启 Flutter 项目 ,一定要 杀进程 彻底退出应用;D:\002_Project\001_Flutter\client_terminalflutter attach-dPXUYD22628020934 Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!Waitingfora connection from Flutter on CTR AL00... Syncing files to device CTR AL00...2,215ms Flutter run key commands. r Hot reload. R Hot restart. h List all available interactive commands. c Clear thescreenq Quit(terminate the application on the device). A Dart VM Service on CTR AL00 is available at: http://127.0.0.1:2802/qSS8xKqjAL8/ The Flutter DevTools debugger and profiler on CTR AL00 is available at: http://127.0.0.1:2802/qSS8xKqjAL8/devtools/?uriws://127.0.0.1:2802/qSS8xKqjAL8/ws