Is there a way to run my Compose Multiplatform app...
# compose-ios
a
Is there a way to run my Compose Multiplatform app on my iphone (real device) from Android Studio? I can only see simulators as potential targets via the 'Execution Targets' dropdown, so I guess not, but maybe someone has found a way
a
I haven't tried it myself, but one of the contributors added these files to my template exactly for this purpose: https://github.com/arkivanov/decompose-multiplatform-template/tree/master/.run
a
never seen
.run
before. what is it?
a
I think those files are created when you add run configurations manually.
a
TIL. I copy pasted the files to my project and it added configs. Values seem hardcoded so it doesnt work on my case but i think i can figure it out
👍 1
a
Yeah, you will likely need to change some values.
a
hmm cant get it to work. I am getting
Project directory '/Users/alexstyl/Downloads/KotlinProject/iosApp' is not part of the build defined by settings file '/Users/alexstyl/Downloads/KotlinProject/settings.gradle.kts'. If this is an unrelated build, it must have its own settings file.
which is weird, because in your project your ios app is also not defined in the settings.gradle.kts
getting the same when i closed your template
a
Right, sorry for the confusion! I think those files became outdated after migration to Xcode-based projects.
a
it's cool. i appreciate the pointer. i havent touched compose multiplatform in forever so i have no idea at what state it is currently (or what xcode based projects are)
a
A while ago, there was a way of creating a Compose iOS app without a single line in Swift, even without creating an Xcode project. There was a Gradle DSL like as follows.
Copy code
compose.experimental { 
    uikit.application { ... }
}
It allowed running the iOS app via a single Gradle task called
iosDeployIPhone12ProDebug
, which you can see in that run configuration file. But the support was removed and I think now we have to create an Xcode project and use
ComposeUIViewController
. See: https://kotlinlang.slack.com/archives/C0346LWVBJ4/p1699707606789959
👀 1
I think there should be a way of running the Xcode app from command line, and it should be possible to create a run configuration calling that command.
g
You could also try running the project on your phone from xcode itself, that might at least generate some config files you can then use from Studio
xcode will build it and run last i tried it'll just act weird and throw a lot of errors/warns.
a
i can run it on xcode. havent figured out how from AS