[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"howto:kts:android:en":3},{"resolvedFromAlias":4,"canonicalExt":5,"ext":5,"name":6,"category":7,"categoryName":8,"updatedAt":9,"os":10,"osLabel":11,"quickSolution":12,"stepByStep":13,"recommendedSoftware":15,"alternativeMethods":16,"commonIssues":17,"securityNote":37,"extensionPath":38,"extensionLabel":39,"breadcrumbs":40,"metaDescription":50},false,"kts","Kotlin Script","code","Code","2026-06-12T09:04:56.042Z","android","Android","To open .KTS files on Android, android does not commonly run Kotlin scripts directly; open the file as text for viewing, or transfer it to a desktop system to run with kotlinc -script.",[14],"Android does not commonly run Kotlin scripts directly; open the file as text for viewing, or transfer it to a desktop system to run with kotlinc -script.",[],[],[18,24,30],{"title":19,"description":20,"steps":21},"Double-clicking doesn’t run the script",".kts files are source code; most operating systems do not execute them by default when you double-click.",[22,23],"Open the file in a code editor to inspect it as text.","Run it from a terminal with the Kotlin compiler: kotlinc -script file.kts",{"title":25,"description":26,"steps":27},"Trying to run a Gradle Kotlin DSL file as a standalone script","Files like build.gradle.kts are Gradle build scripts written in Kotlin DSL; they are meant to be evaluated by Gradle, not executed as a generic Kotlin script.",[28,29],"If the file is named build.gradle.kts (or settings.gradle.kts), treat it as a Gradle build configuration.","Run it through Gradle as part of the project (not via kotlinc -script).",{"title":31,"description":32,"steps":33},"Script fails because Kotlin tooling isn’t installed or on PATH","Running a .kts file requires the Kotlin command-line compiler (kotlinc). If it is missing or not available in your shell PATH, the command won’t work.",[34,35,36],"Install the Kotlin command-line tools.","Verify kotlinc is available by running: kotlinc -version","Re-run the script using: kotlinc -script file.kts",".kts files are executable code when run (for example with kotlinc -script). Only run scripts from sources you trust, because they can perform actions allowed by your user account.","/file-extension/kts",".KTS",[41,44,47],{"label":42,"to":43},"Home","/",{"label":45,"to":46},"How To","/file-extension",{"label":48,"to":49},"Open .KTS on Android","/how-to/open-kts-on-android","Learn how to open .KTS files on Android with step-by-step instructions, recommended software, and troubleshooting tips."]