Skip to content

FAQ Frequently Asked Questions

Miku AuahDark edited this page Sep 5, 2024 · 15 revisions

What's the difference between regular and "embed"-suffix APK?

The regular APK is complete-featured APK which you can install directly into your phone. It can load games from *.love files (may not work depending on file manager) and from /sdcard/lovegame (or /sdcard/Android/data/org.love2d.android/files/games/lovegame) folder. The "embed" APK, on the other hand, only able to load games inside the APK's assets/game.love, which makes it suitable to package game with APKTool method.

Note: You can't install "embed"-suffix APK as-is because it's unsigned.

How can I start a .love file from my desktop machine?

Note: This only works on Android 6 and earlier!

Say you have the file superawesomegame.love that you want to test using LÖVE for Android, your Android device is connected to your desktop machine, and you have adb properly installed.

You can copy the game to the device using

adb push superawesomegame.love /sdcard/superawesomegame.love

And run the game with

adb shell am start -S -n "org.love2d.android/.GameActivity" -d "file:///sdcard/superawesomegame.love"

I can't start audio recording/love.audio.getRecordingDevices() is empty. Why?

  1. You may downloaded the APK from Play Store. In this case, microphone recording is disabled due to Play Store policy reasons.
  2. You haven't granted the app microphone permission.

If you still can't start recording, this forum post may be worth to check out: https://love2d.org/forums/viewtopic.php?f=4&t=88151&p=231799#p231799

How to change screen orientation to portrait?

Specify portrait screen dimensions in love.conf or in love.window.set/updateMode. Examples

-- love.conf way
function love.conf(t)
    t.window.width = 1080
    t.window.height = 1920
end

-- love.window.setMode way
love.window.setMode(1080, 1920, settings)

-- love.window.updateMode way
love.window.updateMode(1080, 1920)

The screen resolution are arbitrary as long as it's portait.

Note: Prior to 11.4, changing screen orientation at love.conf doesn't work if you have t.window.fullscreen = true set. A workaround exist as described in https://github.com/love2d/love-android/issues/196#issuecomment-714543560

Why I can't run .love files from my phone?

Android file association since Nougat is completely broken. Maybe try using other file manager. Unfortunately there's no way to fix this. Sorry.

How to prevent my game change orientation?

Set t.window.resizable = false in your love.conf.

Why JIT is disabled by default?

This is due to Android memory allocator and LuaJIT. See https://github.com/LuaJIT/LuaJIT/issues/285#issuecomment-666908417

What's "experimental fusing" method?

It's the new, more efficient way to package your game for Android starting in LOVE 11.4. Previously, you have to put game.love into the assets folder (either in APK or in the Android project), which may be problematic in certain situations. With the old packaging, the structure will look like this:

love-android
├ app
| └ src
|   └ embed
|     └ assets
|       └ game.love
├ love
| (more stuff)

With the new packaging, it will be look like this:

love-android
├ app
| └ src
|   └ embed
|     └ assets
|       ├ main.lua
|       ├ conf.lua
|       | (the rest of your game here)
├ love
| (more stuff)

In short, instead of placing packaged game.love into the assets folder, place the whole game there instead.