https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
b

basher

01/24/2019, 9:30 PM
Figured out how to run tests for iOS:
Copy code
xcrun simctl spawn '<sim name like iPad Air 2>' <path to test.kexe>
agree this should just be handled automatically
i imagine they havent because part of that task references a target you define
i

icarumbas

01/24/2019, 9:54 PM
r

russhwolf

01/24/2019, 9:54 PM
Examples exist but it isn't provided by default (either in the plugin or in the new project templates)
👍 1
b

basher

01/24/2019, 9:55 PM
@maxim that build.gradle shows them creating a custom task to do it
IMO, it should be built into the plugin
i

icarumbas

01/24/2019, 9:56 PM
@basher got it now. Thanks
b

basher

01/24/2019, 9:56 PM
Np!
i imagine they havent because part of that task references a target you define
@alec i'm referencing a task generated from the kotlin-multiplatform plugin. Seems like
fromPreset
(or
targetFromPreset
in 1.3.20) could just generate this task too
a

alec

01/24/2019, 9:58 PM
yup they could at the very least create a test task for each target
iosDeviceTest
i could add it to our cocoapods plugin 😉
r

russhwolf

01/24/2019, 9:59 PM
But something still needs to tell it which simulator to use. Just having a target defined doesn't specify that
a

alec

01/24/2019, 9:59 PM
i still need to figure out the best way how to get these tests to run as part of a CI build w/ cocoapods
b

basher

01/24/2019, 9:59 PM
Heh yeah 🙂
a

alec

01/24/2019, 10:00 PM
yea the task in their example defaults to an iPhone 8 simulator
b

basher

01/24/2019, 10:00 PM
@russhwolf agree, but it could specify a default and then allow it to be altered as a variable in the
fromPreset
block
If it wanted to be extra fancy (and verbose), it could run
xcrun simctl list
and output one task per sim. It'll generate a lot of tasks, but the could be configurable as well?
r

russhwolf

01/24/2019, 10:01 PM
yeah I agree. I just mention it to highlight that there are some API decisions to make before integrating it into the plugin, which maybe is why they haven't yet
b

basher

01/24/2019, 10:01 PM
Good point!
@alec the more I think about it, it prob makes sense to have a generic iOS plugin
The maintenance burden of this feels beyond the scope of K/N