
Đăng ngày 14 tháng 4, 2023, 10:30 AM EDT
Dennis Murimi đam mê tech, đặc biệt Android, từ thời Huawei IDEOS (khoảng 2010).
Trước MUO, Dennis viết TalkHelper 2019-2022 xây authority cho software lineup. Bao gồm listicle (Video Conversion), how-to guide, review software sâu (Multimedia) — tổng hơn 1000 bài.
Trên MUO, anh giải mã tính năng Android phức tạp, troubleshoot vấn đề thường gặp, cập nhật trend mới hệ sinh thái Android. Dennis thích giúp user khai thác tối đa thiết bị và navigate thế giới Android ever-evolving.
Thời gian rảnh, anh maintain Android custom ROM trên blog, GitHub, XDA.
ADB (Android Debug Bridge) là tiện ích command-line mạnh mẽ giúp giao tiếp với Android device qua lệnh. Với ADB, bạn cài app, gỡ bloatware, disable system app, cấp special permission cho app trên Android, và hơn.
Thông thường, chúng ta quen chạy ADB command qua cáp USB trên máy tính. May mắn thay, ngay cả không có PC, bạn có standalone Android app cho cùng chức năng on the go. Bài viết này chỉ cách dùng ADB không máy tính.
Chạy Lệnh ADB Dùng App ADB Shell
Trước khi bắt đầu, đảm bảo device chạy Android 11 trở lên. Nếu version thấp hơn, check update available và apply.
Hướng dẫn này dùng app ADB Shell, miễn phí trên Play Store.
Tải xuống: ADB Shell (Free, in-app purchases available)
Bước 1: Bật Developer Options Trên Android Device
Để dùng ADB trên Android device, phải bật Developer Options trước. Làm: launch Settings app, mở About phone, cuộn xuống tìm Build number entry, tap Build number bảy lần cho đến confirmation message.
Bước 2: Bật Wireless Debugging
Với Developer Options enabled, vào Settings > System > Developer options, cuộn đến Debugging section, bật toggle Wireless debugging. Nếu pop-up, tap Allow.
Trên OnePlus device, phải bật Wireless ADB Debugging nếu có.
Bước 3: Cài Đặt Và Thiết Lập App ADB Shell
Giờ, cài ADB Shell từ Google Play Store và launch. Lúc đầu, app yêu cầu nhập IP address và Port device connecting. Vì làm việc với Android 11+, cần bật toggle Pair Mode cũng.
Vậy lấy IP address và Port details ở đâu?
- Đầu tiên, vào Settings > System > Developer options.
- Cuộn xuống Debugging section, tap entry Wireless debugging, chọn Pair device with pairing code.
- Trên dialog Pair with device mở ra, tìm IP address và Port details. Cũng có Wi-Fi pairing code 6 chữ số, cần sau.
Bước 4: Mở ADB Shell Và Wireless Debugging Chế Độ Split Screen
Khi Pair with device pop-up đóng, pairing code và port details thay đổi.
Để tránh details thay đổi khi pairing, mở ADB Shell app và trang Wireless Debugging chế độ split screen. Cho chạy 2 app Android cùng lúc trên cùng màn hình. Vì hướng dẫn khác nhau trên device, xem hướng dẫn dùng split screen Android để setup nếu không chắc.
Bước 5: Nhập IP Address Và Port
Khi cấu hình split screen xong, giờ pair Android device cho wireless ADB.
Lúc này, Pair with device pop-up đã thoát, cần mở lại Pair device with pairing code trên trang Wireless debugging. Nhập IP address hiển thị vào input box ADB Shell app phù hợp, làm tương tự Port 5-digit tách IP address bằng dấu hai chấm. Nhớ bật toggle Pair Mode.
Bước 6: Nhập Wi-Fi Pairing Code
Tiếp, click nút Pair. Tap Cancel nếu pop-up muốn dẫn help page.
Trên màn hình kết quả, thấy terminal window với prompt yêu cầu Enter pairing code. Nhập Wi-Fi pairing code 6-digit từ Pair with device pop-up và bấm Enter bên phải input box.
Giờ bạn ready to go. Trong ADB Shell, gõ lệnh ls Enter confirm device paired successfully. Lệnh liệt kê folder và file trong internal storage Android device.
Bước 7: Dùng ADB Trên Điện Thoại
Giờ gõ common ADB commands trong app. Ví dụ, disable app như Facebook, chạy lệnh sau với package name app.
pm disable-user --user 0 com.facebook.katana
Hoặc nếu cần cấp permission cho app, hướng dẫn cấp permission dùng ADB trên Android siêu hữu ích.
App Khác Dùng ADB Không Máy Tính
ADB Shell là một trong vài app cho dùng ADB trên Android không máy tính. Nếu muốn thử app khác, xem các tùy chọn.
1. LADB
LADB có built-in ADB server giúp maximize Wireless ADB Debugging feature. Cũng dựa trên split screen setup như ADB Shell. Dù app trả phí Play Store, có sẵn free, open-source trên LADB GitHub nếu compile code yourself.
Về functionality, chạy ADB command hassle-free và vẫn có help section nếu stuck. Cụ thể, LADB giúp tweak hidden Android settings và gỡ app không cần thiết không cần root hoặc máy tính.
Thêm vào đó, app tự re-establish connection với device previously connected không cần pair lại.
Tải xuống: LADB ($2.99)
2. Bugjaeger Mobile ADB
Bugjaeger Mobile ADB là app feature-laden blend ADB commands qua USB và Wi-Fi. Presents special feature như screen mirroring, screenshot, chạy ADB command trên remote target device, kết nối 2 Android device qua OTG, hơn.
Khác app khác yêu cầu nhập connection details, Bugjaeger cho search và connect ADB device detected trên network.
Để experience effortless, app presents nhiều one-click commands tránh type afresh. Nếu bạn power Android user, đây comprehensive toolbox, không quên option tạo custom command shortcuts. Còn nhiều feature explore trong premium version.
Tải xuống: Bugjaeger Mobile ADB (Free, premium version available)
3. Remote ADB Shell
Như tên gợi ý, Remote ADB Shell giúp chạy ADB command control device khác. Phù hợp Android 10 và dưới dùng old adb tcpip connection method. Cơ bản, chỉ cần IP address target device và default port 5555 connect.
Tốt hơn, Remote ADB Shell hỗ trợ simultaneous devices và keep connection alive ngay khi Android app ở background. Thêm vào đó, app maintain 15-command history reuse để tiết kiệm time và effort.
Tải xuống: Remote ADB Shell (Free)
Dùng ADB Trực Tiếp Trên Điện Thoại
Thực tế bạn có Android app sẵn sàng chạy ADB command không máy tính mang lại convenience level mới. Bên cạnh, không cần root Android device để tận dụng tối đa app này. Wireless debugging cũng nghĩa không lo cáp USB hỏng.
Giờ, chọn app phù hợp nhất và làm go-to option khi cần chạy ADB command không máy tính.