1,手机开启debug 调试模式。
2,安装USB驱动。milestone直接去moto的官网去下载驱动。
3,手机装好android SDK
4,电脑装好python2.6 (至少2.5不好使)。多版本的python共存,我直接改python.exe为python2.6.exe
5,拷贝手机中的python_extras_r8.zip文件,将里面android.py放到python2.6目录里。
6,手机USB连接电脑,开启private方式的服务。并记录端口号,比如43228
7,电脑上操作
adb forward tcp:8888 tcp:43228
set AP_PORT=8888
8,进入python2.6的shell
import android
droid = android.Android()
droid.makeToast("hehe") OK了。
参考地址:http://code.google.com/p/android-scripting/wiki/RemoteControl