Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release thay vì aosp-main để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Trình duyệt hỗ trợ WebUSB, chẳng hạn như Chrome hoặc Edge 79 trở lên
Bật kết nối USB
Trước khi chạy Android trên một thiết bị, bạn phải bật kết nối USB:
Bật tính năng mở khoá OEM và gỡ lỗi qua USB trong tuỳ chọn cho nhà phát triển:
Trong ứng dụng Cài đặt, hãy nhấn vào Giới thiệu về điện thoại.
Nhấn vào Số bản dựng 7 lần.
Khi bạn thấy thông báo Bạn đã là nhà phát triển!, hãy nhấn vào <-.
Nhấn vào Hệ thống, rồi nhấn vào Tuỳ chọn cho nhà phát triển.
Bật tính năng mở khoá OEM và gỡ lỗi qua USB. Nếu không thể mở khoá OEM, hãy kết nối với Internet để thiết bị có thể đăng ký. Nếu cách đó vẫn không hiệu quả, bạn có thể buộc kiểm tra bằng cách: Trong ứng dụng Điện thoại, hãy nhập *#*#CHECKIN#*#* (*#*#2432546#*#*) (không cần SIM). Sau khi nhập số (không cần nhấn nút gọi), văn bản sẽ biến mất và thông báo thành công sẽ xuất hiện.
Nếu bạn vẫn không thể mở khoá bằng OEM, thì có thể nhà mạng của bạn đã khoá SIM trên thiết bị và bạn không thể mở khoá trình tải khởi động.
Kết nối thiết bị với cổng USB trên máy trạm.
Cài đặt ROM cho thiết bị
Nếu bạn đang chạy Cầu gỡ lỗi Android (adb) trên máy, hãy dừng dịch vụ adb trước khi tiếp tục để dịch vụ này không ảnh hưởng đến quá trình cài đặt ROM. Để dừng adb, hãy chạy:
adbkill-server
Trong trình duyệt trên máy trạm phát triển, hãy mở flash.android.com. Trang Chào mừng sẽ xuất hiện.
Nhấp vào Allow ADB access (Cho phép truy cập ADB) để cho phép công cụ này giao tiếp với thiết bị thử nghiệm thông qua adb.
Nhấp vào Thêm thiết bị mới.
Chọn thiết bị của bạn trong danh sách rồi nhấp vào Connect (Kết nối). Danh sách này có thể không chứa tên đầy đủ của thiết bị.
Trên màn hình thiết bị, hãy chọn Luôn cho phép từ máy tính này rồi nhấp vào OK để chấp nhận kết nối gỡ lỗi qua USB.
Chọn thiết bị đã kết nối trong trình duyệt.
Tìm và chọn bản dựng của bạn trong danh sách. Bạn cũng có thể chọn các tuỳ chọn, chẳng hạn như xoá sạch thiết bị hoặc buộc cài đặt ROM cho tất cả các phân vùng.
Để bắt đầu cài đặt ROM, hãy nhấp vào Install (Cài đặt). Thiết bị khởi động lại và chuyển sang chế độ khởi động nhanh.
Sau khi thông báo Flash Complete (Đã hoàn tất quá trình cài đặt ROM) xuất hiện, hãy rút cáp USB khỏi thiết bị.
Thiết bị Flash không thể khởi động
Nếu thiết bị không thể khởi động bình thường, bạn có thể không thể cài đặt ROM cho thiết bị bằng các hướng dẫn trước đó. Thay vào đó, bạn có thể thử cài đặt ROM bằng tính năng
Fastboot.
Để thực hiện việc này, trước tiên, bạn cần khởi động thiết bị của mình vào chế độ Khởi động nhanh bằng cách sử dụng tổ hợp phím:
Xác định tổ hợp phím cho thiết bị của bạn. Để biết bảng tổ hợp phím khởi động nhanh, hãy xem phần Tổ hợp phím khởi động nhanh.
Tắt thiết bị.
Bật thiết bị và ngay lập tức giữ tổ hợp phím cho thiết bị (được xác định ở bước 1).
Đôi khi, các thiết bị Android gặp sự cố khi giao tiếp qua một số cổng USB hoặc trung tâm nhất định do lưu lượng dữ liệu cao. Cách giải quyết lỗi chuyển:
Không sử dụng bộ chia USB. Điều này bao gồm cả các kết nối thông qua màn hình.
Không sử dụng cáp nối dài hoặc bộ chuyển đổi USB nếu có thể.
Thử một cổng USB khác. Cổng sau thường đáng tin cậy hơn cổng trước.
Nếu bạn đang sử dụng cổng USB C, hãy thử dùng cổng USB A.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Flash with Android Flash Tool\n\n[Android Flash Tool](https://flash.android.com/)\nis a web-based tool that lets you flash a pre built Android build to your\ndevice for development and testing.\n| **Note:** If you need to flash and test your own AOSP changes, refer to [Flash your device with Fastboot](/docs/setup/test/running).\n\nAndroid Flash Tool supports these devices:\n\n- Pixel 2 and newer\n- [DragonBoard RB3 (also known as db845c)](https://wiki.linaro.org/AOSP/db845c)\n- [HiKey 960](https://www.96boards.org/product/hikey960/)\n- [HiKey](https://www.96boards.org/product/hikey/)\n\nMeet requirements\n-----------------\n\nTo run the Android Flash Tool, you must meet these requirements:\n\n- [Hardware requirements](/docs/setup/start/requirements#hardware-requirements)\n- A browser supporting [WebUSB](https://caniuse.com/#search=Webusb), such as [Chrome](https://www.google.com/chrome/) or Edge 79+\n\nEnable your USB connection\n--------------------------\n\nBefore running Android on a device, you must enable your USB connection:\n\n1. Enable OEM unlocking and USB debugging in the developer options:\n\n 1. In the Settings app, tap **About phone**.\n 2. Tap **Build number** seven times.\n 3. When you see the message **You are now a developer!** , tap **\\\u003c-**.\n 4. Tap **System** , then tap **Developer options**.\n 5. Enable **OEM unlocking** and **USB debugging** . If OEM unlocking is unavailable, connect to the internet so the device can check in. If that still doesn't work, you can force a check in: In the Dialer app, enter **\\*#\\*#CHECKIN#\\*#\\*** (\\*#\\*#2432546#\\*#\\*) (no SIM required). After entering the number (no need to press call), the text disappears and a success notification appears.\n\n If OEM unlocking remains unavailable, your device might be SIM locked by\n your carrier and the bootloader can't be unlocked.\n2. Connect your device to a USB port on your workstation.\n\nFlash your device\n-----------------\n\n1. If you have\n [Android Debug Bridge (adb)](https://developer.android.com/studio/command-line/adb)\n running on your machine, stop the adb service before proceeding so that\n it doesn't interfere with the flashing process. To stop adb, run:\n\n adb kill-server\n\n2. In a browser on your development workstation, open\n [flash.android.com](https://flash.android.com/). The Welcome page appears.\n\n3. Click **Allow ADB access** to allow the tool to communicate with your test\n device through adb.\n\n4. Click **Add new device**.\n\n5. Select your device from the list and click **Connect**. This list might\n not contain the full device name.\n\n6. On your device's screen, select **Always allow from this computer**\n and click **OK** to accept the USB debugging connection.\n\n7. Select the connected device in your browser.\n\n8. Search for and select your build from the list. You can also select\n options, such as wiping the device or force flashing all partitions.\n\n9. To start flashing, click **Install**. The device reboots and enters fastboot\n mode.\n\n10. After **Flash Complete** appears, disconnect the device from the USB cable.\n\n| **Note:** If this is the first time flashing this device from this development workstation, the workstation loses the connection to the device and asks you to find it again. The next time you flash the same device on this workstation, you won't see the request to find the device. After reconnecting, the flashing resumes by downloading the images and performing all the required steps.\n\n### Flash devices unable to boot\n\nIf your device is unable to boot normally, you might not be able to flash your\ndevice using the previous instructions. Instead, you can try flashing with\nFastboot.\n\nTo do this, you need to first boot your device into Fastboot mode by using a\nkey combination:\n\n1. Determine the key combination for your device. For a table of Fastboot key combinations, see [Fastboot key combinations](/docs/setup/reference/fastboot-keys).\n2. Turn the device off.\n3. Turn the device on and immediately hold down the key combination for your device (determined in step 1).\n\nOnce your device is in Fastboot mode, open\n[flash.android.com](https://flash.android.com/) and follow the earlier\n[flashing instructions](#flashing-your-device), ignoring the steps related to\nADB.\n\n### Resolve USB transfer errors\n\nSometimes Android devices have trouble communicating through certain USB ports\nor hubs due to the high throughput of data. To resolve transfer errors:\n\n- Don't use USB hubs. This includes connections through monitors.\n- Don't use USB extension cables or adapters if possible.\n- Try a different USB port. Rear ports are often more reliable than front ones.\n- If you're using a USB C port, try a USB A port instead.\n\nReturn Pixel to public build\n----------------------------\n\nIf you want to return your Pixel device to a public build, use the\n[Android Flash Tool back-to-public option](https://flash.android.com/back-to-public)."]]