Dania
Dania

Reputation: 1688

Why adb push gives device not found error?

I want to push some apk file to sd card, then to /system folder. I tried the following commands in order:

adb shell

su

mount -o rw,remount /system

adb push /data/app/com.project.android.xxx-2.apk /sdcard

But the last line always results in device not found error. I have even tried with system folder directly as, adb push /data/app/com.project.android.xxx-2.apk /system/app, but it gave me the same error. I have also tried to execute this line before push command:

chmod 644 /sdcard

But that didn't solve the push command problem.

What is causing this error, and how can I solve it?

Upvotes: 0

Views: 5501

Answers (1)

Onik
Onik

Reputation: 19959

You're executing adb push being already shell-ed into the device. By doing that you start another adb server on the target device now (not on your host machine), which is scanning ports in some range looking for devices attached. Since no device is found (attached to the target device) you get error: device not found. For the kind of task you're trying to achieve no need to use any of adb commands within shell.

Try either mv or cp command once you shell-ed in. For example (remounting part skipped):

adb shell
cp /data/app/com.project.android.xxx-2.apk /sdcard

Upvotes: 4

Related Questions