Mobile application development is a process that requires testing on real devices. Emulators are convenient for initial debugging, but they will not show how the application will behave with unique characteristics: screen resolution, OS version, chipset performance or firmware features from Android Studio are convenient for initial debugging, but they will not show how the application will behave on physical device with unique characteristics: screen resolution, OS version, chipset performance or firmware features from Samsung, Xiaomi or Google Pixel. Without testing on a real gadget, the risk of releasing a โcrudeโ product with bugs increases manifold.
This article will help both novice developers and experienced users who want to install .apkfile outside Google Play. We will analyze all current methods - from classic installation via USB debugging to wireless methods using Wi-Fi ADB. We will pay special attention to typical errors (for example, INSTALL_FAILED_TEST_ONLY or INSTALL_PARSE_FAILED_MANIFEST_MALFORMED) and ways to work around them. If you have never connected a smartphone to a PC for debugging, donโt worry: the instructions are adapted for beginners, with explanations of each step.
1. Preparing the device: enable developer mode
Before installing the application on a real device, you need to activate developer mode and allow USB debugging. This process differs slightly depending on the version Android and shell manufacturer (for example, MIUI y Xiaomi or One UI y Samsung). The general scheme is as follows:
Open
Settings โ About phone(orAbout tablet).Find the item
Build number(sometimes hidden inSoftware information).Tap on it 7 times in a row - a notification โYou have become developer!โ.
After this, a new section will appear in the main settings For developers (or Developer Options). developer
- ๐ง Enable USB debugging (switch at the top of the list).
- ๐ Allow
Installation from unknown sources(path:Settings โ Applications โ Special access). - ๐ฑ For Xiaomi: additionally activate
OEM unlocking(if you plan to flash custom ROMs).
โ ๏ธ Attention: On devices with Android 11+ after connecting to a PC, a request for debugging permission will appear. Confirm it by checking the โAlways allow from this computerโ checkbox - this will eliminate repeated requests.
Samsung Galaxy and some other models may require installation USB drivers on PC. They can be downloaded from the manufacturerโs official website or via SDK Manager v Android Studio. If the device is not detected, check the connection in Windows Device Manager โthere should be no exclamation marks next to ADB Interface.
2. Installation via ADB: step-by-step guide
ADB (Android Debug Bridge) is a universal tool for interacting with the device via the command line. To install .apk via ADB, follow these steps:
Download Platform Tools (included Android SDK) from official website and unpack the archive into a convenient folder (for example,
C:\adb).Connect the device to the PC via a USB cable (preferably original).
Open the command line (
Win + Rโ entercmd) and go to the folder with ADB:cd C:\adbCheck the device connection with the command:
adb devicesThe serial number of your device should appear in response. If the list is empty, check the drivers and debugging permissions.
Install the application:
adb install path_to_file.apkFor example:
adb install C:\Downloads\myapp-debug.apk.
If the installation was successful, a message will appear in the command line. To reinstall, use the flag Success. To reinstall, use the flag -r:
adb install -r myapp.apk
โ ๏ธ Attention: On some devices (for example, Huawei or Honor) additional permissionInstall via USBin the developer settings. Without it, ADB will generate an errorINSTALL_FAILED_USER_RESTRICTED.
Connect the device with the original cable|Enable USB debugging in the settings|Check the device visibility with the command `adb devices`|Download the APK to an accessible folder|Run CMD as administrator-->
3. Wireless installation: Wi-Fi ADB
If you are tired of fiddling with cables, you can connect to the device via Wi-Fi. This method works on Android 11+ and requires preliminary configuration via USB (only for the first connection).
Connect the device to the PC via USB and do:
adb tcpip 5555Disconnect the cable and find the local IP address of the device in the Wi-Fi settings (for example,
192.168.1.100).Connect via Wi-Fi:
adb connect 192.168.1.100:5555Make sure that the device appears in the list:
adb devicesNow you can install APK in the same way as via USB:
adb install myapp.apk
Advantages of the method:
- ๐ No dependence on the USB cable (relevant for devices with damaged port).
- ๐ถ Can be tested on several devices simultaneously.
- ๐ Quick deployment of updates without a physical connection.
Disadvantages:
- ๐ข Data transfer speed is lower than via USB.
- ๐ The device must be on the same network as the PC.
- ๐ On some firmware (for example, MIUI) Wi-Fi ADB may turn off after a reboot.
If Wi-Fi ADB stops working after rebooting the device, repeat the command `adb tcpip 5555` via USB. Some firmware resets the port when turned off.
4. Installation without a PC: via a file manager or browser
You donโt always have a computer at hand. In this case, .apkthe file can be downloaded directly to the device and installed manually. data-i="143">Method 1: via browser
Method 1: via browser
Open a browser (for example, Chrome) and go to the site with the APK (for example, APKMirror).
Download the file. The browser will warn you about potential danger - confirm the download.
After downloading, tap on the notification or find the file in the folder
Downloads.Click โInstallโ and confirm permissions.
Method 2: through the file manager
If the APK is already on the device (for example, copied via Google Drive or Telegram):
Open the file manager (for example, Files by Google or Mi File Manager).
Find the file and click on it.
.apk-file and tap on it.In the window that appears, click โInstallโ (you may need to allow installation from this source).
โ ๏ธ Attention: Installation of APK from unknown sources is blocked by default. To unlock it for a specific file manager, go. in Settings โ Applications โ Special access โ Installation of unknown applications and select your manager.
On devices with Android 8+ the system remembers permissions for each source separately. For example, if you allowed installation for Chrome, this does not mean that Files by Google will also be able to install the APK without additional confirmation.
| Installation method | PC required | Speed | Difficulty | Suitable for |
|---|---|---|---|---|
| ADB via USB | โ Yes | โก Fast | โญโญ (average) | Developers, debugging |
| Wi-Fi ADB | โ Yes (for setup only) | ๐ข Slower USB | โญโญโญ (high) | Testing without cable |
| File manager | โ No | โก Fast | โญ (low) | Users without a PC |
| Browser | โ No | ๐ข Depends on the Internet | โญ (low) | Quick installation |
5. Typical errors and their solutions
When installing an APK on a real device, you may encounter errors. Let's look at the most common ones and how to fix them:
Error: INSTALL_FAILED_INSUFFICIENT_STORAGE
Cause: there is not enough space on the device or in the partition /data.
- ๐งน Clear the application cache in
Settings โ Storage. - ๐๏ธ Delete unnecessary files or transfer them to an SD card.
- ๐ง For developers: check the size
android:installLocationinAndroidManifest.xml.
Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
Reason: corrupted AndroidManifest.xml or incompatible version Android.
- ๐ Rebuild the APK with the correct settings in Android Studio.
- ๐ Check
minSdkVersionitargetSdkVersioninbuild.gradle.
Error: INSTALL_FAILED_TEST_ONLY
Reason: APK was built as a test (android:testOnly="true").
- ๐ ๏ธ Remove the flag
testOnlyinAndroidManifest.xml. - ๐ Rebuild the project in mode
release.
Error: ADB: device unauthorized
Reason: the device does not trust this PC.
- ๐ Connect the device via USB and confirm the debugging request on the smartphone screen.
- ๐ Restart the ADB service:
adb kill-serverโadb start-server.
If the error persists, try:
- ๐ Use a different USB cable (sometimes the problem is a damaged wire).
- ๐ Restart the device and PC.
- ๐ ๏ธ Update Platform Tools up to the latest version.
What to do if ADB does not see the device?
1. Check if USB debugging is enabled and access is allowed for this PC.
2. Make sure that the drivers are installed (there should be no unknown devices in the Device Manager).
3. Try another USB port (preferably USB 2.0, since USB 3.0 sometimes conflicts with ADB).
4. Execute the commands:
adb kill-server
adb start-server
5. If you use macOS/Linux, check the rights to the port: lsusb and sudo chmod 777 /dev/bus/usb// (temporary solution).
6. Features for different manufacturers
Firmware from different manufacturers may introduce their own limitations. Let's consider the nuances for popular brands:
Xiaomi (MIUI)
- ๐ By default, APK installation from unknown sources is blocked. Permission must be given for each application separately.
- ๐ After updating MIUI, the permission for
Installation via USB may be reset. - ๐ก๏ธ On some models (Redmi Note 10, POCO X3) you need to disable
MIUI Protectionin the security settings.
Samsung (One UI)
- ๐ ADB may require installation Samsung USB Driver for Mobile Phones.
- ๐ฑ On devices with Knox (for example, Galaxy S22) some system restrictions cannot be bypassed without root access.
- ๐ After updating the firmware, you may need to re-enable USB debugging.
Google Pixel
- โก The cleanest implementation of ADB, minimum connection problems.
- ๐ง On Pixel 6/7 c Android 13+ may require additional permission for wireless debugging.
- ๐ฆ Supports
Fastbootfor flashing custom recovery (for example, TWRP).
Huawei/Honor
- ๐ซ On new devices (after 2019) it may be blocked
OEM Unlock. - ๐ To install APK via ADB, you need permission
Install via USBin the developer settings. - ๐ On devices without Google Mobile Services (for example, Huawei P40) you will have to use AppGallery or manual installation.
โ ๏ธ Attention: Firmware from manufacturers can change the location of menu items. For example, in MIUI 14 the path to the developer settings is different from MIUI 12. If you donโt find the section you need, use the search in settings (magnifying glass icon in the upper right corner).
7. Alternative methods: cloud services and third-party tools If standard methods are not suitable, you can use alternative solutions: data-i="264">or
If standard methods are not suitable, you can use alternative solutions:
๐ฅ๏ธ Cloud services for testing
- Firebase App Distribution โ allows you to upload an APK to a private channel and install it via a link on test devices.
- BrowserStack or Sauce Labs โplatforms for testing on real devices in the cloud (paid, but there are trial periods).
- APKMirror Installer โapplication for installing APKs with automatic updates.
๐ ๏ธ Third-party tools
- Scrcpy โnot only mirrors the screen on a PC, but also allows you to drag an APK directly into the window for installation.
- SideQuest (for Oculus Quest, but also works with regular Android devices) - simplified APK installation via Wi-Fi.
- Bugjaeger - mobile application for ADB commands without a PC (requires root on some devices).
The advantage of cloud services is the ability to test on dozens of devices simultaneously, without physically having them. The disadvantage is the limitations of free plans and possible delays in data transfer.
ADB or a file manager is suitable for quickly installing an APK on one device. For mass testing on different devices, it is better to use cloud services like Firebase.
8. Security: How to Avoid Malicious APKs
Installing applications from unknown sources always carries risks. Here's how to minimize threats:
- ๐ก๏ธ Check the APK hash. Compare
SHA-256the file with the official one (you can check it through VirusTotal orcertutil -hashfilein Windows). - ๐ Use antivirus software. Before installation, scan the file in Dr.Web or Kaspersky Mobile.
- ๐ Read permissions. If the Flashlight application requests access to SMS or geolocation is suspicious.
- ๐ Download APK only from trusted sources:
- APKMirror (checks developer signatures).
- GitHub (for open source software).
- Official sites developers.
If, after installation, the application behaves suspiciously (for example, it shows ads out of context or heats up the device), immediately:
Uninstall it through
Settings โ Applications.Check your device for viruses (for example, via Malwarebytes).
If you suspect a rootkit, perform a factory reset.
โ ๏ธ Attention: On devices with Android 10+ the system limits the background activity of applications installed outside Google PlayThis can lead to sudden stops of services. To avoid problems, add the application to optimization exceptions. batteries (Settings โ Battery โ Battery optimization).
FAQ: Frequently asked questions
Can I install an APK on Android without enabling developer mode?
Yes, but with limitations. You can:
- Download the APK through a browser and open it in a file manager (you must allow installation from unknown sources).
- Use cloud services like Firebase App Distributionif you are a developer.
However, for debugging via ADB or installing system applications developer mode is required.
Why does ADB write "no devices/emulators found" even though the device is connected?
The reasons may be as follows:
- ๐ Not the original USB cable (try another one).
- ๐ฅ๏ธ Drivers are not installed (download Google USB Driver or drivers from the manufacturer).
- ๐ USB debugging is not enabled or permission is not given for this PC.
- ๐ USB 3.0 port (try USB 2.0).
- ๐ ๏ธ ADB service is not running (run
adb start-server).
Also check if the device is recognized in Windows Device Manager as Android ADB Interface.
How to install APK on Android TV or Fire TV Stick?
For Android TV or Amazon Fire TV Stick the process is similar, but there are nuances:
Enable
ADB debuggingin the settings (Settings โ Device Preferences โ About โ Build- tap 7 times, then return toDeveloper options).Connect via Wi-Fi:
adb connect IP_devices:5555Use
adb installor third-party launchers like Send Files to TV to transfer APK.
For Fire TV Stick you may need to disable Amazon restrictions:
adb shell settings put global install_non_market_apps 1
Is it possible to rollback installed via ADB application?
Yes, there are several ways:
- ๐ฑ Through device settings:
Settings โ Applications โ Application name โ Delete. - ๐ฅ๏ธ Via ADB:
adb uninstall com.example.package
adb shell pm uninstall -k --user 0 com.example.package
To find out the package name, use:
adb shell pm list packages | grep "keyword"
How to test an application on a real device without physical access to him?
If you do not have a physical device, consider the following options:
- ๐ฅ๏ธ Cloud farms: BrowserStack, Sauce Labs, Firebase Test Lab (paid, but there are free minutes).
- ๐ค Remote devices: Services like AWS Device Farm provide access to real devices over the network.
- ๐ฑ Device rental: Some platforms (for example, TestFlight for iOS or Beta by Crashlytics) allow you to distribute builds among testers.
- ๐ฅ๏ธ Emulators with root access: Genymotion or Bluestacks with custom images.
For full testing, it is better to combine cloud services and 1-2 physical devices of different manufacturers.