diff --git a/runtestsapp.sh b/runtestsapp.sh index 74b19dff2..49364a92a 100755 --- a/runtestsapp.sh +++ b/runtestsapp.sh @@ -1,5 +1,15 @@ -workingdir=./build/__TESTSAPP__ +workingdir=./.testsapprun startdir=$(pwd) + +emuProcId=".*emulator64-x86" +emuAvdName=Api19 +androidRuntimePath=/Users/erjan/tns-android.tgz + +testsAppName=TestsApp +pathToApk=./platforms/android/build/outputs/apk/$testsAppName-debug.apk +deployedAppName=org.nativescript.$testsAppName +mainActivityName=com.tns.NativeScriptActivity + rm -rd $workingdir mkdir $workingdir cd $workingdir @@ -9,16 +19,16 @@ cd $workingdir echo "------------------------------------------------" echo "Killing the emulator..." -time pkill ".*emulator64-x86" && true +time pkill $emuProcId && true echo "------------------------------------------------" echo "Starting the emulator..." -time emulator -avd Api19 -no-audio -no-window & +time emulator -avd $emuAvdName -no-audio -no-window & echo "------------------------------------------------" echo "Creating the app..." -time tns create TestsApp -cd TestsApp +time tns create $testsAppName +cd $testsAppName echo "------------------------------------------------" echo "Removing the original template files..." @@ -26,18 +36,18 @@ time rm app/*.* echo "------------------------------------------------" echo "Copying the test app files..." -time cp -r ../../../bin/dist/apps/tests/* ./app/ +time cp -r ../../bin/dist/apps/tests/* ./app/ echo "------------------------------------------------" echo "Adding the android platform..." -time tns platform add android #--frameworkPath=/Users/erjan/tns-android.tgz - -# GET THIS ONE FROM SOME PLACE... -cp /Volumes/distributions/DailyBuilds/NativeScript/android-widgets/Stable/widgets.jar platforms/android/libs/ +time tns platform add android --frameworkPath=$androidRuntimePath # #DO THE REPLACEMENTS IN THE Info.plist and AndroidManifest.xml cp /Users/erjan/work/spikes/__DEL__/AndroidManifest.xml platforms/android/src/main/ +# GET THIS ONE FROM SOME PLACE... +cp /Volumes/distributions/DailyBuilds/NativeScript/android-widgets/Stable/widgets.jar platforms/android/libs/ + echo "------------------------------------------------" echo "Building the application..." time tns build android @@ -52,15 +62,15 @@ time adb start-server echo "------------------------------------------------" echo "Uninstalling the app..." -time adb uninstall org.nativescript.TestsApp +time adb uninstall $deployedAppName echo "------------------------------------------------" echo "Installing the app..." -time adb install ./platforms/android/build/outputs/apk/TestsApp-debug.apk +time adb install $pathToApk echo "------------------------------------------------" echo "Starting the app..." -time adb shell am start -n org.nativescript.TestsApp/com.tns.NativeScriptActivity +time adb shell am start -n $deployedAppName/$mainActivityName cd $startdir @@ -68,4 +78,4 @@ echo "------------------------------------------------" echo "Waiting for the tests to finish executing..." time ./expect.exp -pkill ".*emulator64-x86" && true +pkill $emuProcId && true