Archived: "adb push" and "adb pull" Commands

This section describes 'adb push' and 'adb pull' commands, which allows you to copy files to and from the remote Android emulator or device.

This tutorial was based on Android SDK R17 with Android 4.0.3 and left here as a reference.

The "adb" tool also offers you commands to copy files into and from the connected Android emulator or devices.

The "adb push <local> <remote>" copies a file or folder from the local system to the remote emulator or device.

The "adb pull <remote> <local>" copies a file or folder from the remote emulator or device to the local system.

Example 1 - Copying "Silk-Road.jpg" to the /sdcard/Picture folder in the emulator:

C:\local\android-sdk-windows\platform-tools>adb push \
   \herong\Pictures\Silk-Road.jpg /sdcard/Picture
258 KB/s (111019 bytes in 0.420s)

Example 2 - Copying "init.rc" from the / folder in the emulator:

C:\local\android-sdk-windows\platform-tools>adb pull \
   /init.rc \herong
139 KB/s (17040 bytes in 0.119s)

Example 3 - Copying all files from the /data/data folder in the emulator:

C:\local\android-sdk-windows\platform-tools>adb pull
   /data/app \herong\app
pull: building file list...
pull: /data/app/GestureBuilder.apk -> \herong\app/GestureBuilder.apk
pull: /data/app/SoftKeyboard.apk -> \herong\app/SoftKeyboard.apk
pull: /data/app/ApiDemos.apk -> \herong\app/ApiDemos.apk
pull: /data/app/SoftKeyboard.odex -> \herong\app/SoftKeyboard.odex
pull: /data/app/CubeLiveWallpapers.apk -> \herong\app/CubeLiveWallp...
pull: /data/app/ApiDemos.odex -> \herong\app/ApiDemos.odex
pull: /data/app/GestureBuilder.odex -> \herong\app/GestureBuilder.odex
pull: /data/app/WidgetPreview.odex -> \herong\app/WidgetPreview.odex
pull: /data/app/CubeLiveWallpapers.odex -> \herong\app/CubeLiveWall...
pull: /data/app/WidgetPreview.apk -> \herong\app/WidgetPreview.apk
pull: /data/app/com.herongyang-1.apk -> \herong\app/com.herongyang-...
pull: /data/app/net.sf.andpdf.pdfviewer-1.apk -> \herong\app/net.sf...
pull: /data/app/com.adobe.reader-1.apk -> \herong\app/com.adobe.rea...
13 files pulled. 0 files skipped.
148 KB/s (7022410 bytes in 46.298s)

Table of Contents

 About This Book

 Installing JDK 1.8 on Windows System

 Installation of Android SDK R24 and Emulator

 Installing Apache Ant 1.9 on Windows System

 Developing First Android Application - HelloAndroid

 Android Application Package (APK) Files

 Android Debug Bridge (adb) Tool

 Android File Systems

 AboutAndroid - Application to Retrieve System Information

 android.app.Activity Class and Activity Lifecycle

 View Objects and Layout Resource Files

 Using "adb logcat" Command for Debugging

 Build Process and Package File Content

 Building Your Own Web Browser

 Android Command Line Shell

 Samsung Galaxy Tab 3 Mini Tablet

 USB Debugging Applications on Samsung Tablet

 Android Tablet - LG-V905R

 USB Debugging Applications on LG-V905R Tablet

 Android Phone - LG-P925g

 USB Debugging Applications on LG-P925g Phone

Archived Tutorials

 Archived: Downloading and Installing JDK 1.7

 Archived: Downloading and Installing Android SDK R17

 Archived: Running Android SDK Manager

 Archived: Installing Android Platform 4.0.3 and Libraries

 Archived: Verifying Android Platform Installation

 Archived: Creating Android Virtual Device (AVD)

 Archived: Launching Android Emulator in AVD Manager

 Archived: Android Emulator Built-in Applications

 Archived: Android Emulator Built-in Web Browser

 Archived: Downloading and Installing Apache Ant 1.8

 Archived: "HelloAndroid" - First Android Project

 Archived: Building the Debug Binary Package

 Archived: Installing the Debug Binary Package

 Archived: Running the Debug Binary Package

 Archived: Rebuild the Debug Binary Package

 Archived: Redefine Text in Resource Files

 Archived: Installing Android PDF Viewer APK File

 Archived: Copy PDF File to Android Emulator's File System

 Archived: Installing Adobe Reader APK File

 Archived: "adb shell" - Remote Shell Interface

Archived: "adb push" and "adb pull" Commands

 References

 Full Version in PDF/EPUB