开发者

eclipse can't install apk on device, "ActivityManager: /sbin/sh: am: not found"

开发者 https://www.devze.com 2023-03-15 21:08 出处:网络
I\'m trying to run an application from eclipse on a rooted acer iconia tab, nothing fancy, just a simple helloworld app, and I get this output:

I'm trying to run an application from eclipse on a rooted acer iconia tab, nothing fancy, just a simple helloworld app, and I get this output:

[2011-06-28 21:45:12 - HelloAndroid] Android Launch!
[2011-06-28 21:45:12 - HelloAndroid] adb is running normally.
[2011-06-28 21:45:12 - HelloAndroid] Performing com.androidbook.hello.HelloActivity activity launch
[2011-06-28 21:45:12 - HelloAndroid] Automatic Target Mode: using device '37c618743c06297'
[2011-06-28 21:45:12 - HelloAndroid] Uploading HelloAndroid.apk onto device '37c618743c06297'
[2011-06-28 21:45:12 - HelloAndroid] Installing HelloAndroid.apk...
[2011-06-28 21:45:12 - HelloAndroid] Success!
[2011-06-28 21:45:12 - HelloAndroid] Starting activity com.androidbook.hello.HelloActivity on device 37c618743c06297
[2011-06-28 21:45:12 - HelloAndroid] ActivityManager: /sbin/sh: am: not found

I also tried running "adb shell", which properly opens a root terminal on the device, and I try to run the am command, I get the same error, i.e. "/sbin/sh: am: not found". However, the command is properly located at /system/bin, and /system/bin is in the pat开发者_如何学JAVAh

/ # echo $PATH
/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin

Does anyone know what could be going wrong?


The problem is that the line

#!/system/bin/sh

Is missing from the top of the am file. Just add it back using vi editor and it will work...

In case you have root you can use busybox vi am to edit the file. If the filesystem is read only then run mount -o remount,rw /system before and mount -o remount,ro /system after to allow editing of /system. You might have to prefix the mount commands with busybox incase it fails and prints the usage (which might mean you didn't have root).


Found a "solution". Don't know exactly why the am command could not be run, even when it was present on the device, but after installing a different rom, the problem is unexistant. I was using the virtous rom 1.0.8, and switched to virtuous galaxy 1.0.2.

Thanks to anyone who provided feedback anyways.

0

精彩评论

暂无评论...
验证码 换一张
取 消