1@echo off 2rem Copyright (C) 2008 The Android Open Source Project 3rem 4rem Licensed under the Apache License, Version 2.0 (the "License"); 5rem you may not use this file except in compliance with the License. 6rem You may obtain a copy of the License at 7rem 8rem http://www.apache.org/licenses/LICENSE-2.0 9rem 10rem Unless required by applicable law or agreed to in writing, software 11rem distributed under the License is distributed on an "AS IS" BASIS, 12rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13rem See the License for the specific language governing permissions and 14rem limitations under the License. 15 16rem don't modify the caller's environment 17setlocal 18 19rem Set up prog to be the path of this script, including following symlinks, 20rem and set up progdir to be the fully-qualified pathname of its directory. 21set prog=%~f0 22 23rem Change current directory and drive to where the script is, to avoid 24rem issues with directories containing whitespaces. 25cd /d %~dp0 26 27rem Get the CWD as a full path with short names only (without spaces) 28for %%i in ("%cd%") do set prog_dir=%%~fsi 29 30rem Check we have a valid Java.exe in the path. 31set java_exe= 32call lib\find_java.bat 33if not defined java_exe goto :EOF 34 35set jarfile=hierarchyviewer2.jar 36set frameworkdir= 37set libdir= 38 39if exist %frameworkdir%%jarfile% goto JarFileOk 40 set frameworkdir=lib\ 41 42if exist %frameworkdir%%jarfile% goto JarFileOk 43 set frameworkdir=..\framework\ 44 45:JarFileOk 46 47if debug NEQ "%1" goto NoDebug 48 set java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y 49 shift 1 50:NoDebug 51 52set jarpath=%frameworkdir%%jarfile%;%frameworkdir%hierarchyviewerlib.jar;%frameworkdir%swtmenubar.jar 53 54if not defined ANDROID_SWT goto QueryArch 55 set swt_path=%ANDROID_SWT% 56 goto SwtDone 57 58:QueryArch 59 60 for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a 61 62:SwtDone 63 64if exist %swt_path% goto SetPath 65 echo SWT folder '%swt_path%' does not exist. 66 echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform. 67 exit /B 68 69:SetPath 70 71echo The standalone version of hieararchyviewer is deprecated. 72echo Please use Android Device Monitor (tools/monitor.bat) instead. 73call %java_exe% %java_debug% -Xmx512m -Dcom.android.hierarchyviewer.bindir=%prog_dir% -classpath "%jarpath%;%swt_path%\swt.jar" com.android.hierarchyviewer.HierarchyViewerApplication %* 74 75 76