OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # android_setup.sh: Sets environment variables used by other Android scripts. | 3 # android_setup.sh: Sets environment variables used by other Android scripts. |
4 | 4 |
5 # Parse the arguments for a DEVICE_ID. | 5 # Parse the arguments for a DEVICE_ID. |
6 DEVICE_ID="" | 6 DEVICE_ID="" |
7 DEVICE_SERIAL="" | 7 DEVICE_SERIAL="" |
8 while (( "$#" )); do | 8 while (( "$#" )); do |
9 if [[ $(echo "$1" | grep "^-d$") != "" ]]; | 9 if [[ $(echo "$1" | grep "^-d$") != "" ]]; |
10 then | 10 then |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 DEFINES="${DEFINES} skia_shared_lib=1" | 158 DEFINES="${DEFINES} skia_shared_lib=1" |
159 | 159 |
160 # Setup the build variation depending on the target device | 160 # Setup the build variation depending on the target device |
161 TARGET_DEVICE="$1" | 161 TARGET_DEVICE="$1" |
162 | 162 |
163 if [ -z "$TARGET_DEVICE" ]; then | 163 if [ -z "$TARGET_DEVICE" ]; then |
164 if [ -f .android_config ]; then | 164 if [ -f .android_config ]; then |
165 TARGET_DEVICE=$(cat .android_config) | 165 TARGET_DEVICE=$(cat .android_config) |
166 echo "INFO: no target device was specified so using the device (${TARGET_D
EVICE}) from the most recent build" | 166 echo "INFO: no target device was specified so using the device (${TARGET_D
EVICE}) from the most recent build" |
167 else | 167 else |
168 TARGET_DEVICE="arm_v7" | 168 TARGET_DEVICE="arm_v7_thumb" |
169 echo "INFO: no target device type was specified so using the default '${TA
RGET_DEVICE}'" | 169 echo "INFO: no target device type was specified so using the default '${TA
RGET_DEVICE}'" |
170 fi | 170 fi |
171 fi | 171 fi |
172 | 172 |
173 case $TARGET_DEVICE in | 173 case $TARGET_DEVICE in |
174 nexus_s) | 174 nexus_s) |
175 DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=
1" | 175 DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=
1" |
176 DEFINES="${DEFINES} skia_texture_cache_mb_limit=24" | 176 DEFINES="${DEFINES} skia_texture_cache_mb_limit=24" |
177 ANDROID_ARCH="arm" | 177 ANDROID_ARCH="arm" |
178 ;; | 178 ;; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 then | 257 then |
258 HOST_DST="${HOST_DST}/$(basename ${ANDROID_SRC})" | 258 HOST_DST="${HOST_DST}/$(basename ${ANDROID_SRC})" |
259 fi | 259 fi |
260 | 260 |
261 echo "HOST: $HOST_DST" | 261 echo "HOST: $HOST_DST" |
262 | 262 |
263 if [ -f $HOST_DST ]; | 263 if [ -f $HOST_DST ]; |
264 then | 264 then |
265 #get the MD5 for dst and src | 265 #get the MD5 for dst and src |
266 ANDROID_MD5=`$ADB $DEVICE_SERIAL shell md5 $ANDROID_SRC` | 266 ANDROID_MD5=`$ADB $DEVICE_SERIAL shell md5 $ANDROID_SRC` |
267 HOST_MD5=`md5sum $HOST_DST` | 267 if [ $(uname) == "Darwin" ]; then |
| 268 HOST_MD5=`md5 -q $HOST_DST` |
| 269 else |
| 270 HOST_MD5=`md5sum $HOST_DST` |
| 271 fi |
268 | 272 |
269 if [ "${ANDROID_MD5:0:32}" != "${HOST_MD5:0:32}" ]; | 273 if [ "${ANDROID_MD5:0:32}" != "${HOST_MD5:0:32}" ]; |
270 then | 274 then |
271 $ADB $DEVICE_SERIAL pull $ANDROID_SRC $HOST_DST | 275 $ADB $DEVICE_SERIAL pull $ANDROID_SRC $HOST_DST |
272 # else | 276 # else |
273 # echo "md5 match of android [$ANDROID_SRC] and host [$HOST_DST]" | 277 # echo "md5 match of android [$ANDROID_SRC] and host [$HOST_DST]" |
274 fi | 278 fi |
275 else | 279 else |
276 $ADB $DEVICE_SERIAL pull $ANDROID_SRC $HOST_DST | 280 $ADB $DEVICE_SERIAL pull $ANDROID_SRC $HOST_DST |
277 fi | 281 fi |
(...skipping 15 matching lines...) Expand all Loading... |
293 ANDROID_DST="${ANDROID_DST}/$(basename ${HOST_SRC})" | 297 ANDROID_DST="${ANDROID_DST}/$(basename ${HOST_SRC})" |
294 fi | 298 fi |
295 | 299 |
296 echo "ANDROID: $ANDROID_DST" | 300 echo "ANDROID: $ANDROID_DST" |
297 | 301 |
298 ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST` | 302 ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST` |
299 if [ "${ANDROID_LS:0:1}" == "-" ]; | 303 if [ "${ANDROID_LS:0:1}" == "-" ]; |
300 then | 304 then |
301 #get the MD5 for dst and src | 305 #get the MD5 for dst and src |
302 ANDROID_MD5=`$ADB $DEVICE_SERIAL shell md5 $ANDROID_DST` | 306 ANDROID_MD5=`$ADB $DEVICE_SERIAL shell md5 $ANDROID_DST` |
303 HOST_MD5=`md5sum $HOST_SRC` | 307 if [ $(uname) == "Darwin" ]; then |
| 308 HOST_MD5=`md5 -q $HOST_SRC` |
| 309 else |
| 310 HOST_MD5=`md5sum $HOST_SRC` |
| 311 fi |
304 | 312 |
305 if [ "${ANDROID_MD5:0:32}" != "${HOST_MD5:0:32}" ]; | 313 if [ "${ANDROID_MD5:0:32}" != "${HOST_MD5:0:32}" ]; |
306 then | 314 then |
307 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST | 315 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST |
308 # else | 316 # else |
309 # echo "md5 match of android [${ANDROID_DST}] and host [${HOST_SRC}]" | 317 # echo "md5 match of android [${ANDROID_DST}] and host [${HOST_SRC}]" |
310 fi | 318 fi |
311 else | 319 else |
312 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST | 320 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST |
313 fi | 321 fi |
314 } | 322 } |
315 | 323 |
316 # Set up the device. | 324 # Set up the device. |
317 setup_device "${DEVICE_ID}" | 325 setup_device "${DEVICE_ID}" |
318 if [[ "$?" != "0" ]]; then | 326 if [[ "$?" != "0" ]]; then |
319 exit 1 | 327 exit 1 |
320 fi | 328 fi |
OLD | NEW |