压力测试:$adbshellmonkey-pyour.package.name-v500
找LOG:adblogcat-bmain-bradio-bsystem-vtime>log.txt
如果要抓Message的话,还要加上adbshellsetproplog.tag.Mms:transactionVERBOSE
在ubuntu下安装手机驱动
在ubuntu通过usb连接cci设备,使用adb时,会返回无法找到设备,解决办法如下:
1)在终端运行lsusb
会发现结果有会有如下类似记录:
Bus002Device001:ID1d6b:0001LinuxFoundation1.1roothub
Bus003Device001:ID1d6b:0001LinuxFoundation1.1roothub
Bus004Device005:ID1219:0102#这行就是cci手机
Bus004Device001:ID1d6b:0001LinuxFoundation1.1roothub
Bus005Device001:ID1d6b:0001LinuxFoundation1.1roothub
这时键入
sudogedit/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)运行以下命令:
sudochmoda+rx/etc/udev/rules.d/53-android.rules
sudo/etc/init.d/udevrestart
3)在androidsdk的tools目录下运行(这一步很重要,必须要sudo,否则没效果)
cdcci-base/
cdout/host/linux-x86/bin/
sudo./adbkill-server
sudo./adbdevices
sudo./adbremount
然后,就可以直接用adbshell来进行操作了。
1.compile7015codeusemake
#cd7015
#make#wait3hours
2.usethenewsystem.imganduserdata.imginsteadofthesdk'simg,backupfirst
#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-s7015/out/target/product/generic/system.img/yournamedir/android-sdk-linux_86/platforms/android-8/images/system.img
#ln-s7015/out/target/product/generic/userdata.img/yournamedir/android-sdk-linux_86/platforms/android-8/images/userdata.img
thencreateaavdineclipse,thisavdwillusethenewsystem.img.
Startit!
3.modifyapps
ChangeContactsforexample,changejavafilesinpackagesandsave.
#cd7015
#mmmpackages/apps/Contacts#waitsevaralminutes
#adbremount#afterremountthe/symsteminemulatorwillbemountedwritable
usethenewgeneratedapkreplacethesameapkinemulatordir/system/app,youcanuseadbpushcommandorpushfileinddms.
#adbpushout/target/product/generic/system/app/Contacts.apk/system/app
#adbpushout/target/product/generic/data/app/ContactsTests.apk/system/app
4.modifyframeworkfiles
Changeframeworks/base/core/res/forexample
editString.xmlandsave
#mmmframeworks/base/core/res/
thiswillgenerateout/target/product/generic/system/framework/framework-res.apk,thenusemkyaffs2imagemakenewsystem.img
#out/host/linux-x86/bin/mkyaffs2image-fout/target/product/generic/systemout/target/product/generic/system.img
restarttheemulator,thenewsystem.imgwillbeused.
scp/home/coleman/eclipse/[email protected]:/home/deanye/
首先要cd到SDK下的platform-tools文件夹(新版的SDK的adb在这个文件夹,旧版的放在tools文件夹,如果设置了path也可以在任意路径执行):
adbremount
adbpush"本地路径.../.apk""/system/app"
结果出现了另外一个错误"outofmemory"
这个可能是在创建虚拟机的时候空间没有分配好,需要加虚拟机的启动参数来临时修改:
cd到tools文件夹,(如果模拟器已开启要先关闭)执行:
emulator-partition-size256-avd"模拟器的名字"
这时候会自动开启一个模拟器.
然后需要另外开一个命令行窗口,cd到platform-tools,重新执行上面的命令就可以了
adbremount
adbpush"本地路径.../.apk""/system/app"
不用重启模拟器直接打开应用就能看到应用已经是被修改过的了.
gitpushxxsecond:refs/for/xx
gitreset--hard
gitcommit--amend
gitpushxxfirst:refs/changes/27
gitformat-patchHEAD~1
./emulator-avdandroidtest1-partition-size512