xref: /aosp_15_r20/external/grpc-grpc-java/android-interop-testing/README.md (revision e07d83d3ffcef9ecfc9f7f475418ec639ff0e5fe)
1*e07d83d3SAndroid Build Coastguard WorkergRPC Android test App
2*e07d83d3SAndroid Build Coastguard Worker=======================
3*e07d83d3SAndroid Build Coastguard Worker
4*e07d83d3SAndroid Build Coastguard WorkerImplements gRPC integration tests in an Android App.
5*e07d83d3SAndroid Build Coastguard Worker
6*e07d83d3SAndroid Build Coastguard WorkerIn order to build this app, you need a local.properties file under this directory which specifies
7*e07d83d3SAndroid Build Coastguard Workerthe location of your android sdk:
8*e07d83d3SAndroid Build Coastguard Worker```
9*e07d83d3SAndroid Build Coastguard Workersdk.dir=/somepath/somepath/sdk
10*e07d83d3SAndroid Build Coastguard Worker```
11*e07d83d3SAndroid Build Coastguard Worker
12*e07d83d3SAndroid Build Coastguard WorkerConnect your Android device or start the emulator:
13*e07d83d3SAndroid Build Coastguard Worker```
14*e07d83d3SAndroid Build Coastguard Worker$ ./start-emulator.sh <AVD name> & ./wait-for-emulator.sh
15*e07d83d3SAndroid Build Coastguard Worker```
16*e07d83d3SAndroid Build Coastguard Worker
17*e07d83d3SAndroid Build Coastguard WorkerStart test server
18*e07d83d3SAndroid Build Coastguard Worker-----------------
19*e07d83d3SAndroid Build Coastguard Worker
20*e07d83d3SAndroid Build Coastguard WorkerStart the test server by:
21*e07d83d3SAndroid Build Coastguard Worker```
22*e07d83d3SAndroid Build Coastguard Worker$ ../run-test-server.sh
23*e07d83d3SAndroid Build Coastguard Worker```
24*e07d83d3SAndroid Build Coastguard Worker
25*e07d83d3SAndroid Build Coastguard Worker
26*e07d83d3SAndroid Build Coastguard WorkerManually test
27*e07d83d3SAndroid Build Coastguard Worker-------------
28*e07d83d3SAndroid Build Coastguard Worker
29*e07d83d3SAndroid Build Coastguard WorkerInstall the App by:
30*e07d83d3SAndroid Build Coastguard Worker```
31*e07d83d3SAndroid Build Coastguard Worker$ ../gradlew installDebug
32*e07d83d3SAndroid Build Coastguard Worker```
33*e07d83d3SAndroid Build Coastguard WorkerThen manually test it with the UI.
34*e07d83d3SAndroid Build Coastguard Worker
35*e07d83d3SAndroid Build Coastguard Worker
36*e07d83d3SAndroid Build Coastguard WorkerInstrumentation tests
37*e07d83d3SAndroid Build Coastguard Worker----------------
38*e07d83d3SAndroid Build Coastguard Worker
39*e07d83d3SAndroid Build Coastguard WorkerInstrumentation tests must be run on a connected device or emulator. Run with the
40*e07d83d3SAndroid Build Coastguard Workerfollowing gradle command:
41*e07d83d3SAndroid Build Coastguard Worker
42*e07d83d3SAndroid Build Coastguard Worker```
43*e07d83d3SAndroid Build Coastguard Worker$ ../gradlew connectedAndroidTest \
44*e07d83d3SAndroid Build Coastguard Worker    -Pandroid.testInstrumentationRunnerArguments.server_host=10.0.2.2 \
45*e07d83d3SAndroid Build Coastguard Worker    -Pandroid.testInstrumentationRunnerArguments.server_port=8080 \
46*e07d83d3SAndroid Build Coastguard Worker    -Pandroid.testInstrumentationRunnerArguments.use_tls=true \
47*e07d83d3SAndroid Build Coastguard Worker    -Pandroid.testInstrumentationRunnerArguments.server_host_override=foo.test.google.fr \
48*e07d83d3SAndroid Build Coastguard Worker    -Pandroid.testInstrumentationRunnerArguments.use_test_ca=true \
49*e07d83d3SAndroid Build Coastguard Worker    -Pandroid.testInstrumentationRunnerArguments.test_case=all
50*e07d83d3SAndroid Build Coastguard Worker```
51*e07d83d3SAndroid Build Coastguard Worker
52