压力测试:$ adb shell monkey -p your.package.name -v 500
找LOG :adb logcat -b main -b radio -b system -v time >log.txt
如果要抓Message的话,还要加上adb shell setprop log.tag.Mms:transaction VERBOSE
在ubuntu下安装手机驱动
在 ubuntu 通过usb连接 cci 设备,使用 adb 时,会返回无法找到设备,解决办法如下:
1) 在终端运行 lsusb
会发现结果有会有如下类似记录:
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 005: ID 1219:0102 #这行就是cci手机
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
这时键入
sudo gedit /etc/udev/rules.d/53-android.rules
在打开的文件中增加以下文本:
SUBSYSTEM=="usb", SYSFS{idVendor}=="1219", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="1219", ATTR{idProduct}=="0102", SYMLINK+="android_adb"
2) 运行以下命令:
sudo chmod a+rx /etc/udev/rules.d/53-android.rules
sudo /etc/init.d/udev restart
3) 在 android sdk 的 tools 目录下运行 (这一步很重要,必须要sudo,否则没效果)
cd cci-base/
cd out/host/linux-x86/bin/
sudo ./adb kill-server
sudo ./adb devices
sudo ./adb remount
然后,就可以直接用 adb shell来进行操作了。
1. compile 7015 code use make
#cd 7015
#make #wait 3 hours
2. use the new system.img and userdata.img instead of the sdk's img,backup first
#mv /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img.old
#mv /yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img
/yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img.old
#ln -s 7015/out/target/product/generic/system.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img
#ln -s 7015/out/target/product/generic/userdata.img /yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img
then create a avd in eclipse, this avd will use the new system.img.
Start it!
3. modify apps
Change Contacts for example,change java files in packages and save.
#cd 7015
#mmm packages/apps/Contacts #wait sevaral minutes
#adb remount #after remount the /symstem in emulator will be mounted writable
use the new generated apk replace the same apk in emulator dir /system/app,you can use adb push command or push file in ddms.
#adb push out/target/product/generic/system/app/Contacts.apk /system/app
#adb push out/target/product/generic/data/app/ContactsTests.apk /system/app
4. modify framework files
Change frameworks/base/core/res/ for example
edit String.xml and save
#mmm frameworks/base/core/res/
this will generate out/target/product/generic/system/framework/framework-res.apk, then use mkyaffs2image make new system.img
#out/host/linux-x86/bin/mkyaffs2image -f out/target/product/generic/system out/target/product/generic/system.img
restart the emulator, the new system.img will be used.
scp /home/coleman/eclipse/eclipse-java-helios-SR2-linux-gtk.tar deanye@10.100.13.126:/home/deanye/
首先要cd到SDK下的platform-tools文件夹(新版的SDK的adb在这个文件夹, 旧版的放在tools文件夹, 如果设置了path也可以在任意路径执行):
adb remount
adb push "本地路径.../ .apk" "/system/app"
结果出现了另外一个错误 "out of memory"
这个可能是在创建虚拟机的时候空间没有分配好, 需要加虚拟机的启动参数来临时修改:
cd到tools文件夹, (如果模拟器已开启要先关闭)执行:
emulator -partition-size 256 -avd "模拟器的名字"
这时候会自动开启一个模拟器.
然后需要另外开一个命令行窗口, cd到platform-tools, 重新执行上面的命令就可以了
adb remount
adb push "本地路径.../ .apk" "/system/app"
不用重启模拟器直接打开应用就能看到应用已经是被修改过的了.
git push xx second:refs/for/xx
git reset --hard
git commit --amend
git push xx first:refs/changes/27
git format-patch HEAD~1
./emulator -avd androidtest1 -partition-size 512