【一键构建PhoneGap构建到Android】冲天香阵透长安,满城尽带黄金甲。这篇文章主要讲述一键构建PhoneGap构建到Android相关的知识,希望能为你提供帮助。
Basically allows for a one click build through a repository driving PhoneGap Build project.
- #! /bin/sh
- project=" [phonegap projectnumber]" ;
- username=" [phonegap username]" ;
- password=" [phonegap password]" ;
- appPath=" [path to www folder]" ;
- projectPath=" [path where you want the apk file]" ;
- APIPATH=" https://build.phonegap.com/api/v1/apps" ;
- FILEPATH=" https://build.phonegap.com/apps/" ;
- APIcall=" $APIPATH/$project"
- creds=" $username:$password" ;
- ##commit changes
- echo " Forcing changes to github" ;
- cd $appPath
- null=$( git commit -m " auto commit as part of script" ) ;
- null=$( git push origin master) ;
- echo " Done" ;
- cd $projectPath
- ##Request Phonegap data
- echo " Requesting Project Data." ;
- package=$( curl -s -u $creds$APIcall | grep -Po '" package" :.*?[^\],') ;
- title=$( curl -s -u $creds$APIcall | grep -Po '" title" :.*?[^\],') ;
- title=${title##*:};
- title=$( echo $title|sed 's/,//g') ;
- title=$( echo $title|sed 's/" //g') ;
- package=${package##*:};
- package=$( echo $package|sed 's/,//g') ;
- package=$( echo $package|sed 's/" //g') ;
- echo " Done. " ;
- ##Request Rebuild
- echo " Requesting Rebuild." ;
- request=$( curl -s -u $creds -X PUT -d 'data=https://www.songbingjia.com/android/{" pull" :" true" }' $APIcall) ;
- echo " Done. " ;
- donecheck=" " ;
- echo " Waiting for rebuild to be done." ;
- while [ $donecheck -eq " " ]
- do
- echo " ." ;
- sleep 10;
- donecheck=$( curl -s -u $creds$APIcall | grep -Po '" android" :" complete" ') ;
- done
- echo " Done. Now downloading. " ;
- ##Download File
- download=$( curl -L -s -u $creds -o $title-debug.apk $FILEPATH/$project/download/android) ;
- ##Install on Device
- ~/Downloads/android-sdk/platform-tools/adb uninstall $package
- ~/Downloads/android-sdk/platform-tools/adb install -r ./$title-debug.apk
推荐阅读
- PhoneGap项目的Android元视口标记
- Android检查服务是否正在运行
- 钛Appcelerator zipfile模块(适用于1.8的提取方法)
- Favicon和Apple Touch图标
- Applescript以使用特定编辑器在finder中打开选定的文件
- 使用Xamarin构建跨平台应用程序(Android开发人员的视角)
- Android DDMS(终极Android控制台指南)
- 如何实现像素完美的iOS UI设计
- iOS集中和解耦的网络(一个单例类的AFNetworking教程)