aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar liyuqian <liyuqian@google.com>2016-07-12 09:12:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-12 09:12:39 -0700
commite7d15fe870e8d6b0d4b072fc02a2a1c079743485 (patch)
tree01758302f954e4d14cf2b3ff17537680c1d0ca5b
parent1264472c06cebd283d1ec123014c58f5d3c4cad1 (diff)
Update documents/scripts for SampleApp removal
-rwxr-xr-xplatform_tools/android/bin/android_gdb_app21
-rwxr-xr-xplatform_tools/android/bin/android_install_app22
-rwxr-xr-xplatform_tools/android/bin/android_launch_app18
-rw-r--r--site/user/quick/android.md46
4 files changed, 31 insertions, 76 deletions
diff --git a/platform_tools/android/bin/android_gdb_app b/platform_tools/android/bin/android_gdb_app
index 68d517b9a0..e6a96fee7c 100755
--- a/platform_tools/android/bin/android_gdb_app
+++ b/platform_tools/android/bin/android_gdb_app
@@ -1,30 +1,17 @@
#!/bin/bash
#
-# android_gdb_app: Pushes gdbserver, launches sampleApp, and connects
+# android_gdb_app: Pushes gdbserver, launches Viewer, and connects
# the debugging environment.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/android_setup.sh "$@"
source $SCRIPT_DIR/utils/setup_adb.sh
-app=${APP_ARGS[0]}
-if [[ ${app} == '-'* ]]; then
- echo "Defaulting to running SampleApp."
- app="SampleApp"
- APP_ARGS=( "SampleApp" ${APP_ARGS[*]} )
-fi
+APP_ARGS=( "Viewer" ${APP_ARGS[*]} )
PORT=5039
-if [[ ${app} == 'SampleApp' ]]; then
- activity="com.skia.sample_app/com.skia.SkiaSampleActivity"
- activityShort="com.skia.sample_app"
-elif [[ ${app} == "Viewer" ]] ; then
- activity="org.skia.viewer/org.skia.viewer.ViewerActivity"
- activityShort="org.skia.viewer"
-else
- echo "ERROR: supports either 'SampleApp' or 'Viewer' as valid apps"
- exit 1
-fi
+activity="org.skia.viewer/org.skia.viewer.ViewerActivity"
+activityShort="org.skia.viewer"
# Forward local to remote socket connection.
$ADB $DEVICE_SERIAL forward "tcp:$PORT" "tcp:$PORT"
diff --git a/platform_tools/android/bin/android_install_app b/platform_tools/android/bin/android_install_app
index 74aea516c3..fe16cd5285 100755
--- a/platform_tools/android/bin/android_install_app
+++ b/platform_tools/android/bin/android_install_app
@@ -3,13 +3,12 @@
# android_install_app: installs the Skia development apps on the device.
function print_usage {
- echo "USAGE: android_install_app [options] AppName"
+ echo "USAGE: android_install_app [options]"
echo " Options: -f Forces the package to be installed by removing any"
echo " previously installed packages"
echo " -h Prints this help message"
echo " --release Install the release build of Skia"
echo " -s [device_s/n] Serial number of the device to be used"
- echo " AppName Can be either SampleApp or Viewer"
}
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -18,7 +17,6 @@ source $SCRIPT_DIR/android_setup.sh
source $SCRIPT_DIR/utils/setup_adb.sh
forceRemoval="false"
-app=""
for arg in ${APP_ARGS[@]}; do
if [[ "${arg}" == "-f" ]]; then
@@ -32,21 +30,9 @@ for arg in ${APP_ARGS[@]}; do
echo "ERROR: unrecognized option ${arg}"
print_usage
exit 1;
- else
- if [[ ${app} != "" ]]; then
- echo "ERROR: app already defined ${app}"
- exit 1;
- else
- app=${arg}
- fi
fi
done
-if [[ ${app} == "" ]]; then
- echo "Defaulting to installing SampleApp."
- app="SampleApp"
-fi
-
if [[ "$forceRemoval" == "true" ]];
then
@@ -61,11 +47,7 @@ else
apk_suffix="debug.apk"
fi
-if [[ ${app} == 'SampleApp' ]]; then
- app="sample_app"
-fi
-
-APP_LC=$(echo $app | tr "[:upper:]" "[:lower:]")
+APP_LC=$(echo Viewer | tr "[:upper:]" "[:lower:]")
echo "Installing ${APP_LC} from ${APP_LC}/build/outputs/apk/${APP_LC}-${ANDROID_ARCH}-${apk_suffix}"
$ADB ${DEVICE_SERIAL} install -r ${SCRIPT_DIR}/../apps/${APP_LC}/build/outputs/apk/${APP_LC}-${ANDROID_ARCH}-${apk_suffix}
diff --git a/platform_tools/android/bin/android_launch_app b/platform_tools/android/bin/android_launch_app
index 93bd1f70ad..0e65ba143d 100755
--- a/platform_tools/android/bin/android_launch_app
+++ b/platform_tools/android/bin/android_launch_app
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# android_launch_app: Launches the skia sampleApp on the device.
+# android_launch_app: Launches the skia Viewer app on the device.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/android_setup.sh
@@ -12,19 +12,5 @@ if [[ -n $RESOURCE_PATH ]]; then
adb_push_if_needed "${SKIA_SRC_DIR}/resources" $RESOURCE_PATH
fi
-app=${APP_ARGS[0]}
-if [[ ${app} == '-'* ]]; then
- echo "Defaulting to running SampleApp."
- app="SampleApp"
- APP_ARGS=( "SampleApp" ${APP_ARGS[*]} )
-fi
-
-if [[ ${app} == 'SampleApp' ]]; then
- activity="com.skia.sample_app/com.skia.SkiaSampleActivity"
-elif [[ ${app} == "Viewer" ]] ; then
- activity="org.skia.viewer/org.skia.viewer.ViewerActivity"
-else
- echo "ERROR: supports either 'SampleApp' or 'Viewer' as valid apps"
- exit 1
-fi
+activity="org.skia.viewer/org.skia.viewer.ViewerActivity"
$ADB ${DEVICE_SERIAL} shell "am start -S -n ${activity} --es cmdLineFlags \"${APP_ARGS[*]:1}\""
diff --git a/site/user/quick/android.md b/site/user/quick/android.md
index 53e7139215..078b8d2313 100644
--- a/site/user/quick/android.md
+++ b/site/user/quick/android.md
@@ -15,10 +15,10 @@ The following libraries/utilities are required in addition to those needed for a
Check out the source code
-------------------------
-Follow the instructions [here](../download) for downloading the Skia source.
+Follow the instructions [here](../download) for downloading the Skia source.
Inside your Skia checkout, `platform_tools/android` contains the Android setup
-scripts, Android specific dependencies, and the Android Sample App.
+scripts, Android specific dependencies, and the Android Viewer App.
You may need to [install other dependencies](./linux#prerequisites):
@@ -40,12 +40,12 @@ where you installed the SDK and run the following commands
From here you will need to type 'y' to approve the license agreement and that
is all. You will then have downloaded the SDK for API level 19 and 23(Android 4.4
-KitKat and Android 6.0 Marshmallow) which will be used to build the Skia SampleApp.
-You can download as many other Android add-ons or APIs as you want, but you only
+KitKat and Android 6.0 Marshmallow) which will be used to build the Skia Viewer app.
+You can download as many other Android add-ons or APIs as you want, but you only
are required to have these two in order to complete the Skia build process.
The last line in the script installs Android SDK Build-tools 22.0.1.
-Alternatively you can download the above packages with Android Studio, by clicking
+Alternatively you can download the above packages with Android Studio, by clicking
the Launch Standalone SDK Manager link in Tools > Android > SDK Manger.
Setup Environment for Android
@@ -134,51 +134,51 @@ approach will also produce the noisiest results.
# <input> is file/dir on device
./platform_tools/android/bin/android_run_skia --release nanobench --skps <input>
-Build and run SampleApp
+Build and run Viewer App
-----------------------
-The SampleApp on Android provides a simple UI for viewing sample slides and gm images.
+The Viewer App on Android provides a simple UI for viewing sample slides and gm images.
- BUILDTYPE=Debug ./platform_tools/android/bin/android_ninja -d $TARGET_DEVICE SampleApp_APK
+ BUILDTYPE=Debug ./platform_tools/android/bin/android_ninja -d $TARGET_DEVICE Viewer_APK
Then, install the app onto the device:
./platform_tools/android/bin/android_install_app
-Finally to run the application you can either navigate to the Skia Samples
+Finally to run the application you can either navigate to the Skia Viewer
application using the application launcher on your device or from the command
line. The command line option allows you to pass additional details to the
application (similar to other operating system) that specify where to find
-skp files and other resources.
+skp files and other resources. For example:
- ./platform_tools/android/bin/android_launch_app --resourcePath /data/local/tmp/resources
+ ./platform_tools/android/bin/android_launch_app --resources /data/local/tmp/skia
-By default if no additional parameters are specified the app will use the default
-parameters...
+By default if no additional parameters are specified the app will also have the following
+default parameters:
- --resourcePath /data/local/tmp/skia_resoures
- --pictureDir /data/local/tmp/skia_skp
+ --skps /data/local/tmp/skia
+ --jpgs /data/local/tmp/skia
Android Studio Support
-----------------------
-You can also build and run SampleApp (and some other experimental apps) using Android
+You can also build and run Viewer App (and some other experimental apps) using Android
Studio. To create the project either select "import project" from the quickstart
screen or use File -> Open. In both cases you'll need to select ./platform_tools/android/apps
as the root directory of your project.
-Finally to be able to build within Android studio it needs to know the path to
+Finally to be able to build within Android studio it needs to know the path to
ninja so you will need to add a properties file and populate it with the path
to depot_tools. The syntax and location of that file is...
-
- #
+
+ #
# file location: ./platform_tools/android/apps/gradle.properties
#
depot_tools.dir=<path_to_depot_tools>
-
+
That should be all the setup you need. You should now be able to build and deploy
-SampleApp on ARM, Intel, and MIPS devices.
+Viewer App on ARM, Intel, and MIPS devices.
Build tools
@@ -204,8 +204,8 @@ Note: The debugging scripts do not build the app - you'll have to do that first.
# COMMAND LINE APPS
# include additional arguments in quotes (e.g. "dm --nopdf")
./platform_tools/android/bin/android_gdb_native dm
-
- # SAMPLE APP
+
+ # VIEWER APP
# make sure you've installed the app on the device first
./platform_tools/android/bin/android_gdb_app [-d device_id]