Android批量打包apk

Android系统批量打包apk

# add by chenshibing,just for compiling conviniently
bin_files=`ls ${HOME}/.bin`
for bin_file in ${bin_files}
do
        source ${HOME}/.bin/${bin_file}
done
# end

---------------------------------------------------------------------------------------
#!/bin/bash

TEST_DIR="${HOME}/test/AndroidTest/"

target_type=
target_test=

function android_demo_test() {
        local ori_dir=`pwd`
        list_apk_tests
        list_bin_tests

        read -p "输入要编译测试的test目录:" target_test
        if [ -z ${target_test} ];then
                return 1
        fi

        cd ${TEST_DIR}
        local result=`find -type d -name "${target_test}"`
        if [ -z ${result} ];then
                echo "不存在该目录"
                return 1
        fi

        echo `echo result | grep "apk"`
        if [ $? -eq 0 ];then
                target_type=apk
        elif [[ ${result} =~ "bin" ]];then
                target_type=bin
        fi

        cd ${ori_dir}
        echo ln -s "${TEST_DIR}${target_type}"\/"${target_test}" ${target_test}
        ln -s "${TEST_DIR}${target_type}"\/"${target_test}" ${target_test}

        target_type=
        target_test=
        return 0
}

function list_apk_tests() {
        cd "${TEST_DIR}apk/"
        echo "apk:"
        echo "------------------------------------------"
        ls
        echo ========================================
        echo
}

function list_bin_tests() {
        cd "${TEST_DIR}bin"
        echo "bin"
        echo "------------------------------------------"
        ls
        echo ========================================
        echo
}

猜你喜欢

转载自blog.csdn.net/mcsbary/article/details/88636375