Enable ADB Debugging Before Connect

If you don’t enable Developer Options and turn on USB Debugging before plugging in the cable, adb devices won’t detect the phone because the Android system doesn’t trust the connection yet.

Here’s what you need to do step-by-step to fix this:


? 1. Enable Developer Options

  • Go to Settings > About phone.
  • Tap Build number 7 times quickly until you see “You are now a developer”.
  • Go back to Settings, there should now be a new menu called Developer options.

? 2. Enable USB Debugging

  • Open Settings > Developer options.

  • Scroll down and toggle ON:

    • USB Debugging
    • (Optional but useful) Allow USB debugging in charge only mode (if your Android version supports it).

? 3. (Optional but smart) Enable Always allow USB Debugging

  • When you first connect to the PC, your phone will show a pop-up:
    “Allow USB debugging?”
    Check Always allow from this computer and tap Allow.

? 4. (Extra precaution) Set USB mode to File Transfer (MTP)
Sometimes, the default USB mode is “Charging only” which doesn’t activate ADB. After plugging in:

  • Pull down the notification shade.
  • Tap the USB connection notification.
  • Set it to File Transfer (MTP).

💡 Why adb devices shows nothing?

  • Without enabling USB Debugging, Android ignores adb.
  • Some phones need you to manually set USB mode from “Charging” to “MTP”.
  • Bad USB cables (some are power-only, no data) also cause this.

There is a “backdoor” way to enable USB debugging without going through the Android UI, and it’s only possible in some cases (depends on whether your bootloader is unlocked and/or if you have custom recovery like TWRP). Here’s the full breakdown:


🛠? Force-enable USB debugging via recovery/fastboot

This works by modifying the system settings that control USB debugging.


? Step 1: Boot into recovery or fastboot

  • Recovery mode:

    • Power off your phone.
    • Hold Power + Volume Up (or Power + Volume Down, depends on phone) until you see the recovery screen.
    • If you have TWRP, even better.
  • Fastboot mode:

    • Power off the phone.
    • Hold Power + Volume Down to enter fastboot.

? Step 2: Check if bootloader is unlocked
Run on your PC:

fastboot devices

If your device shows up, your connection works.

Then check:

fastboot oem device-info

If Bootloader unlocked: true, you’re good to go.
If locked, you can’t write to system partitions, unless the OEM allows unlocking (e.g., Xiaomi requires permission).


? Step 3: Mount /system and edit settings (if using TWRP)
If you have TWRP:

  1. Go to Mount, and make sure System is mounted read/write.

  2. Open Advanced > Terminal or use adb shell.

  3. Use this command to enable USB debugging:

    setprop persist.service.adb.enable 1
    setprop persist.service.debuggable 1
    setprop persist.sys.usb.config adb
    
  4. You may also directly edit build.prop:

    nano /system/build.prop
    

    Add these lines at the end:

    persist.service.adb.enable=1
    persist.service.debuggable=1
    persist.sys.usb.config=adb
    
  5. Reboot system.


? Step 4: Enable adb over TCP (optional)
If USB is flaky, you can force ADB over Wi-Fi:

adb tcpip 5555

Then connect via:

adb connect <phone_ip>:5555

?? If you only have fastboot

You can try flashing userdata or system partition with a modified image that already has USB debugging enabled. For example:

  1. Download your stock ROM and unpack system.img.

  2. Mount system.img on your PC and edit build.prop like above.

  3. Repack and flash:

    fastboot flash system system.img
    
  4. Reboot to system.


? This won’t work if…

  • Bootloader is locked (can’t modify system).
  • No TWRP installed.
  • OEM doesn’t allow fastboot flashing without authorization.

$ adb devices

  • daemon not running; starting now at tcp:5037
  • daemon started successfully
    List of devices attached

$ adb devices
List of devices attached
???RTHW device

$ adb shell pm uninstall --user 0 com.android.vending
Success

$ adb push "com.._1.2025.119-2511909_2arch_7dpi_25lang_8cf86cdc1278654ec74918d40043a804_apkmirror.com.apkm" /sdcard/Download/
com.
.**_1.2025.119-2511909_2arch_7dpi_25lang_8c…le pushed, 0 skipped. 14.2 MB/s (38778457 bytes in 2.610s)

This will copy it to
Internal Storage > Download

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/diannao/90546.shtml
繁體地址,請注明出處:http://hk.pswp.cn/diannao/90546.shtml
英文地址,請注明出處:http://en.pswp.cn/diannao/90546.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

從互聯網電腦遷移Dify到內網部署Dify方法記錄

一、在互聯網電腦上準備遷移文件1. 保存 Docker 鏡像# 獲取所有 Dify 相關鏡像&#xff08;根據實際容器名調整&#xff09; docker ps --filter "namedify" --format "{{.Image}}" | sort -u > dify-images.list# 保存鏡像為 .tar 文件 docker save $(…

【EGSR2025】材質+擴散模型+神經網絡相關論文整理隨筆(一)

MatSwap: Light-aware material transfers in images介紹任務&#xff1a;輸入一張拍攝圖像、示例材質紋理圖像&#xff08;這里跟BRDF無關&#xff0c;通常我們講到材質一般指的是SVBRDF&#xff0c;但是這里的材質指的只是紋理&#xff09;、用戶為拍攝圖像指定的遮罩區域&am…

餓了么el-upload上傳組件報錯:TypeError: ***.upload.addEventListener is not a function

在本地上傳沒有報這個錯誤&#xff0c;部署到服務器后會報這個錯誤&#xff0c;一開始以為是服務器配置等什么原因&#xff0c;但是一想這個報錯應該還是在前端&#xff0c;接口都還沒請求&#xff0c;不可能到后臺去&#xff0c;后面搜了好幾個AI也沒有找到想要的答案或解決方…

淘寶直播與開源鏈動2+1模式AI智能名片S2B2C商城小程序的融合發展研究

摘要&#xff1a;本文聚焦于淘寶直播這一以“網紅”內容為主的社交電商平臺&#xff0c;深入分析其特點與流量入口優勢。同時&#xff0c;引入開源鏈動21模式AI智能名片S2B2C商城小程序這一新興概念&#xff0c;探討二者融合的可能性與潛在價值。通過分析融合過程中的技術、市場…

【macos用鏡像站體驗】Claude Code入門使用教程和常用命令

一、下載安裝nodejs # macOS 用戶安裝nodejs brew update brew install node二、安裝官方Claude Code # 安裝 Claude Code npm install -g anthropic-ai/claude-code # 查看版本 claude --version三、正式使用&#xff08;國內鏡像站&#xff09; 今天發現的一個鏡像站&…

算法學習筆記:11.冒泡排序——從原理到實戰,涵蓋 LeetCode 與考研 408 例題

在排序算法的大家族中&#xff0c;冒泡排序是最基礎也最經典的算法之一。它的核心思想簡單易懂&#xff0c;通過重復地走訪待排序序列&#xff0c;一次比較兩個相鄰的元素&#xff0c;若它們的順序錯誤就把它們交換過來&#xff0c;直到沒有需要交換的元素為止。雖然冒泡排序的…

Linux小白學習基礎內容

記錄第一天重新學習2025/7/10 15&#xff1a;467/10 17&#xff1a;02這里面一個命令帶多個參數舉例&#xff08;多個參數之間用空格隔開&#xff09;ls&#xff08;命令&#xff09; ~ / /etc/&#xff08;參數&#xff09; :這里就是同時查看主機的家目錄&#xff0c;根目…

從零開始搭建深度學習大廈系列-2.卷積神經網絡基礎(5-9)

(1)本人挑戰手寫代碼驗證理論&#xff0c;獲得一些AI工具無法提供的收獲和思考&#xff0c;對于一些我無法回答的疑問請大家在評論區指教&#xff1b; (2)本系列文章有很多細節需要弄清楚&#xff0c;但是考慮到讀者的吸收情況和文章篇幅限制&#xff0c;選擇重點進行分享&…

【iOS設計模式】深入理解MVC架構 - 重構你的第一個App

目錄 一、MVC模式概述 二、創建Model層 1. 新建Person模型類 2. 實現Person類 三、重構ViewController 1. 修改ViewController.h 2. 重構ViewController.m 四、MVC組件詳解 1. Model&#xff08;Person類&#xff09; 2. View&#xff08;Storyboard中的UI元素&#x…

前端項目集成lint-staged

lint-staged (lint-staged) 這個插件可以只針對進入git暫存區中的代碼進行代碼格式檢查與修復&#xff0c;極大提升效率&#xff0c;避免掃描整個項目文件&#xff0c;代碼風格控制 eslint prettier stylelint 看這兩篇文章 前端項目vue3項目集成eslint9.x跟prettier 前端項…

李宏毅genai筆記:模型編輯

0 和post training的區別直接用post training的方法是有挑戰的&#xff0c;因為通常訓練資料只有一筆而且之后不管問什么問題&#xff0c;都有可能只是這個答案了1 模型編輯的評估方案 reliability——同樣的問題&#xff0c;需要是目標答案generalization——問題&#xff08;…

Oracle:union all和union區別

UNION ALL和UNION在Oracle中的主要區別體現在處理重復記錄、性能及結果排序上&#xff1a;處理重復記錄?UNION?&#xff1a;自動去除重復記錄&#xff0c;確保最終結果唯一。?UNION ALL?&#xff1a;保留所有記錄&#xff0c;包括完全重復的行。性能表現?UNION?&#xff…

[C#/.NET] 內網開發中如何使用 System.Text.Json 實現 JSON 解析(無需 NuGet)

在實際的企業開發環境中&#xff0c;尤其是內網隔離環境&#xff0c;開發人員經常面臨無法使用 NuGet 安裝外部包的問題。對于基于 .NET Framework 4.8 的應用&#xff0c;JSON 解析是一個常見的需求&#xff0c;但初始項目中往往未包含任何 JSON 處理相關的程序集。這時&#…

JVM(Java 虛擬機)的介紹

JVM原理JVM 核心架構與工作流程1. 類加載機制&#xff08;Class Loading&#xff09;2. 運行時數據區&#xff08;Runtime Data Areas&#xff09;堆&#xff08;Heap&#xff09;方法區&#xff08;Method Area&#xff09;:元空間&#xff08;Metaspace&#xff09;公共區域虛…

Qt 信號槽的擴展知識

Qt 信號槽的擴展知識一、信號與槽的重載Qt信號與槽的重載問題注意事項示例場景二、一個信號連接多個槽1、直接連接多個槽2、使用lambda表達式連接3、連接順序控制4、斷開特定連接5、自動連接方式三、 多個信號連接一個槽基本連接語法使用QSignalMapper區分信號源&#xff08;Qt…

鏈表算法之【合并兩個有序鏈表】

目錄 LeetCode-21題 LeetCode-21題 將兩個升序鏈表合并成一個新的升序鏈表并返回 class Solution {public ListNode mergeTwoLists(ListNode list1, ListNode list2) {if (list1 null)return list2;if (list2 null)return list1;ListNode dummyHead new ListNode();ListN…

Linux - firewall 防火墻

&#x1f525; 什么是 firewalld&#xff1f;firewalld 是一個動態管理防火墻的守護進程&#xff08;daemon&#xff09;&#xff0c;它提供了一個 D-Bus 接口來管理系統或用戶的防火墻規則。與傳統的靜態 iptables 不同&#xff0c;firewalld 支持&#xff1a;區域&#xff08…

【GESP】C++二級真題 luogu-B4356 [GESP202506 二級] 數三角形

GESP C二級&#xff0c;2025年6月真題&#xff0c;多重循環&#xff0c;難度★?☆☆☆。 題目題解詳見&#xff1a;【GESP】C二級真題 luogu-B4356 [GESP202506 二級] 數三角形 | OneCoder 【GESP】C二級真題 luogu-B4356 [GESP202506 二級] 數三角形 | OneCoderGESP C二級&…

遙感影像巖性分類:基于CNN與CNN-EL集成學習的深度學習方法

遙感影像巖性分類&#xff1a;基于CNN與CNN-EL集成學習的深度學習方法 大家好&#xff0c;我是微學AI&#xff0c;今天給大家介紹一下遙感影像巖性分類&#xff1a;基于CNN與CNN-EL集成學習的深度學習方法。該方法充分利用了多源遙感數據的光譜和空間信息&#xff0c;同時結合…

【STM32 學習筆記】SPI通信協議

SPI通信協議 SPI協議是由摩托羅拉公司提出的通訊協議(Serial Peripheral Interface)&#xff0c;即串行外圍設備接口&#xff0c; 是一種高速全雙工的通信總線。它被廣泛地使用在ADC、LCD等設備與MCU間&#xff0c;要求通訊速率較高的場合。 ??學習本章時&#xff0c;可與I2C…