1 #!/bin/bash 2 3 #disable for now, as it is still not well tested 4 #set -e 5 6 echo "starting boot test at " 7 date 8 uname -a 9 10 echo $TARGET_PRODUCT 11 12 time_out="600" 13 op_no_accel="" 14 unamestr=`uname` 15 if [[ "$unamestr" == 'Linux' ]]; then 16 export PATH=prebuilts/android-emulator/linux-x86_64:$PATH 17 op_no_accel="-no-accel" 18 if [[ -e '/dev/kvm' ]]; then 19 echo "Has /dev/kvm" 20 if [[ -r '/dev/kvm' ]]; then 21 echo "KVM readable" 22 if [[ -w '/dev/kvm' ]]; then 23 echo "KVM writable, enable acceleration" 24 op_no_accel="" 25 fi 26 else 27 echo "KVM not readable" 28 fi 29 else 30 echo "does not have KVM" 31 fi 32 elif [[ "$unamestr" == 'Darwin' ]]; then 33 export PATH=prebuilts/android-emulator/darwin-x86_64:$PATH 34 else 35 echo "Cannot determine OS type, quit" 36 exit 1 37 fi 38 39 if [[ $op_no_accel != "" ]]; then 40 echo "disable smp since there is no acceleration" 41 echo hw.cpu.ncore=1 >> $ANDROID_PRODUCT_OUT/config.ini 42 fi 43 44 echo $ANDROID_PRODUCT_OUT 45 46 which emulator 47 emulator -version 48 emulator -accel-check 49 50 { 51 sleep 600 52 echo "kill emulator after 10 minutes" 53 pkill -9 qemu-system 54 } & 55 56 emulator -gpu swiftshader_indirect -no-window -show-kernel -verbose -quit-after-boot $time_out \ 57 -wipe-data -no-snapshot $op_no_accel -skin 480x800x32 -logcat *:I -no-boot-anim 58 59 echo "ending boot test at " 60 date 61 echo "done" 62 exit 0 63