Running an executable jar in android

后端 未结 5 1260
北海茫月
北海茫月 2021-02-05 18:26

is it possible to run an executable jar file (command line based) in android? one of my friend told me that it is possible to run executables written in C. Is it possible for ja

5条回答
  •  盖世英雄少女心
    2021-02-05 19:10

    You can install an app built as an APK through adb:

    adb install my_apk_file.apk
    

    And once inside an adb shell, you can launch an APK application using the am command. See How to start an application using android ADB tools?

    But I don't think there's a way to directly run a jar file the way you can do so on a desktop operating system, because Android doesn't use the standard Java VM.

    I think you would need to embed your .jar file inside a minimal Android application that invokes the jar and prints results to stdout. Then you would build that APK and install/run it as I described above.

提交回复
热议问题