1. adb
a. adb devices 出现 no permisions的解决方法
注意一定要用root
b. adb devices为空的解决方法
c. adb 通过wifi连接
2. ndk
1. Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !
解决方法: Navigate to ../android-ndk-r7/prebuilt/linux-x86/bin
Rename the file awk to awk_
http://stackoverflow.com/questions/8384213/android-ndk-revision-7-host-awk-tool-is-outdated-error
3. eclipse
a. adb devices 出现 no permisions的解决方法
- cong@ubuntu:~$ which adb
- /opt/android/adt-bundle-linux-x86_64-20131030/sdk/platform-tools/adb
- cong@ubuntu:~$ sudo /opt/android/adt-bundle-linux-x86_64-20131030/sdk/platform-tools/adb kill-server
- cong@ubuntu:~$ sudo /opt/android/adt-bundle-linux-x86_64-20131030/sdk/platform-tools/adb start-server
b. adb devices为空的解决方法
- a. 建51-android.rules文件
- cong@ubuntu:/tmp$ cat /etc/udev/rules.d/51-android.rules
- SUBSYSTEM=="usb", SYSFS{idVendor}=="0e8d", MODE="0666"
- SUBSYSTEM=="usb", SYSFS{idVendor}=="2207", MODE="0666"
-
- b. 将pid写到adb_usb.ini中
- cong@ubuntu:/tmp$ vi /home/cong/.android/adb_usb.ini
- cong@ubuntu:/tmp$ cat /home/cong/.android/adb_usb.ini
- 0x2207
- a. 确保手机能与电脑Ping通
- b. 手机可以执行su
- c. 手机己经装上 “安卓终端模拟器”
-
- 然后打开 安卓终端模拟器,输入以下命令(红色标出):
- #!/system/bin/sh
- #设置监听的端口,端口可以自定义,如5554,5555是默认的
- setprop service.adb.tcp.port 5555
- #关闭adbd
- stop adbd
- #重新启动adbd
- start adbd
1. Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !
Rename the file awk to awk_
http://stackoverflow.com/questions/8384213/android-ndk-revision-7-host-awk-tool-is-outdated-error
- a. Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
- Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
- 解决方法: right click your project > android tools > android support library
- 参考文章: http://stackoverflow.com/questions/19727915/android-dex-gives-a-bufferoverflowexception
- b. 显示行号
- "window" ->; "preference" ->; "java" - >; "editor" ->; "show line numbers"
- c. 安装sdk
- 打开eclipse所指定的sdk_location:
- windows-> preference -> android --> SDK location
- 把下载的东东放在 sdk/platform目录中
- http://www.eoeandroid.com/thread-226410-1-1.html
a. am 启动一个activity
am start -n packagename/.activityname ;;注意activityname前面有个点
例: adb shell am start -n com.touchtest/.MainActivity
5. monkey
adb shell monkey -v -p com.writetest --pct-touch 100 11
-v 显示信息
-p 指定package_name
--pct-touch 指定touch的百分比,这儿是100%
11是发送的次数cnt
上述命令是向 com.writetest这个包发送touch 11次