work:android-shell
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
work:android-shell [2010/04/30 17:01] – percy | work:android-shell [2016/05/05 13:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== 工作中用到的一些脚本 ====== | ====== 工作中用到的一些脚本 ====== | ||
+ | |||
+ | |||
由于办公室用的是colinux, | 由于办公室用的是colinux, | ||
+ | |||
+ | |||
还有一些其它乱七八糟的脚本. | 还有一些其它乱七八糟的脚本. | ||
+ | |||
====== mymake.sh ====== | ====== mymake.sh ====== | ||
+ | |||
+ | |||
用来快速编译单个AP, | 用来快速编译单个AP, | ||
+ | |||
+ | |||
root@ubuntu:/ | root@ubuntu:/ | ||
- | < | + | |
+ | < | ||
+ | |||
#!/bin/bash | #!/bin/bash | ||
+ | |||
#echo "make Browser && cp out/ | #echo "make Browser && cp out/ | ||
+ | |||
#make Browser && cp out/ | #make Browser && cp out/ | ||
+ | |||
+ | |||
+ | |||
START_AT=`date` | START_AT=`date` | ||
+ | |||
+ | |||
ROOT_DIR=/ | ROOT_DIR=/ | ||
+ | |||
+ | |||
TARGET=generic | TARGET=generic | ||
+ | |||
# | # | ||
+ | |||
+ | |||
TARGET_DEST=/ | TARGET_DEST=/ | ||
+ | |||
+ | |||
IMAGE_DIR=${ROOT_DIR}/ | IMAGE_DIR=${ROOT_DIR}/ | ||
+ | |||
+ | |||
mkdir -p ${TARGET_DEST} | mkdir -p ${TARGET_DEST} | ||
+ | |||
+ | |||
FRAMEWORK_DIR=${ROOT_DIR}/ | FRAMEWORK_DIR=${ROOT_DIR}/ | ||
+ | |||
OUT_DIR=${ROOT_DIR}/ | OUT_DIR=${ROOT_DIR}/ | ||
+ | |||
+ | |||
if [ ${#} != 1 ];then | if [ ${#} != 1 ];then | ||
+ | |||
echo " | echo " | ||
+ | |||
echo " | echo " | ||
+ | |||
echo "Then Browser.apk will be copied to ${TARGET_DEST}" | echo "Then Browser.apk will be copied to ${TARGET_DEST}" | ||
+ | |||
exit 0 | exit 0 | ||
+ | |||
fi | fi | ||
+ | |||
+ | |||
echo "Now start make ${1}" | echo "Now start make ${1}" | ||
+ | |||
. build/ | . build/ | ||
+ | |||
make ${1} | make ${1} | ||
+ | |||
+ | |||
+ | |||
if [ ${1} = " | if [ ${1} = " | ||
+ | |||
echo "cp ${FRAMEWORK_DIR}/ | echo "cp ${FRAMEWORK_DIR}/ | ||
+ | |||
cp ${FRAMEWORK_DIR}/ | cp ${FRAMEWORK_DIR}/ | ||
+ | |||
+ | |||
elif [ ${1} = " | elif [ ${1} = " | ||
+ | |||
echo " | echo " | ||
+ | |||
cp ${IMAGE_DIR}/ | cp ${IMAGE_DIR}/ | ||
+ | |||
+ | |||
+ | |||
else | else | ||
+ | |||
echo "cp ${OUT_DIR}/ | echo "cp ${OUT_DIR}/ | ||
+ | |||
cp ${OUT_DIR}/ | cp ${OUT_DIR}/ | ||
+ | |||
+ | |||
fi | fi | ||
+ | |||
+ | |||
# | # | ||
+ | |||
+ | |||
+ | |||
END_AT=`date` | END_AT=`date` | ||
+ | |||
+ | |||
echo "START AT: | echo "START AT: | ||
+ | |||
echo " | echo " | ||
+ | |||
+ | |||
</ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== makedalvik.sh ====== | ||
+ | |||
+ | 编译dalvik目录, | ||
+ | |||
+ | |||
+ | |||
+ | <file bash makedalvik.sh> | ||
+ | |||
+ | root@ubuntu: | ||
+ | |||
+ | #!/bin/bash | ||
+ | |||
+ | |||
+ | |||
+ | echo "Make dalvik for Target,and will run make snod to package the system.img" | ||
+ | |||
+ | |||
+ | |||
+ | echo ". build/ | ||
+ | |||
+ | source build/ | ||
+ | |||
+ | echo " | ||
+ | |||
+ | choosecombo Device release msm7627_ffa eng | ||
+ | |||
+ | echo "cd dalvik" | ||
+ | |||
+ | cd dalvik | ||
+ | |||
+ | echo " | ||
+ | |||
+ | mm | ||
+ | |||
+ | echo "cd .." | ||
+ | |||
+ | cd .. | ||
+ | |||
+ | echo " | ||
+ | |||
+ | ./mymake.sh snod | ||
+ | |||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
====== mybuild.sh ====== | ====== mybuild.sh ====== | ||
+ | |||
用来编译整个工程的, | 用来编译整个工程的, | ||
+ | |||
root@ubuntu:/ | root@ubuntu:/ | ||
+ | |||
<file BASH mybuild.sh> | <file BASH mybuild.sh> | ||
+ | |||
#!/bin/sh | #!/bin/sh | ||
+ | |||
+ | |||
START=`date` | START=`date` | ||
+ | |||
EMU_SOURCEDIR=/ | EMU_SOURCEDIR=/ | ||
+ | |||
TARGET_SOURCEDIR=/ | TARGET_SOURCEDIR=/ | ||
+ | |||
+ | |||
EMU_DESTDIR=/ | EMU_DESTDIR=/ | ||
+ | |||
TARGET_DESTDIR=/ | TARGET_DESTDIR=/ | ||
+ | |||
+ | |||
+ | |||
mkdir -p ${EMU_DESTDIR} | mkdir -p ${EMU_DESTDIR} | ||
+ | |||
mkdir -p ${TARGET_DESTDIR} | mkdir -p ${TARGET_DESTDIR} | ||
+ | |||
+ | |||
+ | |||
[ -e ${TARGET_DESTDIR}download.sh | [ -e ${TARGET_DESTDIR}download.sh | ||
+ | |||
+ | |||
#./build.sh ${1} | #./build.sh ${1} | ||
+ | |||
+ | |||
if [ ${1} = " | if [ ${1} = " | ||
+ | |||
+ | |||
echo "cp ${TARGET_SOURCEDIR}/ | echo "cp ${TARGET_SOURCEDIR}/ | ||
+ | |||
cp ${TARGET_SOURCEDIR}/ | cp ${TARGET_SOURCEDIR}/ | ||
+ | |||
+ | |||
echo "cp ${TARGET_SOURCEDIR}/ | echo "cp ${TARGET_SOURCEDIR}/ | ||
+ | |||
cp ${TARGET_SOURCEDIR}/ | cp ${TARGET_SOURCEDIR}/ | ||
+ | |||
+ | |||
echo "cp ${TARGET_SOURCEDIR}/ | echo "cp ${TARGET_SOURCEDIR}/ | ||
+ | |||
cp ${TARGET_SOURCEDIR}/ | cp ${TARGET_SOURCEDIR}/ | ||
+ | |||
+ | |||
echo "cp ${TARGET_SOURCEDIR}/ | echo "cp ${TARGET_SOURCEDIR}/ | ||
+ | |||
cp ${TARGET_SOURCEDIR}/ | cp ${TARGET_SOURCEDIR}/ | ||
+ | |||
+ | |||
elif [ ${1} = " | elif [ ${1} = " | ||
+ | |||
+ | |||
echo "cp ${EMU_SOURCEDIR}/ | echo "cp ${EMU_SOURCEDIR}/ | ||
+ | |||
cp ${EMU_SOURCEDIR}/ | cp ${EMU_SOURCEDIR}/ | ||
+ | |||
+ | |||
echo "cp ${EMU_SOURCEDIR}/ | echo "cp ${EMU_SOURCEDIR}/ | ||
+ | |||
cp ${EMU_SOURCEDIR}/ | cp ${EMU_SOURCEDIR}/ | ||
+ | |||
+ | |||
echo "cp ${EMU_SOURCEDIR}/ | echo "cp ${EMU_SOURCEDIR}/ | ||
+ | |||
cp ${EMU_SOURCEDIR}/ | cp ${EMU_SOURCEDIR}/ | ||
+ | |||
echo "cp ${EMU_SOURCEDIR}/ | echo "cp ${EMU_SOURCEDIR}/ | ||
+ | |||
cp ${EMU_SOURCEDIR}/ | cp ${EMU_SOURCEDIR}/ | ||
+ | |||
else | else | ||
+ | |||
echo " | echo " | ||
+ | |||
+ | |||
fi | fi | ||
+ | |||
+ | |||
+ | |||
+ | |||
END=`date` | END=`date` | ||
+ | |||
echo "Start at ${START}" | echo "Start at ${START}" | ||
+ | |||
echo " | echo " | ||
+ | |||
+ | |||
</ | </ | ||
+ | |||
====== getpnglist.sh ====== | ====== getpnglist.sh ====== | ||
+ | |||
用来查找drawable png图片在哪些java文件里面用到的脚本 | 用来查找drawable png图片在哪些java文件里面用到的脚本 | ||
+ | |||
root@ubuntu: | root@ubuntu: | ||
+ | |||
<file BASH getpnglist.sh> | <file BASH getpnglist.sh> | ||
+ | |||
#!/bin/sh | #!/bin/sh | ||
+ | |||
# | # | ||
+ | |||
# | # | ||
+ | |||
# | # | ||
+ | |||
#Use the shell to find the resource file and where the resource file is used | #Use the shell to find the resource file and where the resource file is used | ||
+ | |||
#the default file is png | #the default file is png | ||
+ | |||
#Example: | #Example: | ||
+ | |||
#cd /ice | #cd /ice | ||
+ | |||
# | # | ||
+ | |||
# | # | ||
+ | |||
START_AT=`date` | START_AT=`date` | ||
+ | |||
+ | |||
APP_NAME=${1} | APP_NAME=${1} | ||
+ | |||
APP_DIR=android/ | APP_DIR=android/ | ||
+ | |||
RES_DIR=res | RES_DIR=res | ||
+ | |||
+ | |||
FILE_TYPE=png | FILE_TYPE=png | ||
+ | |||
+ | |||
echo "Get the ${APP_NAME} png list in the resource directory" | echo "Get the ${APP_NAME} png list in the resource directory" | ||
+ | |||
echo " | echo " | ||
+ | |||
+ | |||
echo " | echo " | ||
+ | |||
ls ${APP_DIR}/ | ls ${APP_DIR}/ | ||
+ | |||
echo " | echo " | ||
+ | |||
+ | |||
FILE_LIST=`ls ${APP_DIR}/ | FILE_LIST=`ls ${APP_DIR}/ | ||
+ | |||
+ | |||
echo " | echo " | ||
+ | |||
echo ${RESULT}> | echo ${RESULT}> | ||
+ | |||
echo " | echo " | ||
+ | |||
for i in `echo ${FILE_LIST}`: | for i in `echo ${FILE_LIST}`: | ||
+ | |||
do | do | ||
+ | |||
echo " | echo " | ||
+ | |||
| | ||
+ | |||
echo " | echo " | ||
+ | |||
+ | |||
#grep -i -R -n ${FILENAME} ${APP_DIR}/ | #grep -i -R -n ${FILENAME} ${APP_DIR}/ | ||
+ | |||
RESULT=`grep -i -R -n ${FILENAME} ${APP_DIR}/ | RESULT=`grep -i -R -n ${FILENAME} ${APP_DIR}/ | ||
+ | |||
echo " | echo " | ||
+ | |||
+ | |||
echo ${RESULT}>> | echo ${RESULT}>> | ||
+ | |||
echo " | echo " | ||
+ | |||
done | done | ||
+ | |||
echo " | echo " | ||
+ | |||
END_AT=`date` | END_AT=`date` | ||
+ | |||
echo "Start at: | echo "Start at: | ||
+ | |||
echo " | echo " | ||
+ | |||
echo " | echo " | ||
+ | |||
+ | |||
+ | |||
</ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
/var/www/dokuwiki/wiki/data/attic/work/android-shell.1272618105.txt.gz · Last modified: 2016/05/05 13:06 (external edit)