Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit572bd1c

Browse files
author
Hoang Phat Nguyen
committed
Update README to test with Sunflower project
1 parent618443b commit572bd1c

File tree

2 files changed

+57
-3
lines changed

2 files changed

+57
-3
lines changed

‎Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WORKDIR /
66

77
SHELL ["/bin/bash","-c"]
88

9-
RUN apt update && apt install -y openjdk-8-jdk vim unzip libglu1 libpulse-dev libasound2 libc6 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxi6 libxtst6 libnss3 wget
9+
RUN apt update && apt install -y openjdk-8-jdkgitvim unzip libglu1 libpulse-dev libasound2 libc6 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxi6 libxtst6 libnss3 wget
1010

1111
ARG GRADLE_VERSION=5.4.1
1212
ARG ANDROID_SDK_VERSION=28
@@ -20,7 +20,7 @@ RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.
2020

2121
RUN wget'https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip' -P /tmp \
2222
&& unzip -d /opt/android /tmp/sdk-tools-linux-4333796.zip \
23-
&& yes Y | /opt/android/tools/bin/sdkmanager --install"platform-tools""system-images;android-${ANDROID_SDK_VERSION};google_apis;x86""platforms;android-${ANDROID_SDK_VERSION}""build-tools;${ANDROID_SDK_VERSION}.0.3""emulator" \
23+
&& yes Y | /opt/android/tools/bin/sdkmanager --install"platform-tools""system-images;android-${ANDROID_SDK_VERSION};google_apis;x86""platforms;android-${ANDROID_SDK_VERSION}""build-tools;28.0.3""emulator" \
2424
&& yes Y | /opt/android/tools/bin/sdkmanager --licenses \
2525
&& echo"no" | /opt/android/tools/bin/avdmanager --verbose create avd --force --name"test" --device"pixel" --package"system-images;android-${ANDROID_SDK_VERSION};google_apis;x86" --tag"google_apis" --abi"x86"
2626

‎README.md‎

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,55 @@
1-
###Lightweight Android Container
1+
##Lightweight Android Container
2+
3+
####First attempt:[Project Sunflower](https://github.com/android/sunflower)
4+
>A gardening app illustrating Android development best practices with Android Jetpack.
5+
6+
Sunflower is currently configurated with`gradle-5.4.1` and`Android Build Tools v28`
7+
8+
Build the docker image that works for this project:
9+
```shell
10+
docker build \
11+
--build-arg GRADLE_VERSION=5.4.1 \
12+
--build-arg ANDROID_SDK_VERSION=28 \
13+
--build-arg EMULATOR_NAME=test \
14+
-t android-container:28-5.4.1.
15+
```
16+
17+
Clone and cd to the project dir:`git clone https://github.com/android/sunflower && cd sunflower/`
18+
19+
Start to build the project
20+
```shell
21+
docker run --privileged -it --rm -v$PWD:/data android-container:28-5.4.1 \
22+
bash -c". /start.sh && gradlew connectedAndroidTest -p /data"
23+
```
24+
25+
Here is result that I observed on my terminal
26+
```shell
27+
> Task :app:connectedDebugAndroidTest
28+
29+
com.google.samples.apps.sunflower.PlantDetailFragmentTest> testShareTextIntent[test(AVD) - 9] SKIPPED
30+
31+
08:44:46 V/InstrumentationResultParser: INSTRUMENTATION_RESULT: stream=
32+
08:44:46 V/InstrumentationResultParser:
33+
08:44:46 V/InstrumentationResultParser: Time: 2.872
34+
08:44:46 V/InstrumentationResultParser:
35+
08:44:46 V/InstrumentationResultParser: OK (11 tests)
36+
08:44:46 V/InstrumentationResultParser:
37+
08:44:46 V/InstrumentationResultParser:
38+
08:44:46 V/InstrumentationResultParser: INSTRUMENTATION_CODE: -1
39+
08:44:46 V/InstrumentationResultParser:
40+
08:44:46 I/XmlResultReporter: XMLtest result file generated at /data/app/build/outputs/androidTest-results/connected/TEST-test(AVD) - 9-app-.xml. Total tests 12, passed 11, ignored 1,
41+
08:44:46 V/ddms: execute'am instrument -w -r com.google.samples.apps.sunflower.test/androidx.test.runner.AndroidJUnitRunner' on'emulator-5554': EOF hit. Read: -1
42+
08:44:46 V/ddms: execute: returning
43+
08:44:46 V/ddms: execute: running pm uninstall com.google.samples.apps.sunflower.test
44+
08:44:46 V/ddms: execute'pm uninstall com.google.samples.apps.sunflower.test' on'emulator-5554': EOF hit. Read: -1
45+
08:44:46 V/ddms: execute: returning
46+
08:44:46 V/ddms: execute: running pm uninstall com.google.samples.apps.sunflower
47+
08:44:46 V/ddms: execute'pm uninstall com.google.samples.apps.sunflower' on'emulator-5554': EOF hit. Read: -1
48+
08:44:46 V/ddms: execute: returning
49+
50+
Deprecated Gradle features were usedin this build, making it incompatible with Gradle 6.0.
51+
Use'--warning-mode all' to show the individual deprecation warnings.
52+
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
53+
```
54+
55+
Cool, it works!

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp