<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>orhan.cn - Flutter</title>
    <link rel="self" type="application/atom+xml" href="https://orhan.cn/tags/flutter/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://orhan.cn"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-04-07T00:00:00+00:00</updated>
    <id>https://orhan.cn/tags/flutter/atom.xml</id>
    <entry xml:lang="en">
        <title>Flutter 设备未识别：USB 调试这个坑</title>
        <published>2026-04-07T00:00:00+00:00</published>
        <updated>2026-04-07T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/flutter-usb-debugging/"/>
        <id>https://orhan.cn/posts/flutter-usb-debugging/</id>
        
        <content type="html" xml:base="https://orhan.cn/posts/flutter-usb-debugging/">&lt;h2 id=&quot;wen-ti&quot;&gt;问题&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#wen-ti&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;今天跑 &lt;code&gt;flutter devices&lt;&#x2F;code&gt; 想在真机上调试，结果只看到 macOS、Chrome 和 iPhone，Android 手机完全不见踪影。&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; flutter devices
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Found&lt;&#x2F;span&gt;&lt;span&gt; 3 connected devices:
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;macOS&lt;&#x2F;span&gt;&lt;span&gt; (desktop)                 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;•&lt;&#x2F;span&gt;&lt;span&gt; macos                 • darwin-arm64
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Mac&lt;&#x2F;span&gt;&lt;span&gt; Designed for iPad (desktop) &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;•&lt;&#x2F;span&gt;&lt;span&gt; mac-designed-for-ipad • darwin
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Chrome&lt;&#x2F;span&gt;&lt;span&gt; (web)                    &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;•&lt;&#x2F;span&gt;&lt;span&gt; chrome                • web-javascript
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;手机明明插着，开发者模式也开了，就是认不出来。&lt;&#x2F;p&gt;
&lt;h2 id=&quot;pai-cha-guo-cheng&quot;&gt;排查过程&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#pai-cha-guo-cheng&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;以为是 Android SDK 或者驱动的问题，跑了 &lt;code&gt;flutter doctor&lt;&#x2F;code&gt;，结果：&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Android SDK 没问题。&lt;code&gt;adb devices&lt;&#x2F;code&gt; 也是空的。说明问题不在 Flutter 层面，而是 macOS 根本没识别到手机。&lt;&#x2F;p&gt;
&lt;h2 id=&quot;yuan-yin&quot;&gt;原因&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#yuan-yin&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;最后想起来——&lt;strong&gt;USB 调试没开&lt;&#x2F;strong&gt;。&lt;&#x2F;p&gt;
&lt;p&gt;光开&quot;开发者模式&quot;不够，USB 调试是独立的选项，必须单独打开。&lt;&#x2F;p&gt;
&lt;h2 id=&quot;zheng-que-bu-zou&quot;&gt;正确步骤&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#zheng-que-bu-zou&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;正确顺序是这样的：&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;打开 USB 调试&lt;&#x2F;strong&gt;
设置 → 开发者选项 → &lt;strong&gt;USB 调试&lt;&#x2F;strong&gt; → 打开&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;插入数据线&lt;&#x2F;strong&gt;
用支持数据传输的线（有些线只能充电）&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;在手机上授权&lt;&#x2F;strong&gt;
连接电脑后，手机会弹出对话框，勾选&quot;始终允许来自此计算机&quot;，点允许&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;（可选）切换 USB 模式&lt;&#x2F;strong&gt;
从通知栏下拉 → USB 选项 → 选择&quot;传输文件（MTP）&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;搞定之后再跑 &lt;code&gt;flutter devices&lt;&#x2F;code&gt;，Android 设备就出现了：&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; flutter devices
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Found&lt;&#x2F;span&gt;&lt;span&gt; 4 connected devices:
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;macOS&lt;&#x2F;span&gt;&lt;span&gt; (desktop)                 &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;•&lt;&#x2F;span&gt;&lt;span&gt; macos                 • darwin-arm64
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;...
&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;Pixel&lt;&#x2F;span&gt;&lt;span&gt; 6a (mobile)              &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;•&lt;&#x2F;span&gt;&lt;span&gt; android-arm64         • Android 14
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;xiao-jie&quot;&gt;小结&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#xiao-jie&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;这是一个低级错误，但确实值得记录。开发者模式和 USB 调试是两回事，平时用得少真的会忘。下次遇到类似问题，先检查这三点：&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;USB 调试开了没&lt;&#x2F;li&gt;
&lt;li&gt;数据线支不支持数据传输&lt;&#x2F;li&gt;
&lt;li&gt;授权弹窗点了没&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;题图：Flutter 调试界面&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
