How can I run my commonTest unit tests on an Andro...
# multiplatform
p
How can I run my commonTest unit tests on an Android device? When I try to run my tests for android it gets upset because I have JNA dependencies and it can’t find the
.dylib
. I’m assuming because it’s trying to run on my computer instead of on android.
j
In your Android target declaration, you can change what source set tree the androidInstrumentedTest and androidUnitTest source sets belong to. If you want commonTest tests to run as Android instrumented tests and not Android unit tests:
Copy code
androidTarget {
    instrumentedTestVariant.sourceSetTree.set(SourceSetTree.test)
    unitTestVariant.sourceSetTree.set(SourceSetTree.unitTest)
}
🙌 1