• 是 是,非常感谢

  • 不行的,试过的

  • 这个 我也是今天早上 摸索到了 是这样的 很好 不用搞 expect 这一套了,但是 我觉得 spawn 模拟的问题还是没有解决,日后也不知道会不会碰到这样的事情

  • lofo,你好 这个试过了 ,结果依然报了 lunch command not found

  • 在 jenkins 里执行 lunch 是可以可以执行的 执行 spawn su root 也是可以执行的, 只是 spawn 与 lunch 一起 即 spawn lunch  就还是出 说 lunch 找不到

  • 版主,我经排查,如一楼所述,请帮忙定位看看

  • 可是,跟兄弟们私下没办法联系啊,不能留言不能私信 不能加好友

  • 是这回事儿! 谢谢!

  • HI i 子休,很感谢你的帮忙,很高兴认识你,介意加个 QQ 么? 我的是 330994099

  • [i=s] 本帖最后由 zhaolixin007 于 2013-6-3 09:45 编辑

    版主,我的 sh 文件入上楼所示,我先试试看 在 shell 内容中开始处 先加上 #!/bin/bash 试过 也还是不行~ 谢谢你帮我做的回复,虽然问题还在,介意加个 QQ 么 我的是 330994099

  • [code] function pid() { local EXE="$1" if [ "$EXE" ] ; then local PID=adb shell ps | fgrep $1 | sed -e 's/[^ ]* *\([0-9]*\).*/\1/' echo "$PID" else echo "usage: pid name" fi }

    systemstack - dump the current stack trace of all threads in the system process

    to the usual ANR traces file

    function systemstack() { adb shell echo '""' '>>' /data/anr/traces.txt && adb shell chmod 776 /data/anr/traces.txt && adb shell kill -3 $(pid system_server) }

    function gdbclient() { local OUT_ROOT=$(get_abs_build_var PRODUCT_OUT) local OUT_SYMBOLS=$(get_abs_build_var TARGET_OUT_UNSTRIPPED) local OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED) local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED) local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS) local ARCH=$(get_build_var TARGET_ARCH) local GDB case "$ARCH" in x86) GDB=i686-linux-android-gdb;; arm) GDB=arm-linux-androideabi-gdb;; mips) GDB=mipsel-linux-android-gdb;; *) echo "Unknown arch $ARCH"; return 1;; esac

    if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then local EXE="$1" if [ "$EXE" ] ; then EXE=$1 else EXE="app_process" fi

    local PORT="$2" if [ "$PORT" ] ; then PORT=$2 else PORT=":5039" fi

    local PID local PROG="$3" if [ "$PROG" ] ; then if [[ "$PROG" =~ ^[0-9]+$ ]] ; then PID="$3" else PID=pid $3 fi adb forward "tcp$PORT" "tcp$PORT" adb shell gdbserver $PORT --attach $PID & sleep 2 else echo "" echo "If you haven't done so already, do this first on the device:" echo " gdbserver $PORT /system/bin/$EXE" echo " or" echo " gdbserver $PORT --attach $PID" echo "" fi

    echo >|"$OUT_ROOT/gdbclient.cmds" "set solib-absolute-prefix $OUT_SYMBOLS" echo >>"$OUT_ROOT/gdbclient.cmds" "set solib-search-path $OUT_SO_SYMBOLS:$OUT_SO_SYMBOLS/hw:$OUT_SO_SYMBOLS/ssl/engines:$OUT_SO_SYMBOLS/drm:$OUT_SO_SYMBOLS/egl:$OUT_SO_SYMBOLS/soundfx" echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT" echo >>"$OUT_ROOT/gdbclient.cmds" ""

    $ANDROID_TOOLCHAIN/$GDB -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE" else echo "Unable to determine build system output dir." fi

    }

    case uname -s in Darwin) function sgrep() { find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*.(c|h|cpp|S|java|xml|sh|mk)' -print0 | xargs -0 grep --color -n "$@" }

    ;; ) function sgrep() { find . -name .repo -prune -o -name .git -prune -o -type f -iregex '..(c|h|cpp|S|java|xml|sh|mk)' -print0 | xargs -0 grep --color -n "$@" } ;; esac

    function gettargetarch { get_build_var TARGET_ARCH }

    function jgrep() { find . -name .repo -prune -o -name .git -prune -o -type f -name "*.java" -print0 | xargs -0 grep --color -n "$@" }

    function cgrep() { find . -name .repo -prune -o -name .git -prune -o -type f ( -name '.c' -o -name '.cc' -o -name '.cpp' -o -name '.h' ) -print0 | xargs -0 grep --color -n "$@" }

    function resgrep() { for dir in find . -name .repo -prune -o -name .git -prune -o -name res -type d; do find $dir -type f -name '*.xml' -print0 | xargs -0 grep --color -n "$@"; done; }

    case uname -s in Darwin) function mgrep() { find -E . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -type f -iregex './(Makefile|Makefile..|..make|..mak|.*.mk)' -print0 | xargs -0 grep --color -n "$@" }

    function treegrep() { find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*.(c|h|cpp|S|java|xml)' -print0 | xargs -0 grep --color -n -i "$@" }

    ;; ) function mgrep() { find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -regextype posix-egrep -iregex '(.\/Makefile|.\/Makefile..|..make|..mak|.*.mk)' -type f -print0 | xargs -0 grep --color -n "$@" }

    function treegrep() { find . -name .repo -prune -o -name .git -prune -o -regextype posix-egrep -iregex '.*.(c|h|cpp|S|java|xml)' -type f -print0 | xargs -0 grep --color -n -i "$@" }

    ;; esac

    function getprebuilt { get_abs_build_var ANDROID_PREBUILTS }

    function tracedmdump() { T=$(gettop) if [ ! "$T" ]; then echo "Couldn't locate the top of the tree. Try setting TOP." return fi local prebuiltdir=$(getprebuilt) local arch=$(gettargetarch) local KERNEL=$T/prebuilts/qemu-kernel/$arch/vmlinux-qemu

    local TRACE=$1 if [ ! "$TRACE" ] ; then echo "usage: tracedmdump tracename" return fi

    if [ ! -r "$KERNEL" ] ; then echo "Error: cannot find kernel: '$KERNEL'" return fi

    local BASETRACE=$(basename $TRACE) if [ "$BASETRACE" = "$TRACE" ] ; then TRACE=$ANDROID_PRODUCT_OUT/traces/$TRACE fi

    echo "post-processing traces..." rm -f $TRACE/qtrace.dexlist post_trace $TRACE if [ $? -ne 0 ]; then echo "" echo " Error: malformed trace. Did you remember to exit the emulator?" echo "**" return fi echo "generating dexlist output..." /bin/ls $ANDROID_PRODUCT_OUT/system/framework/.jar $ANDROID_PRODUCT_OUT/system/app/.apk $ANDROID_PRODUCT_OUT/data/app/.apk 2>/dev/null | xargs dexlist > $TRACE/qtrace.dexlist echo "generating dmtrace data..." q2dm -r $ANDROID_PRODUCT_OUT/symbols $TRACE $KERNEL $TRACE/dmtrace || return echo "generating html file..." dmtracedump -h $TRACE/dmtrace >| $TRACE/dmtrace.html || return echo "done, see $TRACE/dmtrace.html for details" echo "or run:" echo " traceview $TRACE/dmtrace" }

    communicate with a running device or emulator, set up necessary state,

    and run the hat command.

    function runhat() { # process standard adb options local adbTarget="" if [ "$1" = "-d" -o "$1" = "-e" ]; then adbTarget=$1 shift 1 elif [ "$1" = "-s" ]; then adbTarget="$1 $2" shift 2 fi local adbOptions=${adbTarget} #echo adbOptions = ${adbOptions}

    # runhat options local targetPid=$1

    if [ "$targetPid" = "" ]; then echo "Usage: runhat [ -d | -e | -s serial ] target-pid" return fi

    # confirm hat is available if [ -z $(which hat) ]; then echo "hat is not available in this configuration." return fi

    # issue "am" command to cause the hprof dump local sdcard=$(adb shell echo -n '$EXTERNAL_STORAGE') local devFile=$sdcard/hprof-$targetPid #local devFile=/data/local/hprof-$targetPid echo "Poking $targetPid and waiting for data..." echo "Storing data at $devFile" adb ${adbOptions} shell am dumpheap $targetPid $devFile echo "Press enter when logcat shows \"hprof: heap dump completed\"" echo -n "> " read

    local localFile=/tmp/$$-hprof

    echo "Retrieving file $devFile..." adb ${adbOptions} pull $devFile $localFile

    adb ${adbOptions} shell rm $devFile

    echo "Running hat on $localFile" echo "View the output by pointing your browser at http://localhost:7000/" echo "" hat -JXmx512m $localFile }

    function getbugreports() { local reports=(adb shell ls /sdcard/bugreports | tr -d '\r')

    if [ ! "$reports" ]; then echo "Could not locate any bugreports." return fi

    local report for report in ${reports[@]} do echo "/sdcard/bugreports/${report}" adb pull /sdcard/bugreports/${report} ${report} gunzip ${report} done }

    function getsdcardpath() { adb ${adbOptions} shell echo -n \${EXTERNAL_STORAGE} }

    function getscreenshotpath() { echo "$(getsdcardpath)/Pictures/Screenshots" }

    function getlastscreenshot() { local screenshot_path=$(getscreenshotpath) local screenshot=adb ${adbOptions} ls ${screenshot_path} | grep Screenshot_[0-9-]*.*\.png | sort -rk 3 | cut -d " " -f 4 | head -n 1 if [ "$screenshot" = "" ]; then echo "No screenshots found." return fi echo "${screenshot}" adb ${adbOptions} pull ${screenshot_path}/${screenshot} }

    function startviewserver() { local port=4939 if [ $# -gt 0 ]; then port=$1 fi adb shell service call window 1 i32 $port }

    function stopviewserver() { adb shell service call window 2 }

    function isviewserverstarted() { adb shell service call window 3 }

    function key_home() { adb shell input keyevent 3 }

    function key_back() { adb shell input keyevent 4 }

    function key_menu() { adb shell input keyevent 82 }

    function smoketest() { if [ ! "$ANDROID_PRODUCT_OUT" ]; then echo "Couldn't locate output files. Try running 'lunch' first." >&2 return fi T=$(gettop) if [ ! "$T" ]; then echo "Couldn't locate the top of the tree. Try setting TOP." >&2 return fi

    (cd "$T" && mmm tests/SmokeTest) && adb uninstall com.android.smoketest > /dev/null && adb uninstall com.android.smoketest.tests > /dev/null && adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTestApp.apk && adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTest.apk && adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner }

    simple shortcut to the runtest command

    function runtest() { T=$(gettop) if [ ! "$T" ]; then echo "Couldn't locate the top of the tree. Try setting TOP." >&2 return fi ("$T"/development/testrunner/runtest.py $@) }

    function godir () { if [[ -z "$1" ]]; then echo "Usage: godir " return fi T=$(gettop) if [[ ! -f $T/filelist ]]; then echo -n "Creating index..." (cd $T; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > filelist) echo " Done" echo "" fi local lines lines=($(\grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq)) if [[ ${#lines[@]} = 0 ]]; then echo "Not found" return fi local pathname local choice if [[ ${#lines[@]} > 1 ]]; then while [[ -z "$pathname" ]]; do local index=1 local line for line in ${lines[@]}; do printf "%6s %s\n" "[$index]" $line index=$(($index + 1)) done echo echo -n "Select one: " unset choice read choice if [[ $choice -gt ${#lines[@]} || $choice -lt 1 ]]; then echo "Invalid choice" continue fi pathname=${lines[$(($choice-1))]} done else pathname=${lines[0]} fi cd $T/$pathname }

    Force JAVA_HOME to point to java 1.6 if it isn't already set

    function set_java_home() { if [ ! "$JAVA_HOME" ]; then case uname -s in Darwin) export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home ;; *) export JAVA_HOME=/usr/lib/jvm/java-6-sun ;; esac fi }

    if [ "x$SHELL" != "x/bin/bash" ]; then case ps -o command -p $$ in bash) ;; *) echo "WARNING: Only bash is supported, use of other shell would lead to erroneous results" ;; esac fi

    Execute the contents of any vendorsetup.sh files we can find.

    for f in /bin/ls vendor/*/vendorsetup.sh vendor/*/*/vendorsetup.sh device/*/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null do echo "including $f" . $f done unset f

    addcompletions[/code]

  • 执行 export 后,输出: [color=Red] tvos_code_sync@Amlogic:/var/lib/jenkins/workspace/TVOS_JB2$ export declare -x COLORTERM="gnome-terminal" declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-60EivNUQmu,guid=1be13c41643946c6f750f2540003511f" declare -x DEFAULTS_PATH="/usr/share/gconf/ubuntu-2d.default.path" declare -x DESKTOP_SESSION="ubuntu-2d" declare -x DISPLAY="10.120.91.47:2" declare -x GDMSESSION="ubuntu-2d" declare -x GDM_LANG="en_US" declare -x GNOME_DESKTOP_SESSION_ID="this-is-deprecated" declare -x GNOME_KEYRING_CONTROL="/tmp/keyring-g74Y0f" declare -x GNOME_KEYRING_PID="32487" declare -x GPG_AGENT_INFO="/tmp/keyring-g74Y0f/gpg:0:1" declare -x HOME="/home/tvos_code_sync" declare -x LANG="en_US.UTF-8" declare -x LANGUAGE="en_US:en" declare -x LESSCLOSE="/usr/bin/lesspipe %s %s" declare -x LESSOPEN="| /usr/bin/lesspipe %s" declare -x LOGNAME="tvos_code_sync" declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arj=01;31:.taz=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lz=01;31:.xz=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.jpg=01;35:.jpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.axv=01;35:.anx=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.axa=00;36:.oga=00;36:.spx=00;36:.xspf=00;36:" declare -x MANDATORY_PATH="/usr/share/gconf/ubuntu-2d.mandatory.path" declare -x OLDPWD="/var/lib/jenkins/workspace" declare -x PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/gnutools/arc2.3-p0/elf32-4.2.1/bin:/opt/gnutools/arc2.3-p0/uclibc-4.2.1/bin::/opt/CodeSourcery/Sourcery_G++_Lite/bin:/opt/CodeSourcery/Sourcery_G++_Lite/arm-none-eabi/bin:/opt/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/bin:/opt/CodeSourcery/Sourcery_G++_Lite/bin:/opt/CodeSourcery/Sourcery_G++_Lite/bin" declare -x PWD="/var/lib/jenkins/workspace/TVOS_JB2" declare -x SESSION_MANAGER="local/Amlogic:@/tmp/.ICE-unix/32495,unix/Amlogic:/tmp/.ICE-unix/32495" declare -x SHELL="/bin/bash" declare -x SHLVL="1" declare -x SSH_AGENT_PID="32545" declare -x SSH_AUTH_SOCK="/tmp/keyring-g74Y0f/ssh" declare -x TERM="xterm" declare -x UBUNTU_MENUPROXY="libappmenu.so" declare -x USER="tvos_code_sync" declare -x USERNAME="tvos_code_sync" declare -x WINDOWID="65011716" declare -x XAUTHORITY="/var/run/gdm/auth-for-tvos_code_sync-TSgq0a/database" declare -x XDG_CONFIG_DIRS="/etc/xdg/xdg-ubuntu-2d:/etc/xdg" declare -x XDG_CURRENT_DESKTOP="Unity" declare -x XDG_DATA_DIRS="/usr/share/ubuntu-2d:/usr/share/gnome:/usr/local/share/:/usr/share/" declare -x XDG_SESSION_COOKIE="7acb93c20c2503fe0ba30b1c0000021b-1369619558.89764-665137417" [color=Red] tvos_code_sync@Amlogic:/var/lib/jenkins/workspace/TVOS_JB2$

  • 版主,这个能提示下么如何去写? 我有这样写: 加上 source 的全路径 如:/usr/src/linux-headers-3.2.0-36-generic/source ***.sh 这样也还是验证不过

  • 按楼上的方法重新验证,发现依然提示 source not found 的错误,请问是不是 在执行了此语句以后 需要执行一些其他的命令,才可以使其生效呢? 另,我有试过 加上 source 的全路径 如:/usr/src/linux-headers-3.2.0-36-generic/source ***.sh 这样也还是验证不过

  • 按楼上的方法重新验证,发现依然提示 source not found 的错误,请问是不是 在执行了此语句以后 需要执行一些其他的命令,才可以使其生效呢?

  • 然后怎么处理呢?

  • 安装环境 ubuntu 未使用 tomcat 安装参考链接:http://pkg.jenkins-ci.org/debian/ 错误提示: Building in workspace /var/lib/jenkins/workspace/TVOS_JB2 Updating http://10.120.99.201/svn/Amlogic_M6/trunk/TVOS_JB2 at revision '2013-05-29T10:05:01.884 +0800' U frameworks/base/media/java/android/media/AudioService.java U frameworks/base/services/java/com/android/server/usb/UsbSettingsManager.java U hardware/amlogic/audio/usb_audio_hw.c At revision 497 [TVOS_JB2] $ /bin/sh -xe /tmp/hudson1011950518928320546.sh

    • umask 0022
    • source build/envsetup.sh /tmp/hudson1011950518928320546.sh: 3: /tmp/hudson1011950518928320546.sh: [color=Red] source: not found Build step 'Execute shell' marked build as failure Finished: FAILURE[attach] 2124[/attach]
  • jenkins 编译不过 at 2012年08月21日

    这个问题搞定了,谢谢大家,是构建步骤处没有处理好

  • jenkins 编译不过 at 2012年08月14日

    [i=s] 本帖最后由 zhaolixin007 于 2012-8-14 09:34 编辑

    Hi laofo ,我在楼上加载了附件 build.xml; 另外,我的 build.xml 文件在工程路径下 windows 系统执行如下命令行生成的 android update project -p \

  • jenkins 编译不过 at 2012年08月14日

    请 laofo 版主看下我的附件

  • jenkins 编译不过 at 2012年08月13日

    所以是哪里设置出了问题,我关注的是问题的症结在哪儿

  • jenkins 编译不过 at 2012年08月13日

    嗯,我看到了,但是为什么会出现编译得过的情况呢

  • jenkins 编译不过 at 2012年08月13日

    ???没有这个路径的吧,因为无须安装 SDK