From 1c064b09227168242a3c78229f92d573ab7d7a73 Mon Sep 17 00:00:00 2001 From: brianleroux Date: Thu, 18 Aug 2011 22:40:09 -0700 Subject: [PATCH] test fully automated from mobile-spec edge --- README.md | 16 +++++++++++----- bin/create | 3 ++- bin/test | 6 ++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c745a046..4fa768a3 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Commands ./bin/log .............................. starts logging to stdout ./bin/test ............................. run mobile-spec -Usage +Running the Example Project # start avd (emulator) named 'default' ./bin/emulate @@ -34,6 +34,14 @@ Usage # start logging to stdout ./bin/log +Running Mobile-Spec + + ./bin/test + +Create a new PhoneGap/Android Project + + ./bin/create ~/Desktop/myapp com.phonegap.special MyApp + Importing a PhoneGap/Android app into Eclipse --------------------------------------------- @@ -70,10 +78,8 @@ Debugging Attach it to a process on the device - $ adb jdwp - adb forward tcp:8000 jdwp: jdb -attach localhost:8000 - - + adb jdwp + For more info see ----------------- - [http://docs.phonegap.com](http://docs.phonegap.com) diff --git a/bin/create b/bin/create index 07d497a1..502e831e 100755 --- a/bin/create +++ b/bin/create @@ -8,7 +8,8 @@ PROJECT_PATH=${1:-"./example"} PACKAGE=${2:-"com.phonegap.example"} ACTIVITY=${3:-"PhoneGapExample"} -ACTIVITY_PATH=$PROJECT_PATH/src/com/phonegap/example/$ACTIVITY.java +PACKAGE_AS_PATH=$(echo $PACKAGE | sed 's/\./\//g') +ACTIVITY_PATH=$PROJECT_PATH/src/$PACKAGE_AS_PATH/$ACTIVITY.java TARGET=$(android list targets | grep 'id: ' | sed 's/id: \([0-9]\).*/\1/g' | tail -1) VERSION=$(cat ./VERSION) diff --git a/bin/test b/bin/test index 1c709c2a..1edbed90 100755 --- a/bin/test +++ b/bin/test @@ -11,7 +11,7 @@ then fi # generate a working proj -./bin/create ./test +./bin/create ./test com.phonegap.test PhoneGapTest # kill the default app and replace it w/ mobile-spec rm -rf ./test/assets/www @@ -19,6 +19,4 @@ mv ./mobile-spec ./test/assets/www cp ./framework/assets/www/phonegap-$VERSION.js ./test/assets/www/phoengap-$VERSION.js # build it, launch it and start logging on stdout -cd ./test && ./../bin/debug -adb shell am start -n com.phonegap.example/com.phonegap.example.PhoneGapExample -./../bin/log +cd ./test && ./../bin/debug && ./../bin/log