• This repository has been archived on 07/Dec/2019
  • Stars
    star
    201
  • Rank 194,455 (Top 4 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reactive tool to create and start multiple Android Emulators in parallel.

Swarmer โ€” create, start and wait for Android emulators to boot in parallel.

Swarmer is a replacement for such bash scripts but with features like:

  • Start multiple Android Emulators and wait for each to boot in parallel.
  • Pass config.ini that'll be applied to created emulator.
  • Redirect Logcat output of an emulator to a file.

Demo

How to use

Swarmer shipped as jar, so just run it java -jar swarmer.jar options.

Dependencies:

Commands

Start

java -jar swarmer.jar start โ€ฆ
Options
Required
  • --emulator-name
    • Name of the emulator, i.e. test_emulator_1.
  • --package
    • Package of the system image for this AVD (e.g.'system-images;android-25;google_apis;x86') to pass to avdmanager create avd --package.
  • --android-abi
    • Android system image abi, i.e. google_apis/x86_64.
  • --path-to-config-ini
    • Path either relative or absolute to the file that will be used as config.ini for created emulator.
    • Easiest way to get config.ini is to create AVD on your machine using Android Studio and then copy config from ~/.android/avd/device_name.avd/config.ini.
    • We recommend to keep config.ini in version control so your team members could review it and builds will be reproducible.
Optional
  • --help, -help, help, -h
    • Print help and exit.
  • --emulator-start-options
    • Options to pass to emulator -avd \$emulatorName command, i.e. --no-window -prop persist.sys.language=en -prop persist.sys.country=US.
  • --emulator-start-timeout-seconds
    • Timeout to wait for emulator to finish boot. Default value is 180 seconds.
  • --redirect-logcat-to
    • Path either relative or absolute to the file that will be used to redirect logcat of started emulator to. No redirection will happen if parameter is not presented.
  • --keep-existing-avds
    • Avoid recreating avds and reuse existing ones whenever possible.
Examples
Start one emulator
java -jar swarmer.jar start \
--emulator-name test_emulator_1 \
--package "system-images;android-25;google_apis;x86" \
--android-abi google_apis/x86_64 \
--path-to-config-ini emulator_config.ini \
--emulator-start-options -prop persist.sys.language=en -prop persist.sys.country=US \
--redirect-logcat-to test_emulator_1_logcat.txt
Start two emulators in parallel
java -jar swarmer.jar start \
--emulator-name test_emulator_1 \
--package "system-images;android-25;google_apis;x86" \
--android-abi google_apis/x86_64 \
--path-to-config-ini emulator_config1.ini \
--emulator-start-options -prop persist.sys.language=en -prop persist.sys.country=US \
--redirect-logcat-to test_emulator_1_logcat.txt \
--emulator-name test_emulator_2 \
--package "system-images;android-23;google_apis;x86" \
--android-abi google_apis/x86_64 \
--path-to-config-ini emulator_config2.ini \
--emulator-start-options -prop persist.sys.language=en -prop persist.sys.country=US \
--redirect-logcat-to test_emulator_2_logcat.txt
Start two emulators sequentially
java -jar swarmer.jar start \
--emulator-name test_emulator_1 \
--android-target android-25 \
--android-abi google_apis/x86_64 \
--path-to-config-ini emulator_config.ini \
--emulator-start-options -prop persist.sys.language=en -prop persist.sys.country=US \
--redirect-logcat-to test_emulator_1_logcat.txt

java -jar swarmer.jar start \
--emulator-name test_emulator_2 \
--package "system-images;android-23;google_apis;x86" \
--android-abi google_apis/x86_64 \
--path-to-config-ini emulator_config2.ini \
--emulator-start-options -prop persist.sys.language=en -prop persist.sys.country=US \
--redirect-logcat-to test_emulator_2_logcat.txt

Stop

java -jar swarmer.jar stop โ€ฆ
Options
Optional
  • --timeout
    • Timeout for emulators to stop in seconds, default is 15 seconds.
Stop all running emulators
java -jar swarmer.jar stop --timeout 10

Download

Swarmer is available on jcenter.

You can download it in your CI scripts or store it in your version control system (not recommended).

SWARMER_VERSION=some-version
curl --fail --location https://jcenter.bintray.com/com/gojuno/swarmer/swarmer/${SWARMER_VERSION}/swarmer-${SWARMER_VERSION}.jar --output /tmp/swarmer.jar

All the releases and changelogs can be found on Releases Page.

Composer

Swarmer works great in combination with Composer โ€” another tool we've built at Juno.

Composer can run Android Instrumentation tests in parallel on multiple connected devices/emulators. In our CI Pipeline we start emulators with Swarmer and then Composer runs tests on them.

How to build

Dependencies: you only need docker and bash installed on your machine.

bash ci/build.sh

License

Copyright 2017 Juno, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

minimock

Powerful mock generation tool for Go programming language
Go
626
star
2

composer

Reactive Android Instrumentation Test Runner. Archived. Marathon is recommended as an alternative (https://github.com/Malinskiy/marathon).
Kotlin
547
star
3

koptional

Minimalistic Optional type for Kotlin that tries to fit its null-safe type system as smooth as possible.
Kotlin
285
star
4

test_tasks

Juno Inc., Test Tasks
42
star
5

engineering

Juno Engineering Blog
33
star
6

jrg

Juno Reverse Geocoder
Gherkin
28
star
7

genval

Generates Validate() methods for structs by tags
Go
28
star
8

lostgis

PLpgSQL
25
star
9

commander

Set of reactive functions for cli tools like Swarmer and Composer.
Kotlin
20
star
10

geo-py

Set of algorithms and structures related to geodesy
Python
17
star
11

osrm-py

Python client for OSRM API
Python
16
star
12

tracegen

Simple tool to generate opentracing decorators
Go
15
star
13

hexgrid-py

Configurable hex grid on abstract surface
Python
14
star
14

make-profiler

Makefile profiling toolset
Python
10
star
15

metricsgen

Tool to generate metrics decorators for interfaces
Go
8
star
16

hexgridgeo-py

GEO wrapper for HexGrid
Python
7
star
17

go-zooz

Zooz API client for Go
Go
7
star
18

generator

Package that simplifies development of go source code generators
Go
6
star
19

junocfg

Template based config generator
Go
6
star
20

morton-py

Morton Pack/Unpack Library
Python
4
star
21

go.morton

Morton Pack/Unpack Library
Go
4
star
22

hexgrid-pgsql

Configurable hexgrid
PLpgSQL
4
star
23

hexgrid-java

HexGrid
Java
4
star
24

goose

Fork of the https://bitbucket.org/liamstask/goose.git without SQLite support
Go
3
star
25

FraktalBand

Swift
3
star
26

TestingPresentableComponents

Swift
3
star
27

FraktalSimplified

Swift
2
star
28

RetryIt

Swift
1
star
29

morton-java

Morton Pack/Unpack Library
Java
1
star
30

frontend-config

JavaScript
1
star
31

morton-js

Morton Pack/Unpack Library
JavaScript
1
star
32

svgen

Scanners and valuers generator for basic types aliases
Go
1
star
33

go-checkout

Checkout.com API client
Go
1
star
34

go.hexgrid

HexGrid
Go
1
star
35

MortonSwift

Swift
1
star