Recently, I was working on a project in which we have a code-base and we make some changes in the application and make the application available for testing to the tester.
The changes are variables changes such as our test site name, icon and splash screen.
What we are trying to achieve is that without opening Android Studio, we can make the application package(.apk) for the code base that we have. It will save a lot of time for us
We have searched for several options which are Jenkins CI etc, but have not been able to do so.
Any sort of help regarding this topic will be appreciated.
You can run a gradle task from the console / terminal.
Go to the project root folder and run gradle + command, generally the command is gradle assembleDebug or gradle assembleRelease depending on the build type you are aiming for.
You can check the existing gradle tasks on Android Studio
Related
I updated my mac Android studio to version "Electric Eel"
When I just try to generate the APK using "Build APK" option, then it automatically starts running the test cases, which is unnecessarily causing me further issues and slowing down the process.
"I want to know if there is any option available, where I can disable running the test cases while just building the APK.?"
PS:
I have explored it at many places but not getting exact option to configure it.
I am only able to generate the APK using command ./gradlew assemblePreProdDebug (PreProd is flavour), it works without the test cases being executed.
When I select the device and run the build, it works fine, it runs without the test cases being executed.
You can use gradle panel to launch the task you want.In order to make your build task appear you will have to:
go to the Prefrences > Experimental
In gradle section uncheck "Only include test tasks in the Gradle task list generated during Gradle Sync" (pay attention that may have an impact on gradle sync task execution time depending on the complexity of your project).
Apply change then click on gradle sync button
Then you should be able to see the assemble tasks in the gradle side panel.
I'm new to android and android studio is taking too long to build
and I'mscreenshoot not sure why
I have noticed that sometimes Android Studio builds either get stuck or slow down for seemingly no reason. First thing to try would be to quit Android Studio, then run ./gradlew --stop from the command line to make sure any Gradle deamons have been shut down completely. You may also want to do a ./gradlew clean to get rid of any intermediate files that might be troubling the build.
If that doesn't help, you may need to look into optimizing your build. There are lots of resources on the web, but you might want to start with the Android team's list of ideas.
Recently I have updated my android studio v3.0 to v3.1.
in v3.0 when I click on Run button. It automatically complies builds apk and installs app on my phone.
But at newer version I have ti rebuild app each time before running application. Otherwise it installs previous compiled APK on my phone. Is their a way to do both at on button click.
because its frustrating.
I have searched in settings but no option found.
I had the same problem. I fixed the problem provisionally, adding the task 'app: clean' in the Run / Debug Configuratrions before the app is "made". It takes much longer to compile and build the app than before, but it will always install the latest version, at least for me.
Open the Run / Debug Configurations. Can be found to the left of the Run Button.
Run / Debug Configurations
In the configurations you will find at the bottom the section "Before launch". There, you are leaving out "Run Gradle Task".
Adding Run Gradle Task
Under Project you choose your current project and at Task you choose clean.
Select settings
Importantly, the Gradle Task is at the top of the list!
mind the order
Run project
Hope I could help you with that
I have successfully automated my test in ADF using Appium TestNG framework. I was trying to run the same build in Jenkins for continuous integration.
I have taken freestyle project in Jenkins.I am getting error. It is unable to find the pattern of .apk file. I am giving Application name the just apk file name e.g. android-debug.apk and in the test giving the" target/zip-with-dependencies.zip.But I am getting following error:enter image description here
Below is the picture of my configuration settings:enter image description here
Please provide my solution of this issue.
I work for the AWS Device farm team.
Good to hear that you are using the Jenkins plugin.
The plugin configuration takes your application and tests files assuming it is a part of your workspace.
Way to approach this :
Trigger a run without any tests or apps. This will create the workspace folder for a project if it is the first run.
Thereafter your tests and app go under the workspace which you can upload through the UI or place in the workspace folder on your Jenkins project.
The path in this case becomes **/yourapk.apk for your application and **/tests.zip for your tests.
Hope that unblocks you. If not let me know and I can help you further.
I am trying to set up a CI environment with Jenkins and Robotium. I want to use the same project for both built and test, but seems so tricky to get all working. I was wondering if someone had something like that working and if it can publish at least build.gradle and the project structure. Thanks.
Have been running in production for a few months now. See this question for a sample project and video of how to use robotium with gradle.
https://stackoverflow.com/a/23295849/1965124
As for the jenkins side of things:
Install the android sdk on the machine that will be running jenkins
set up android home variable
install the android plugin
run the following tasks from inside a jenkins job: clean connectedAndroidTest
after running 1 build (it will fail the first time), change the local.properties file to point to the local installation of the android sdk.
Let me know if you need any more pointers, its not as hard as I initially thought it would be.
I configured TeamCity as CI server. Also, project builds by Gradle.
The main idea is to execute gradle connectedInstrumentTest, that task will execute all project's tests on all connected devices, then it will put the test results in standard ant-junit format, so then you can set Jenkins to parse app-folder/build/instrumentTest-results/connected/*.xml test results.
If you got more questions, you can post them to the comments.