首页 > 解决方案 > 通过 Android Studio 发送 shell 命令或类似于正在运行的 android 应用程序的东西

问题描述

给定一个具有一些公共功能的应用程序。当应用程序通过我写入android studio的一些输入运行时,我如何调用这些函数。也许是某种贝壳?

fun foo1() = doesSomeFoo1()
fun foo2() = doesSomeFoo2()
fun foo3() = doesSomeFoo3()

...

//this runs every 2 seonds somewhere or when it gets notified that this kind of input was recieved
when (someInputBufferOrSomething.recievedInputFromAndroidStudio) {
    "execute foo1" -> foo1()
    "execute foo2" -> foo2()
    "execute foo3" -> foo3()
}

标签: androidshellandroid-studiokotlin

解决方案


推荐阅读