From b6cdcf44d4923215fa7c1f89f2480fafd2355dca Mon Sep 17 00:00:00 2001 From: Gun Kim Date: Sun, 16 Dec 2012 18:17:36 +0900 Subject: [PATCH] [Title] modified native-cli [Type] [Module] [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] Change-Id: Ia3f50063f3db6d290d3299c83eb77aff67e1d30a --- org.tizen.cli/doc/install/native_bin/native-debug | 58 +++++++-------- .../doc/install/native_bin/native-install | 14 ++-- org.tizen.cli/doc/install/native_bin/native-make | 38 ++++++++++ .../doc/install/native_bin/native-packaging | 83 +++++++++++++++++++++- org.tizen.cli/doc/install/native_bin/native-run | 15 ++-- .../doc/install/native_bin/native-uninstall | 10 +-- 6 files changed, 172 insertions(+), 46 deletions(-) diff --git a/org.tizen.cli/doc/install/native_bin/native-debug b/org.tizen.cli/doc/install/native_bin/native-debug index 92ac4fc..96e04b2 100755 --- a/org.tizen.cli/doc/install/native_bin/native-debug +++ b/org.tizen.cli/doc/install/native_bin/native-debug @@ -1,4 +1,4 @@ -#!/bin/sh -x +#!/bin/sh SUBSTRING_START_POSITION=2 @@ -21,11 +21,12 @@ init() { } usage() { - echo "Usage: $0 [options]" - echo " -s, --serial \t\tdirects command to the USB device or emulator with" - echo "\t\t\t\t\tthe given serial number." - echo " -a, --appid \t\t\tdebugs the application on target." - echo " -b, --binary \t\tdebugs this binary on target." + echo "usage: $0 -p [options]" + echo " -s,--serial \tdirect command to the USB device or emulator with" + echo "\t\t\t\tthe given serial number" + echo " -p,--package \tdebug the application given on the target" + echo " -b,--binary \tdebug the application given ." + echo "\t\t\t\ton the target" } getBinaryFile() { @@ -41,7 +42,7 @@ getBinaryFile() { str=`expr substr "$i" "$start_pos" "$extension_length"` if [ "$str" = "$extension" ] then - BINARY=$i + BINARY=`expr substr "$i" "1" "$length"` if [ -z "$binary_list" ] then binary_list=$i @@ -83,7 +84,7 @@ parse_param() { serial=$2 shift 2; ;; - -a|--appid) + -p|--package) if [ -z "$2" ] then usage @@ -108,22 +109,6 @@ parse_param() { esac done - devices=`sdb devices | wc -l` - if [ "$devices" -lt 2 ] - then - echo "error: device not found" - exit 2; - fi - - if [ "$devices" -gt 2 ] - then - if [ -z "$serial" ] - then - echo "error: more than one device and emulator" - exit 2; - fi - fi - SDB_COMMAND="$SDB" if [ -n "$serial" ] then @@ -140,16 +125,33 @@ parse_param() { then getBinaryFile fi + + devices=`$SDB_COMMAND devices | wc -l` + if [ "$devices" -lt 2 ] + then + echo "error: device not found" + exit 2; + fi + + if [ "$devices" -gt 2 ] + then + if [ -z "$serial" ] + then + echo "error: more than one device and emulator" + exit 2; + fi + fi } launch_gdbserver() { - target_install_path=/opt/apps/$appid/bin/$BINARY + target_install_path="/opt/apps/$appid/bin/$BINARY" gdbserver_command="/home/developer/sdk_tools/gdbserver/gdbserver :26102 $target_install_path" - sdb_gdbserver_command="$SDB_COMMAND shell $gdbserver_command" - $sdb_gdbserver_command 2> /dev/null & + sdb_gdbserver_command="$SDB_COMMAND shell $gdbserver_command 2> /dev/null" + + + $sdb_gdbserver_command & sleep 1 - echo ""; } launch_gdb() { diff --git a/org.tizen.cli/doc/install/native_bin/native-install b/org.tizen.cli/doc/install/native_bin/native-install index cfb5631..878e492 100755 --- a/org.tizen.cli/doc/install/native_bin/native-install +++ b/org.tizen.cli/doc/install/native_bin/native-install @@ -20,10 +20,10 @@ SDB="$TOOLS_HOME/sdb" usage() { - echo "Usage: $0 [options]" - echo " -s, --serial \t\tdirects command to the USB device or emulator with" - echo "\t\t\t\t\tthe given serial number." - echo " -p, --package \t\tpush tpk package file and install it." + echo "usage: $0 -p [options]" + echo " -s,--serial \tdirect command to the USB device or emulator with" + echo "\t\t\t\tthe given serial number" + echo " -p,--package \tpush given tpk file and install it." } until [ -z "$1" ] @@ -88,4 +88,10 @@ fi command="$command install $package" $command +result=`echo $?` +if [ "$result" = "0" ] +then + echo "You can launch the application using \"native-run\"." + echo "And you can debug the application using \"native-debug\"." +fi diff --git a/org.tizen.cli/doc/install/native_bin/native-make b/org.tizen.cli/doc/install/native_bin/native-make index 4273ccd..18ae79b 100755 --- a/org.tizen.cli/doc/install/native_bin/native-make +++ b/org.tizen.cli/doc/install/native_bin/native-make @@ -18,6 +18,44 @@ TOOLS_HOME="$DIR_BIN/../.." command="$TOOLS_HOME/smart-build-interface/bin/sbi_make $@" +usage() { + echo "usage: $0 [options]" + echo " -t,--target " + echo " clean" +} + +until [ -z "$1" ] +do + case "$1" + in + -h|--help) + usage; + exit; + ;; + -t|--target) + if [ "emulator" != "$2" -a "device" != $2] + then + usage + exit; + fi + shift 2; + ;; + clean) + shift; + ;; + *) + usage + exit; + ;; + esac +done + + $command +result=`echo $?` +if [ "$result" = "0" ] +then + echo "You can packaging the project using \"native-packaging\"." +fi exit $?; diff --git a/org.tizen.cli/doc/install/native_bin/native-packaging b/org.tizen.cli/doc/install/native_bin/native-packaging index 66f0ddb..38f97a5 100755 --- a/org.tizen.cli/doc/install/native_bin/native-packaging +++ b/org.tizen.cli/doc/install/native_bin/native-packaging @@ -18,6 +18,85 @@ TOOLS_HOME="$DIR_BIN/../.." command="$TOOLS_HOME/smart-build-interface/bin/sbi_pack $@" -$command +usage() { + echo "usage: $0 [options]" + echo " -t,--target " + echo " --sign_cert_dir " + echo " --sign_author_key " + echo " --sign_author_pwd " + echo " --sign_dist_key " + echo " --sign_dist_pwd " +} + +until [ -z "$1" ] +do + case "$1" + in + -h|--help) + usage; + exit; + ;; + -t|--target) + if [ "emulator" != "$2" -a "device" != $2] + then + usage + exit; + fi + shift 2; + ;; + --sign_cert_dir) + if [ -z "$2" ] + then + usage + exit; + fi + shift 2; + ;; + --sign_author-key) + if [ -z "$2" ] + then + usage + exit; + fi + shift 2; + ;; + --sign_author_pwd) + if [ -z "$2" ] + then + usage + exit; + fi + shift 2; + ;; + --sign_dist_key) + if [ -z "$2" ] + then + usage + exit; + fi + shift 2; + ;; + --sign_dist_pwd) + if [ -z "$2" ] + then + usage + exit; + fi + shift 2; + ;; + clean) + shift; + ;; + *) + usage + exit; + ;; + esac +done -exit $?; +$command +result=`echo $?` +if [ "$result" = "0" ] +then + echo "You can install the tpk file using \"native-install\"." +fi diff --git a/org.tizen.cli/doc/install/native_bin/native-run b/org.tizen.cli/doc/install/native_bin/native-run index 7d18dcf..6e5fe25 100755 --- a/org.tizen.cli/doc/install/native_bin/native-run +++ b/org.tizen.cli/doc/install/native_bin/native-run @@ -1,4 +1,4 @@ -#!/bin/sh -x +#!/bin/sh SUBSTRING_START_POSITION=2 @@ -21,11 +21,12 @@ LAUNCH_APP="launch_app" usage() { - echo "Usage: $0 [options]" - echo " -s, --serial \t\tdirects command to the USB device or emulator with" - echo "\t\t\t\t\tthe given serial number." - echo " -a, --appid \t\t\tlaunches the application on target." - echo " -b, --binary \t\tlaunches this binary on target." + echo "usage: $0 -p [options]" + echo " -s,--serial \tdirects command to the USB device or emulator with" + echo "\t\t\t\tthe given serial number." + echo " -p,--package \tlaunch the application given on the target." + echo " -b,--binary \tlaunch the application given ." + echo "\t\t\t\ton the target." } getBinaryFile() { @@ -82,7 +83,7 @@ do serial=$2 shift 2; ;; - -a|--appid) + -p|--package) if [ -z "$2" ] then usage diff --git a/org.tizen.cli/doc/install/native_bin/native-uninstall b/org.tizen.cli/doc/install/native_bin/native-uninstall index 64ab52b..e3b5873 100755 --- a/org.tizen.cli/doc/install/native_bin/native-uninstall +++ b/org.tizen.cli/doc/install/native_bin/native-uninstall @@ -19,10 +19,10 @@ SDB="$TOOLS_HOME/sdb" usage() { - echo "Usage: $0 [options]" - echo " -s, --serial \t\tdirects command to the USB device or emulator with" - echo "\t\t\t\t\tthe given serial number." - echo " -a, appid \t\t\tuninstall this app from the device." + echo "usage: $0 -p [options]" + echo " -s,--serial \tdirects command to the USB device or emulator with" + echo "\t\t\t\tthe given serial number." + echo " -p,package \t\tuninstall this package from the device." } until [ -z "$1" ] @@ -42,7 +42,7 @@ do serial=$2 shift 2; ;; - -a|--appid) + -p|--package) if [ -z "$2" ] then usage -- 2.7.4