If you’ve use an Android phone or tablet for a while now, you may have come across the term “sideloading.” Sideloading is basically just moving a file (often an app) from your computer to your Android device, which sounds like a simple process, but it can be confusing for someone who’s never done it before.
ADB Sideload is a different ADB Mode that lets you push and install flashable zip package with just one command from your computer. ADB Sideload might not be a huge concern to an average user but it is a huge time-saver for ROM developers. Android is the widely used mobile OS and as a result, many.
So today we’re going to take a look at why you might want to sideload apps or other files to your Android device, and how exactly you can do it.
What Files Can You Sideload?
Since sideloading is just a process of moving files from one device to another, it can be done with nearly anything. The most common use case is probably apps, but lots of other file types can be moved as well.
Apps
Android apps come as APK files that end in “.apk”, similar to how installable files on Windows come as EXE files that end in “.exe”. So to get started, you’ll need to find an APK. We’ve detailed in the past why you might want to download an APK and where to find themHow to Download an APK from Google Play to Bypass RestrictionsHow to Download an APK from Google Play to Bypass RestrictionsNeed to get your hands on the installable APK file for an app from Google Play? We got you covered.Read More, but my best advice would just be to do a quick Google search (“App name APK”) or check APKMirror.
*opens playstore
This item is not available in your country ![]()
K.
*opens apkmirror
You were saying fam?
— Obafemi Onwochei (@TheGrandVezir) April 29, 2016
APKMirror has basically all the free apps on the Play Store , but you won’t find paid apps since that would be piracy. Pirating apps on AndroidPiracy On Android: How Bad Is It Really?Piracy On Android: How Bad Is It Really?Android is notorious for its rampant piracy, so we investigate exactly how bad it is.Read More is not only bad for developers and the community as a whole, but it opens you up to the possibility of viruses or malwareMalware on Android: The 5 Types You Really Need to Know AboutMalware on Android: The 5 Types You Really Need to Know AboutMalware can affect mobile as well as desktop devices. But don't be afraid: a bit of knowledge and the right precautions can protect you from threats like ransomware and sextortion scams.Read More. Because of this, you may find other sites hosting APKs, but be wary of them and exercise caution.
It’s also possible to extract your own apps from one device and move them to anotherGot An Older Android Device? How To Extract And Install An Android AppGot An Older Android Device? How To Extract And Install An Android AppAnyone with an older device, or an interest in the Android operating system's file structure, will want to know the manual method.Read More, which is the safest route to go if you have the means.
Music, Podcasts, eBooks, Movies, or TV shows
Nowadays, smartphones are much more than just phones. They can be eReaders, MP3 players, and TVs all wrapped into one. That means you can load virtually any kind of media onto your Android device and enjoy it on the go.
If you have DRM-free mediaWhat Is DRM & Why Does It Exist If It's So Evil? [MakeUseOf Explains]What Is DRM & Why Does It Exist If It's So Evil? [MakeUseOf Explains]Digital Rights Management is the latest evolution of copy protection. It’s the biggest cause of user frustration today, but is it justified? Is DRM a necessary evil in this digital age, or is the model..Read More on your computer, it can be moved over and enjoyed on your Android device (or you can break the DRM on your videosRemove DRM From iTunes Videos Quickly And Easily With M4VGearRemove DRM From iTunes Videos Quickly And Easily With M4VGearM4VGear simply takes DRM videos downloaded from iTunes and makes them DRM-freeRead More or even on your Kindle eBooksHow To Break The DRM On Kindle eBooks So You Can Enjoy Them AnywhereHow To Break The DRM On Kindle eBooks So You Can Enjoy Them AnywhereWhen you pay Amazon some money for a Kindle eBook, you probably think it’s yours now. I mean, you paid some money, you got some content, and now you have it, just like any other..Read More). For best results, though, you’ll need an app for consuming those things once on your device:
Custom ROMs or Mods
You’re most likely to run into the term sideloading if you’ve been tweaking or rooting your Android deviceWhat Is Rooting? What Are Custom ROMs? Learn Android LingoWhat Is Rooting? What Are Custom ROMs? Learn Android LingoEver had a question about your Android device, but the answer had a bunch of words in it that you didn't understand? Let us break down the confusing Android lingo for you.Read More. In this case, sideloading is extremely useful for moving files onto your phone that you’ll later need to use in your custom recoveryWhat's a Custom Recovery? Exploring CWM, TWRP, and FriendsWhat's a Custom Recovery? Exploring CWM, TWRP, and FriendsIf you've ever considered tinkering with your Android device, you've probably read that you need to flash a custom recovery onto it before you can do anything serious. But, that begs some questions.Read More.
This is the method you’ll likely use for installing a custom ROM12 Reasons to Install a Custom Android ROM12 Reasons to Install a Custom Android ROMThink you don't need a custom Android ROM anymore? Here are several reasons to install a custom Android ROM.Read More, or if you’re running Android 6.0 Marshmallow or newer, it could be the method you use for installing XposedThe 13 Best Xposed Modules for Customizing Your Android DeviceThe 13 Best Xposed Modules for Customizing Your Android DeviceThe Xposed Framework is one of the best reasons to root Android, and these Xposed modules add awesome functionality.Read More.
But if you have no idea what any of that means, don’t worry about it. Custom ROMs and mods are for more advanced users, but beginners can just as easily take advantage of sideloading.
Moving It onto Your Device
Now that you have your app or other file ready on your computer, the next step is actually moving it to your phone or tablet — AKA, sideloading.
For this, we recommend that you use the USB cable that came with your device, but if that one has been lost, damaged, or stolen, then you can use a third-party cable as well. If your cable isn’t working, you can test it with this appHow to Test If Your Micro-USB Cable Is Charging ProperlyHow to Test If Your Micro-USB Cable Is Charging ProperlyFind out exactly how fast your charger is charging your smartphone or tablet, and discover how to make it even faster.Read More.
Most of the time, this means using a micro-USB to full-size USB cable (above), but more and more phones and computers are being released with the new USB Type-C specificationWhat Is USB Type-C?What Is USB Type-C?Ah, the USB plug. It is as ubiquitous now as it is notorious for never being able to be plugged in right the first time.Read More that replaces both of these.
So, if your phone has a USB Type-C port and your computer has a USB Type-C port, then you can simply use a USB Type-C to USB Type-C cable. In the meantime, though, you might come across some USB Type-C to full-size USB cables or adapters.
On WindowsHow to Transfer Files From Android to PC: 7 MethodsHow to Transfer Files From Android to PC: 7 MethodsWant to learn how to transfer Android files to a PC or vice-versa? Here are several easy methods for moving data between devices.Read More, the process should be as simple as plugging in your device and opening it up to view its contents just like you would a USB thumbdrive. You can then copy and paste your desired files from your computer onto the Android device — just remember where you put them!
On MacHow to Transfer Files Between Android and Mac: 7 Easy MethodsHow to Transfer Files Between Android and Mac: 7 Easy MethodsNeed to transfer files between your Android phone and Mac computer? Here are simple ways to move data between those platforms.Read More, you’ll need to download something called Android File Transfer to facilitate the moving of files, but after that, it displays a very simple interface for transferring files from OS X to Android.
Alternative Methods
Pyxel edit. While downloading files to your computer and then transferring them to your phone over USB has a certain simplicity and organization to it, it’s not the only way of getting the job done.
My go-to, usually, is simply to download any files I want directly to my Android device. If I find an APK or other file I want to download on my computer, I simply open that same tab on my Android device (using Chrome’s built-in cross-device syncingThe Ultimate Chrome Sync Hacks For Swapping Between DesktopsThe Ultimate Chrome Sync Hacks For Swapping Between DesktopsAre you the type of person that needs unfettered mobility of their browsing data? With these Chrome hacks, you never have to worry about leaving your webpages, tabs and even clipboard data behind.Read More feature) and download it directly (ensuring, of course, that I’m connected to Wi-Fi first).
A more advanced route (if you’re going to be playing around with custom ROMs or other mods) is to use ADB, otherwise known as the Android Debug BridgeAndroid Won't Connect to Windows Over ADB? Fix It in Three Easy StepsAndroid Won't Connect to Windows Over ADB? Fix It in Three Easy StepsHaving trouble connecting your Android device to your PC via ADB? We got you covered.Read More. Using ADB can be daunting for folks who are new to the game, but thankfully, there’s a great service called ADB Helper that simplifies the whole thing.
Obviously, there are a lot of possibilities for transferring files between your computer and mobile device, like Bluetooth, Wi-Fi directThe Differences Between Bluetooth 4.0 and Wi-Fi Direct You Need To KnowThe Differences Between Bluetooth 4.0 and Wi-Fi Direct You Need To KnowIf you take a peek into the future, it's hard not to envision an always-on society that features a multitude of connected devices that work in unison to make your life more convenient.Read More, SD cards, cloud storage, and FTPFTP Transfer: 3 Popular File Managers for Android With FTP SoftwareFTP Transfer: 3 Popular File Managers for Android With FTP SoftwareFTP may sound intimidating, but it's not! We can help you learn how to quickly and easily share files between your devices with these handy Android apps.Read More — and you can use whichever you like best, but for simplicity’s sake, I’d say stick to direct downloading, sideloading, or ADB.
Accessing Your Files
Now your files are finally on your mobile device, but how do you access them? Some versions of Android come with a file explorer pre-installed, but on others, you’ll need to download one yourself. Personally, I use OI File Manager, but there are several great file explorers out thereThe 7 Best Free File Explorers for AndroidThe 7 Best Free File Explorers for AndroidThere are a bunch of file management and file exploring apps out there for Android, but these are the best.Read More.
Once you have one installed, just browse through it and find your files wherever you placed them while sideloading. Once you tap the file, you’ll need to decide what app you want to open it with. If it doesn’t prompt you for this, you may have already set a default app for that file type, but don’t worry, that’s easy to changeHow To Remove, Change, Or Set Default Apps In AndroidHow To Remove, Change, Or Set Default Apps In AndroidThe default way of changing your default apps can be annoying, but this app makes it super simple.Read More.
Installing Sideloaded Apps
For APKs that you’ve moved over, the process is a little bit more complex because Android has safeguards in place to ensure you’re not installing malware on your device. As long as you’re sure that the file you’re installing came from a safe source, follow these steps:
You can then go and tap on the APK file, and it should be as simple as tapping Install, and then Done or Open.
For extra security, Google may prompt you during this process to allow it to regularly check your device for harmful apps (Google calls this app verification). We recommend saying yes to this. If you’re not prompted and you want to ensure that it’s activated, follow these steps:
![]()
Here, you should see two toggles: Scan device for security threats and Improve harmful app detection. If you’re going to be regularly installing APKs from outside the Google Play Store10 Best Android Apps Not in the Play Store10 Best Android Apps Not in the Play StoreThe Play Store isn't the end-all-be-all of Android apps. If you've never ventured outside of it, you're really missing out.Read More, you’re best off keeping both of these on.
What Will You Sideload?
Hopefully, that explained how you can sideload various files from your computer to your Android device. If you have any questions, don’t hesitate to ask them in the comments.
When you do sideload apps, be sure to download APKs from safe sourcesThe 5 Best Sites for Safe Android APK DownloadsThe 5 Best Sites for Safe Android APK DownloadsNeed to download an APK to your Android device without the Google Play Store? Check out the best safe APK download sites.Read More.
Explore more about: Android Tips, File Management, .
Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with adevice. The adb command facilitates a variety of device actions, such as installing and debuggingapps, and it provides access to a Unix shell that you can use to run a variety of commands on adevice. It is a client-server program that includes three components:
adb is included in the Android SDK Platform-Tools package. You can download thispackage with the SDK Manager, which installsit at android_sdk/platform-tools/ . Or if you want the standalone Android SDKPlatform-Tools package, you can download it here.
For information on connecting a device for use over ADB, including how to use the Connection Assistant to troubleshoot common problems, see Run apps on a hardware device.
How adb works
When you start an adb client, the client first checks whether there is an adb serverprocess already running. If there isn't, it starts the server process. When the server starts,it binds to local TCP port 5037 and listens for commands sent from adb clients—all adbclients use port 5037 to communicate with the adb server.
The server then sets up connections to all running devices.It locates emulators by scanning odd-numbered ports in the range5555 to 5585, the range used by the first 16 emulators. Where the server finds an adbdaemon (adbd), it sets up a connection to that port. Note that each emulatoruses a pair of sequential ports — an even-numbered port forconsole connections and an odd-numbered port for adb connections. For example:
Emulator 1, console: 5554
Emulator 1, adb: 5555 Emulator 2, console: 5556 Emulator 2, adb: 5557 and so on..
As shown, the emulator connected to adb on port 5555 is the same as the emulatorwhose console listens on port 5554.
Once the server has set up connections to all devices, you can use adb commands toaccess those devices. Because the server manages connections to devices and handlescommands from multiple adb clients, you can control any device from any client (orfrom a script).
Enable adb debugging on your device
To use adb with a device connected over USB, you must enableUSB debugging in the device system settings, under Developer options.
On Android 4.2 and higher, the Developer options screen ishidden by default. To make it visible, go toSettings > About phone and tap Build number seven times. Return to the previousscreen to find Developer options at the bottom.
On some devices, the Developer options screen might be located or named differently. Error missing ilok authorization for pro tools 10 crack.
You can now connect your device with USB. You can verify that your device isconnected by executing
adb devices from theandroid_sdk/platform-tools/ directory. If connected,you'll see the device name listed as a 'device.'
Note: When you connect a device running Android 4.2.2 or higher,the system shows a dialog asking whether to accept an RSA key that allowsdebugging through this computer. This security mechanism protects user devices because it ensuresthat USB debugging and other adb commands cannot be executed unless you're able to unlock thedevice and acknowledge the dialog.
For more information about connecting to a device over USB, readRun Apps on a Hardware Device.
Connect to a device over Wi-Fi
adb usually communicates with the device over USB, but you can also use adb over Wi-Fi aftersome initial setup over USB, as described below. If you're developing for Wear OS, however,you should instead see the guide todebugging a Wear OS app,which has special instructions for using adb with Wi-Fi and Bluetooth.
You're now good to go!
If the adb connection is ever lost:
Query for devices
Before issuing adb commands, it is helpful to know what device instances are connected to the adb server. You can generate a list of attached devices using the
devices command.
In response, adb prints this status information for each device:
The following example shows the
devices command and its output. There are three devices running. The first two lines in the list are emulators, and the third line is a hardware device that is attached to the computer.
Emulator not listed
The
adb devices command has a corner-case command sequence that causes running emulator(s) to not show up in the adb devices output even though the emulator(s) are visible on your desktop. This happens when all of the following conditions are true:
One way to avoid this situation is to let the emulator choose its own ports, and don't run more than 16 emulators at once. Another way is to always start the adb server before you use the
emulator command, as explained in the following examples.
Example 1: In the following command sequence, the
adb devices command starts the adb server, but the list of devices does not appear.
Stop the adb server and enter the following commands in the order shown. For the avd name, providea valid avd name from your system. To get a list of avd names, type
emulator -list-avds .The emulator command is in the android_sdk/tools directory.
Example 2: In the following command sequence,
adb devices displays the list of devices because the adb server was started first.
To see the emulator in the
adb devices output, stop the adb server, and then start it again after using the emulator command and before using the adb devices command, as follows:
For more information about emulator command-line options,see Using Command Line Parameters.
Send commands to a specific device
If multiple devices are running, you must specify the target device when you issue the adb command. To specify the target, use the
devices command to get the serial number of the target. Once you have the serial number, use the -s option with the adb commands to specify the serial number. If you're going to issue a lot of adb commands, you can set the $ANDROID_SERIAL environment variable to contain the serial number instead. If you use both -s and $ANDROID_SERIAL , -s overrides $ANDROID_SERIAL .
In the following example, the list of attached devices is obtained, and then the serial number of one of the devices is used to install the
helloWorld.apk on that device.
Note: If you issue a command without specifying a target device when multiple devices are available, adb generates an error.
If you have multiple devices available, but only one is an emulator,use the
-e option to send commands to the emulator. Likewise, if there are multipledevices but only one hardware device attached, use the -d option to send commands tothe hardware device.
Install an app
You can use adb to install an APK on an emulator or connected devicewith the
install command:
You must use the
-t option with the install command when you install a test APK. For more information, see -t .
For more information about how to create an APK file that you can install on an emulator/deviceinstance, see Build and Run Your App.
Note that, if you are using Android Studio, you do not need to use adb directly to install your app on the emulator/device. Instead, Android Studio handles the packaging and installation of the app for you.
Set up port forwarding
You can use the
forward command to set up arbitrary port forwarding, which forwards requests on a specific host port to a different port on a device. The following example sets up forwarding of host port 6100 to device port 7100:
The following example sets up forwarding of host port 6100 to local:logd:
Copy files to/from a deviceAdb Install Apk Free Download
Use the
pull and push commands to copy files toand from an device. Unlike the install command,which only copies an APK file to a specific location, the pull and push commands let you copy arbitrary directories and files to any location in a device.
To copy a file or directory and its sub-directories from the device,do the following:
To copy a file or directory and its sub-directories to the device, do the following:
Replace
local and remote with the paths tothe target files/directory on your development machine (local) and on thedevice (remote). For example:
Stop the adb server
In some cases, you might need to terminate the adb server process and then restart itto resolve the problem (e.g., if adb does not respond to a command). Foundation design software, free download.
To stop the adb server, use the
adb kill-server command.You can then restart the server by issuing any other adb command.
adb commands reference
You can issue adb commands from a command line on your development machine or from a script.The usage is:
If there's only one emulator running or only one device connected, the adb command issent to that device by default. If multiple emulators are running and/or multiple devices areattached, you need to use the
-d , -e , or -s option to specify the target device to which the command should be directed.
Adb Sideload Update Zip Download
The table below lists all of the supported adb commands and explains their meaning and usage.
Table 1. Available adb commands and options
Issue shell commands
You can use the
shell command to issue device commands through adb, with or without enteringthe adb remote shell on the device. To issue a single command without entering aremote shell, use the shell command like this:
Or enter a remote shell on a device like this:
When you are ready to exit the remote shell, press Control + D or type
exit .
The shell command binaries are stored in the file system of the device at
/system/bin/ .
Note: With Android Platform-Tools 23 and higher, adb handles arguments the same way that the
ssh(1) command does. This change has fixed a lot of problems with command injection and makes it possible to now safely execute commands that contain shell metacharacters, such as adb install Let'sGo.apk . But, this change means that the interpretation of any command that contains shell metacharacters has also changed. For example, the adb shell setprop foo 'a b' command is now an error because the single quotes (' ) are swallowed by the local shell, and the device sees adb shell setprop foo a b . To make the command work, quote twice, once for the local shell and once for the remote shell, the same as you do with ssh(1) . For example, adb shell setprop foo 'a b' .
Call activity manager (
|
Command | Description |
---|---|
start [options] intent |
Start an Activity specified by intent .
See theSpecification for intent arguments.
Options are:
|
startservice [options] intent |
Start the Service specified by intent .
See theSpecification for intent arguments.
Options are:
|
force-stop package |
Force stop everything associated with package (the app's package name). |
kill [options] package |
Kill all processes associated with package (the app's package name). This command kills only processes that are safe to kill and that will not impact the user experience.
Options are:
|
kill-all |
Kill all background processes. |
broadcast [options] intent |
Issue a broadcast intent.
See theSpecification for intent arguments.
Options are:
|
instrument [options] component |
Start monitoring with an Instrumentation instance. Typically the target component is the form test_package/runner_class .
Options are:
|
profile start processfile |
Start profiler on process , write results to file . |
profile stop process |
Stop profiler on process . |
dumpheap [options] processfile |
Dump the heap of process , write to file .
Options are:
|
set-debug-app [options] package |
Set app package to debug.
Options are:
|
clear-debug-app |
Clear the package previous set for debugging with set-debug-app . |
monitor [options] |
Start monitoring for crashes or ANRs.
Options are:
|
screen-compat {on | off} package |
Control screencompatibility mode of package . |
display-size [reset | widthxheight] |
Override device display size.This command is helpful for testing your app across different screen sizes by mimicking a smallscreen resolution using a device with a large screen, and vice versa.
Example:
am display-size 1280x800
|
display-density dpi |
Override device display density.This command is helpful for testing your app across different screen densities on high-densityscreen environment using a low density screen, and vice versa.
Example:
am display-density 480
|
to-uri intent |
Print the given intent specification as a URI.
See theSpecification for intent arguments.
|
to-intent-uri intent |
Print the given intent specification as an intent: URI.
See theSpecification for intent arguments.
|
Specification for intent arguments
For activity manager commands that take an
intent
argument, you canspecify the intent with the following options:
Show all
-a action
- Specify the intent action, such as
android.intent.action.VIEW
. You can declare this only once. -d data_uri
- Specify the intent data URI, such as
content://contacts/people/1
. You can declare this only once. -t mime_type
- Specify the intent MIME type, such as
image/png
. You can declare this only once. -c category
- Specify an intent category, such as
android.intent.category.APP_CONTACTS
. -n component
- Specify the component name with package name prefix to create an explicit intent, such as
com.example.app/.ExampleActivity
. -f flags
- Add flags to the intent, as supported by
setFlags()
. --esn extra_key
- Add a null extra. This option is not supported for URI intents.
-e | --es extra_keyextra_string_value
- Add string data as a key-value pair.
--ez extra_keyextra_boolean_value
- Add boolean data as a key-value pair.
--ei extra_keyextra_int_value
- Add integer data as a key-value pair.
--el extra_keyextra_long_value
- Add long data as a key-value pair.
--ef extra_keyextra_float_value
- Add float data as a key-value pair.
--eu extra_keyextra_uri_value
- Add URI data as a key-value pair.
--ecn extra_keyextra_component_name_value
- Add a component name, which is converted and passed as a
ComponentName
object. --eia extra_keyextra_int_value[,extra_int_value..]
- Add an array of integers.
--ela extra_keyextra_long_value[,extra_long_value..]
- Add an array of longs.
--efa extra_keyextra_float_value[,extra_float_value..]
- Add an array of floats.
--grant-read-uri-permission
- Include the flag
FLAG_GRANT_READ_URI_PERMISSION
. --grant-write-uri-permission
- Include the flag
FLAG_GRANT_WRITE_URI_PERMISSION
. --debug-log-resolution
- Include the flag
FLAG_DEBUG_LOG_RESOLUTION
. --exclude-stopped-packages
- Include the flag
FLAG_EXCLUDE_STOPPED_PACKAGES
. --include-stopped-packages
- Include the flag
FLAG_INCLUDE_STOPPED_PACKAGES
. --activity-brought-to-front
- Include the flag
FLAG_ACTIVITY_BROUGHT_TO_FRONT
. --activity-clear-top
- Include the flag
FLAG_ACTIVITY_CLEAR_TOP
. --activity-clear-when-task-reset
- Include the flag
FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
. --activity-exclude-from-recents
- Include the flag
FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
. --activity-launched-from-history
- Include the flag
FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
. --activity-multiple-task
- Include the flag
FLAG_ACTIVITY_MULTIPLE_TASK
. --activity-no-animation
- Include the flag
FLAG_ACTIVITY_NO_ANIMATION
. --activity-no-history
- Include the flag
FLAG_ACTIVITY_NO_HISTORY
. --activity-no-user-action
- Include the flag
FLAG_ACTIVITY_NO_USER_ACTION
. --activity-previous-is-top
- Include the flag
FLAG_ACTIVITY_PREVIOUS_IS_TOP
. --activity-reorder-to-front
- Include the flag
FLAG_ACTIVITY_REORDER_TO_FRONT
. --activity-reset-task-if-needed
- Include the flag
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
. --activity-single-top
- Include the flag
FLAG_ACTIVITY_SINGLE_TOP
. --activity-clear-task
- Include the flag
FLAG_ACTIVITY_CLEAR_TASK
. --activity-task-on-home
- Include the flag
FLAG_ACTIVITY_TASK_ON_HOME
. --receiver-registered-only
- Include the flag
FLAG_RECEIVER_REGISTERED_ONLY
. --receiver-replace-pending
- Include the flag
FLAG_RECEIVER_REPLACE_PENDING
. --selector
- Requires the use of
-d
and-t
options to set the intent data and type. URIcomponentpackage
- You can directly specify a URI, package name, and component name when not qualified by one of the above options. When an argument is unqualified, the tool assumes the argument is a URI if it contains a ':' (colon); it assumes the argument is a component name if it contains a '/' (forward-slash); otherwise it assumes the argument is a package name.
Call package manager (pm
)
Within an adb shell, you can issue commands with the package manager (
pm
) tool toperform actions and queries on app packages installed on the device. While in a shell,the syntax is:
You can also issue a package manager command directly from adbwithout entering a remote shell. For example:
Table 3. Available package manager commands.
Command | Description |
---|---|
list packages [options] filter |
Prints all packages, optionally only those whose package name contains the text in filter .
Options:
|
list permission-groups |
Prints all known permission groups. |
list permissions [options] group |
Prints all known permissions, optionally only those in group .
Options:
|
list instrumentation [options] |
List all test packages.
Options:
|
list features |
Prints all features of the system. |
list libraries |
Prints all the libraries supported by the current device. |
list users |
Prints all users on the system. |
path package |
Print the path to the APK of the given package . |
install [options] path |
Installs a package (specified by path ) to the system.
Options:
|
uninstall [options] package |
Removes a package from the system.
Options:
|
clear package |
Deletes all data associated with a package. |
enable package_or_component |
Enable the given package or component (written as 'package/class'). |
disable package_or_component |
Disable the given package or component (written as 'package/class'). |
disable-user [options] package_or_component |
Options:
|
grant package_namepermission |
Grant a permission to an app. On devices running Android 6.0 (API level 23)and higher, the permission can be any permission declared in the app manifest. On devicesrunning Android 5.1 (API level 22) and lower, must be an optional permission defined by theapp. |
revoke package_namepermission |
Revoke a permission from an app. On devices running Android 6.0 (API level23) and higher, the permission can be any permission declared in the app manifest. On devicesrunning Android 5.1 (API level 22) and lower, must be an optional permission defined by theapp. |
set-install-location location |
Changes the default install location. Location values:
Note: This is only intended for debugging; using this can cause apps to break and other undesireable behavior.
|
get-install-location |
Returns the current install location. Return values:
|
set-permission-enforced permission [true | false] |
Specifies whether the given permission should be enforced. |
trim-caches desired_free_space |
Trim cache files to reach the given free space. |
create-user user_name |
Create a new user with the given user_name , printing the new user identifier of the user. |
remove-user user_id |
Remove the user with the given user_id , deleting all data associated with that user |
get-max-users |
Prints the maximum number of users supported by the device. |
Call device policy manager (dpm
)
To help you develop and test your device management (or other enterprise) apps, you can issue commands to the device policy manager (
dpm
) tool. Use the tool to control the active admin app or change a policy's status data on the device.While in a shell, the syntax is:
You can also issue a device policy manager command directly from adb without entering a remote shell:
Table 4. Available device policy manager commands
Command | Description |
---|---|
set-active-admin [options] component |
Sets component as active admin.
Options are:
|
set-profile-owner [options] component |
Sets component as active admin and its package as profile owner for an existing user.
Options are:
|
set-device-owner [options] component |
Sets component as active admin and its package as device owner.
Options are:
|
remove-active-admin [options] component |
Disables an active admin. The app must declareandroid:testOnly in the manifest. This command also removes device and profile owners.
Options are:
|
clear-freeze-period-record |
Clears the device's record of previously-set freeze periods for system OTA updates. This is usefulto avoid the device's scheduling restrictions when developing apps that manage freeze-periods. SeeManage system updates.
Supported on devices running Android 9.0 (API level 28) and higher.
|
force-network-logs |
Forces the system to make any existing network logs ready for retrieval by a DPC. If there areconnection or DNS logs available, the DPC receives theonNetworkLogsAvailable() callback. See Network activity logging.
This command is rate-limited. Supported on devices running Android 9.0 (API level 28) and higher.
|
force-security-logs |
Forces the system to make any existing security logs available to the DPC. If there are logsavailable, the DPC receives theonSecurityLogsAvailable() callback. See Log enterprise deviceactivity.
This command is rate-limited. Supported on devices running Android 9.0 (API level 28) and higher.
|
Take a screenshot
The
screencap
command is a shell utility for taking a screenshot of a device display.While in a shell, the syntax is:
To use the
screencap
from the command line, type the following:
Here's an example screenshot session, using the adb shell to capture the screenshot and the
pull
command to download the file from the device:
Record a video
The
screenrecord
command is a shell utility for recording the display of devices running Android 4.4 (API level 19) and higher. The utility records screen activity to an MPEG-4 file. You can use this file to create promotional or training videos or for debugging and testing.
In a shell, use the following syntax:
To use
screenrecord
from the command line, type the following:
Stop the screen recording by pressing Control + C (Command + C on Mac); otherwise, the recording stops automatically at three minutes or the time limit set by
--time-limit
.
To begin recording your device screen, run the
screenrecord
command to recordthe video. Then, run the pull
command to download the video from the device to the hostcomputer. Here's an example recording session:
Google Play
The
screenrecord
utility can record at any supported resolution and bit rate you request, while retaining the aspect ratio of the device display. The utility records at the native display resolution and orientation by default, with a maximum length of three minutes.
Limitations of the
screenrecord
utility:
- Audio is not recorded with the video file.
- Video recording is not available for devices running Wear OS.
- Some devices might not be able to record at their native display resolution. If you encounter problems with screen recording, try using a lower screen resolution.
- Rotation of the screen during recording is not supported. If the screen does rotate during recording, some of the screen is cut off in the recording.
Table 5.
screenrecord
options
Options | Description |
---|---|
--help |
Displays command syntax and options |
--size widthxheight |
Sets the video size: 1280x720 . The default value is the device's native display resolution (if supported), 1280x720 if not. For best results, use a size supported by your device's Advanced Video Coding (AVC) encoder. |
--bit-rate rate |
Sets the video bit rate for the video, in megabits per second. The default value is 4Mbps. You can increase the bit rate to improve video quality, but doing so results in larger movie files. The following example sets the recording bit rate to 6Mbps: |
--time-limit time |
Sets the maximum recording time, in seconds. The default and maximum value is 180 (3 minutes). |
--rotate |
Rotates the output 90 degrees. This feature is experimental. |
--verbose |
Displays log information on the command-line screen. If you do not set this option, the utility does not display any information while running. |
Read ART profiles for apps
Starting in Android 7.0 (API level 24) the Android Runtime (ART) collects execution profiles for installed apps, which are used to optimize app performance. You might want to examine the collected profiles to understand which methods are determined to be frequently executed and which classes are used during app startup.
To produce a text form of the profile information, use the command:
Adb Sideload App
To retrieve the file produced, use:
Reset test devices
If you test your app across multiple test devices, it may be useful to reset your device between tests, for example, to remove user data and reset the test environment. You can perform a factory reset of a test device running Android 10 (API level 29) or higher using the
testharness
adb shell command, as shown below.
When restoring the device using
testharness
, the device automatically backs up the RSA key that allows debugging through the current workstation in a persistent location. That is, after the device is reset, the workstation can continue to debug and issue adb commands to the device without manually registering a new key.
Additionally, to help make it easier and more secure to keep testing your app, using the
testharness
to restore a device also changes the following device settings:
- The device sets up certain system settings so that initial device setup wizards do not appear. That is, the device enters a state from which you can quickly install, debug, and test your app.
- Settings:
- Disables lock screen
- Disables emergency alerts
- Disables auto-sync for accounts
- Disables automatic system updates
- Other:
- Disables preinstalled security apps
Adb Sideload Download Android
If you app needs to detect and adapt to the default settings of the
testharness
command, you can use the ActivityManager.isRunningInUserTestHarness()
.
Other shell commands
For a list of all the available shell programs, use the following command:
Help is available for most of the commands.
Table below lists some of the more common adb shell commands.
Table 6. Some other adb shell commands
Shell command | Description |
---|---|
dumpsys |
Dumps system data to the screen. To learn more about this command-line tool, read dumpsys |
dumpstate |
Dumps state to a file. |
logcat [option].. [filter-spec].. |
Enables system and app logging and prints output to the screen.
See also Logcat Command-Line Tool.
|
dmesg |
Prints kernel debugging messages to the screen. |
start |
Starts (restarts) a device. |
stop |
Stops execution of a device. |
sqlite3 |
Starts the sqlite3 command-line program.
The
sqlite3 tool includes commands such as.dump to print out the contents of a table and.schema to print the SQL CREATE statement for an existing table.You can also execute SQLite commands on the fly.
SQLite3 databases are stored in the folder
/data/data/package_name/databases/ .
For example:
For more information, see the sqlite3 command line documentation.
|
Comments are closed.
Author
Write something about yourself. No need to be fancy, just an overview.