How to create android project with gradle from command line?

前端 未结 3 517
失恋的感觉
失恋的感觉 2020-12-02 08:28

How to create android project with gradle from command line (without any IDE)?

Before it was with android util like below



        
3条回答
  •  再見小時候
    2020-12-02 09:08

    Here is the solution PHP Android CLI

    Just run:

    phpandroid create HelloWorld com.example.helloworld
    

    and your project is scaffolded with latest android-studio parameters, like, compile & target SDK is 29, buildToolsVersion is 29.0.1 & minSdk is 16.

    If you want to change, like, want to set minSdk to 14:

    phpandroid create PROJECT PACKAGE --minSdk=14
    

    PHP Android CLI can also create Variants and modules (application/library):

    phpandroid create PROJECT PACKAGE --modules=common:library,admin --variants=free:type,paid:type,php:backend,firebase:backend
    

    this will generate 2 applications, app, admin & a library common. App has 2 dimensions: type & backend 4 variants: free & paid of type dimension; php & firebase variant of backend dimension.

提交回复
热议问题