6

i am using android on ubuntu 12.04, i tried to push an image of about 100kb in the sdcard through file Explorer provided by eclipse[android]. The file explorer shows the sdcard and when i try to push the image it show an error

Failed to push the item(s). null

I looked for the similar problem's solution and found to do:

adb push [filename] /sdcard/[filename]

i did this in terminal but it returns "No command 'adb' found" and it refers other commands. Could any buddy help to solve it???

7 Answers7

9

If you are trying to use internal SD card, make sure you do: /sdcard/ rather than /sdcard

BlackHatSamurai
  • 23,275
  • 22
  • 95
  • 156
6

I had this problem several times but i didn´t realize what was the cause.

  • The first cause is that you have more than one device connected, be sure to have only the device were you going to push the files.

  • Other way to solve this, go to DDMS in Devices section select the device. Select your running emulator so that its highlighted, go to the top right corner and click the "down arrow", select the option "Reset adb".

  • Be sure your device contains a SDCard. =)

Jorgesys
  • 124,308
  • 23
  • 334
  • 268
  • 1
    As mentioned in this answer, having more than one device connected was the cause of the problem on my side. – Pascal Jan 26 '16 at 14:42
2

I resolved in this way:

  1. disconect my phone from USB, so, only I works with the emulator

  2. using adb push command line with the folder storage/sdcard and not /sdcard, example

    D:\adt-bundle-windows-x86-20131030\sdk\platform-tools>adb push "d:\star.jpg" storage/sdcard

  3. close the emulator and run again

  4. I check in Eclipse -> DDMS -> File Explorer tab, and I see the image inside storage/sdcard folder

Community
  • 1
  • 1
Hernaldo Gonzalez
  • 1,977
  • 1
  • 21
  • 32
0

You need to add the path to the adb executable to the global PATH environment variable, you just need that:

export PATH=$PATH:<android-sdk-linux>/platform-tools/

just replace <android-sdk-linux> with the full path to your actual copy of the Android SDK and you will be fine.

add the export command to your ~/.bashrc to keep this command in your PATH.

user1849534
  • 2,329
  • 4
  • 18
  • 20
  • by the way im new to android so if you dont mind tell me where should i do that –  Dec 13 '12 at 05:07
  • @Robz being fair this has nothing to do with the Android SDK, eclipse is just telling you that it doesn't know what the adb command is, so you are supposed to add it to the "list" which means you add the path where the adb command lives to the PATH variable that is where eclipse will search for executables; the export command is for the shell / terminal. By the way if you don't see the platform-tools folder in your SDK this means that you need to download adb with your first run of the Android SDK manager, in this case just run `android sdk` from the terminal. – user1849534 Dec 13 '12 at 05:24
0

Searched many posts and answers but none worked. I wanted to test image upload to a web server and it worked.
To push any file in sdcard => Inside sdcard, create any folder then push your file/media. This worked for me. Hope it works for someone too.

Sajal
  • 1,198
  • 1
  • 17
  • 32
0

i just change the data cable plug from one to another it work like charm from me

Amandeep Rohila
  • 3,558
  • 2
  • 28
  • 34
-1

To push items to your SD card, go to [android-sdk]/platform-tools/.

Then type

./adb push [filename] /sdcard/

Your AVD must contain sdcard to do this.

mjk
  • 2,443
  • 4
  • 33
  • 33
Charan Pai
  • 2,288
  • 5
  • 32
  • 44
  • I did "./adb push ~/Desktop/abc.jpg /sdcard" to but an error was thrown like this "failed to copy '/home/lenovo/Desktop/abc.jpg' to '/sdcard': Is a directory" –  Dec 13 '12 at 05:01
  • if you want to push whole directory content then use like this ./adb push ~/songs/ /sdcard/Music/ – Charan Pai Dec 13 '12 at 06:27