I am testing out KMM, and having a KMM library connecting to a grpc service on hosting machine.
I then have a simple test in
commonTest
, trying to make the connection to the service. I then run the test from AS, choosing
Android
as the target. However, I simply cannot make it work:
If I use
localhost
as the destination host, I get a connection rejection error.
Then I thought maybe this is running from Android emulator, so I use
10.0.2.2
. This gives me
Operation timed out
error.
So, what is the right way to connect to a service on the host OS from KMM test targeting Android?
Andy Wu
07/25/2022, 1:54 PM
Ah, NVM, I figured it out. It should be localhost, the reason I was unable to do it is I use grpc, and try to connection with SSL, while the testing server I use does not support it.