[Guide]Automate android export

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
Posts: 5
Joined: Wed Jun 27, 2018 8:53 am

[Guide]Automate android export

Post by janglee » Thu Jun 28, 2018 5:26 pm

Hello everyone.

I just started using Love and Lua and I like it so much. but making android app is tricky and take time to build.so I just make guide to automate process . Now you have to just type one command and its over, app is running on your device :cool: .

here is guide : https://github.com/Janglee123/LovetoAndroid/wiki

Posts: 2
Joined: Fri Jun 22, 2018 4:19 pm

Re: [Guide]Automate android export

Post by DesignsByJCM » Mon Jul 02, 2018 1:32 pm

So if I understand this correctly, this is not an apk export? It just allows you to run the program via USB from the computer?

Posts: 5
Joined: Wed Jun 27, 2018 8:53 am

Re: [Guide]Automate android export

Post by janglee » Tue Jul 03, 2018 7:03 am

Actually i didn't mentioned but it export apk . I just wrote script that automate process that show in official guide here but in addition i used adb tools to also automate process to test your project on device . You can find your exported apk in dir (root folder)/app/build/outputs/apk/.

sorry for my bad English. English is not my first language. ^^

Posts: 2
Joined: Mon Sep 03, 2018 2:02 am

Re: [Guide]Automate android export

Post by jhessin » Mon Sep 03, 2018 4:44 am

I actually use a build script to generate an android apk. This is my build script all it requires is the sdk and the love-11.1-android.apk downloaded from the homepage. Signing your apk can be tricky, but I just generate a signature named 'release.jks' and save the password to a file 'password.txt' in my project directory. It has really helped my build process.

Code: Select all


# first clean the bulid and android platform directories
rm -rf build/*.*
rm -rf platforms/android

# next use the apktool to extract the love apk
apktool d -s -o platforms/android love-11.1-android.apk

# go to your src directory to build a .love file
cd src
zip -vr ../build/game.love ./ -x "*.DS_Store"

# go back to the root
cd ..

# remake the android platform directory and store the .love file
mkdir platforms/android/assets
cp build/game.love platforms/android/assets

# copy a custom manifest, icons, etc.
cp AndroidManifest.xml platforms/android
cp src/assets/icon-hdpi.png platforms/android/res/drawable-hdpi/love.png
cp src/assets/icon-xhdpi.png platforms/android/res/drawable-xhdpi/love.png
cp src/assets/icon-xxxhdpi.png platforms/android/res/drawable-xxxhdpi/love.png
cp src/assets/icon-xxhdpi.png platforms/android/res/drawable-xxhdpi/love.png
cp src/assets/icon-mdpi.png platforms/android/res/drawable-mdpi/love.png

# repackage with the apk tool
apktool b -o build/unsigned.apk platforms/android

# zipalign and sign the resulting package
zipalign -v -p 4 build/unsigned.apk build/aligned.apk
apksigner sign --ks release.jks --ks-pass file:password.txt --out build/balloonpop.apk build/aligned.apk
apksigner verify build/balloonpop.apk

# remove the intermediate build files
rm build/unsigned.apk build/aligned.apk

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest