簡體   English   中英

無法在 Flutter 中調試 VSCode 之外運行

[英]Unable to Run outside of Debug VSCode in Flutter

我將非常感謝任何幫助。 我無法在調試模式之外運行 Android 或 iOS 模擬器。 運行代碼時,會彈出 Dart DevTools。 當我嘗試查看性能部分時,它顯示“您正在調試模式下運行您的應用程序。調試模式並不表示發布性能。使用 '--profile' 參數重新啟動您的應用程序或從 VSCode 或 IntelliJ 以配置文件模式重新啟動“我遇到了 Flutter 和 Dart 正常工作的問題,所以我嘗試卸載所有內容,然后重新安裝。

  1. 將 flutter run --profile 放入終端時,我得到了下面的確切結果。
    flutter run --profile
    
    Multiple devices found:
    Android SDK built for x86 (mobile) • emulator-5554 • 
    android-x86 • Android 8.1.0 (API 27) (emulator)
    AOSP on IA Emulator (mobile)       • emulator-5556 • 
    android-x86 • Android 9 (API 28) (emulator)
    [0]: Android SDK built for x86 (emulator-5554)
    [1]: AOSP on IA Emulator (emulator-5556)
    Please choose one: [0|1]: 0
    Profile mode is not supported by Android SDK built for 
    x86.
    new@NEWs-MBP explornation05 % flutter doctor
    Doctor summary (to see all details, run flutter doctor 
    -v):
    [✓] Flutter (Channel stable, 1.20.2, on Mac OS X 
    10.15.4 19E287, locale en-US) 
    [✓] Android toolchain - develop for Android devices 
    (Android SDK version 28.0.3)
    [✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    [✓] Android Studio (version 4.0)
    [✓] IntelliJ IDEA Community Edition (version 2020.2.1)
    [✓] VS Code (version 1.48.2)
    [✓] Connected device (2 available)
    
    • No issues found!"

但也有問題。

  1. 我也嘗試過 'flutter run --release' flutter run --release Release mode is not supported by AOSP on IA Emulator.

  2. 我還查看了 StackOverflow App 在調試模式下運行僅適用於 Flutter 的“App running on debug mode only for Flutter”問題

在運行選項卡下,他們可以選擇在旁邊的圖片中以發布模式運行顫振。

在發布模式下運行 Flutter 的選項與我得到的唯一選項

  1. 我也嘗試在配置的launch.json選項卡上輸入flutterMode:release和flutterMode:配置文件,但這也沒有解決它。

還是新手,謝謝您的幫助!

Flutter 文檔中所述,建議在物理設備上測試您的應用程序,並考慮在用戶可能合理使用的最慢設備上檢查性能。 在模擬器或模擬器上運行應用程序的性能和分析結果並不是發布版本最終行為的一般指標。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM