Software Installation:
1. Install Jenkins, git, androidsdk
2. Configuring ANDROIDSDK Environment variables
Android_home:d:\androidsdk
Path:%android_home%\platform-tools;%android_home%\tools
Environment configuration:
1. Open Jenkins Home page, enter system Management--plugin management--Optional plugin list, install Gradleplugin, Gitplugin, Publishoverftpplugin
2. Enter system settings , set environment variables, configure FTP connection information
3. Go to the Global tool Configuration page, set up JDK, git, gradle installation directory
New Task & Configuration Job
1. Create Job
Set the parameterized build, debug is open debugging, release is off debugging
Ps:gradle default cache directory under the C disk, the cache path is longer, compile error, as shown, so we have to create a new cache directory under the other disk, and then compile the command followed by the-g+ cache path. So the problem is solved.
Upload apk to ftp specified directory
Return to the job list, choose Build with parameters, choose Debug or Release, click Start Build
Build success
After uploading successfully, visit FTP to view
Jenkins+gradle+git APK package automatically and upload to FTP