DEV Community

Cover image for How to publish your apps on F-Droid?
Sanand
Sanand

Posted on

How to publish your apps on F-Droid?

F-Droid is a community-maintained repository of free and open-source software for Android, similar to Google Play store. But unlike Google Play store, F-Droid only contains open-source apps that respect your freedom.

Publishing apps on F-Droid may seem a little confusing for newbies.
Recently, I published my first free and open-source app on F-Droid(Check it out here).

In this post, I will walk you through the steps that I followed to publish my app on F-Droid.

NOTE: Your app can be included in F-Droid only if it is completely open-source - including all libraries and dependencies used. Learn more about their inclusion policy here.

Note that I am using Linux environment and I didn't test these on a Windows machine.

Step 1:

First you need a GitLab account beacuse the F-Droid repository is hosted on GitLab. After registering on GitLab, you need to fork fdroiddata repository.

Step 2:

Install fdroidserver. This can be done using apt:

sudo apt install fdroidserver
Enter fullscreen mode Exit fullscreen mode

But I faced some issues while using fdroidserver that is installed using apt.
So I recommend using it directly from master:

git clone https://gitlab.com/fdroid/fdroidserver.git
export PATH="$PATH:$PWD/fdroidserver"
Enter fullscreen mode Exit fullscreen mode
Step 3:

Clone fdroiddata(or your fork) and enter it:

git clone https://gitlab.com/fdroid/fdroiddata
cd fdroiddata
Enter fullscreen mode Exit fullscreen mode
Step 4:

Run the following commands to make sure fdroid works and reads the metadata files properly:

fdroid init
fdroid readmeta
Enter fullscreen mode Exit fullscreen mode
Step 5:

Use fdroid import command to add your project:

fdroid import --url https://github.com/YOUR-USERNAME/REPO --subdir app
Enter fullscreen mode Exit fullscreen mode

Replace with the link to your project repository after --url tag.

Step 6:

The above step will create a file in the metadata directory, something like metadata/app.id.yml
Open and edit this file using a text editor:

nano metadata/YOUR-APP-ID.yml
Enter fullscreen mode Exit fullscreen mode

You have to fill in your app details like Categories, License, WebSite etc. You can read about it here.

Step 7:

Run the following command to make sure that the metadata file is complete and error free:

fdroid readmeta
Enter fullscreen mode Exit fullscreen mode
Step 8:

Run the following command to clean up your file:

fdroid rewritemeta YOUR-APP-ID
Enter fullscreen mode Exit fullscreen mode
Step 9:

Run the following command and make sure that it doesn't report any warnings:

fdroid lint YOUR-APP-ID
Enter fullscreen mode Exit fullscreen mode

If there are any warnings, fix them.

Step 10:

Let's actually build the app using the following command:

fdroid build -v -l YOUR-APP-ID
Enter fullscreen mode Exit fullscreen mode

If you don't have Android Sdk set up on your computer or if you don't set it up correctly, you may encounter an error in this step. Don't worry, install the sdk and set the path correctly. In my case, the path was not set correctly. So I used following commands to correct the error:

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
Enter fullscreen mode Exit fullscreen mode

Note: If you still encounter any errors/warnings due to something that is not configured in your machine, I recommend moving to next step and check if the pipeline is passing after it is pushed to GitLab.

Step 11:

Now you can commit and push to our GitLab repository(to your fork). This can be done using the following commands:

git add .
git commit -m "Added <Your App Name Here>"
git remote set-url origin https://gitlab.com/YOUR-USERNAME/fdroiddata.git
git push -u origin master
Enter fullscreen mode Exit fullscreen mode
Step 12:

Check the CI/CD pipelines. Now you can make a merge request which will be reviewed by F-Droid maintainers and if everything is fine, they will merge it to their main branch.

Additional Info: If you want to include, graphic assets like icon, screenshots etc. you can include it by adding a Fastlane or Triple-T folder structure in your app's repo. You can read about it here.
For example, I included a fastlane folder structure in my app's repo by creating these folders: fastlane/metadata/android/
You can add graphic assets in the images folder. If you want to include screenshots, you need to create a folder called phoneScreenshots inside images and add your screenshots there. You can also add summary and descriptions also in fastlane/metadata/android/ folder and remove it from the metadata YML file so that you don't need to open a new merge request each time you make any changes in description, summary etc. If you need reference, check out my project here. Finally, don't forget to update the commit id in the metadata YML file.

Phew, that's it!

It may take one or two days to appear in the F-Droid app store after your app metadata is merged.

You can advertise the download of your app in F-Droid using the official grafic.

<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" height="75">
Enter fullscreen mode Exit fullscreen mode

So what do you think about F-Droid? Did you publish your apps on F-Droid? Let me know in the discussion below.

References:

  1. https://gitlab.com/fdroid/fdroiddata/-/blob/master/CONTRIBUTING.md
  2. https://www.f-droid.org/en/docs/Inclusion_Policy/
  3. https://f-droid.org/docs/Build_Metadata_Reference/
  4. https://f-droid.org/en/docs/All_About_Descriptions_Graphics_and_Screenshots/
  5. https://blog.fossasia.org/publish-an-open-source-app-on-fdroid/

Top comments (2)

Collapse
 
skd1993 profile image
Shobhit Kumar

Is there any way to do this from Windows? I could not find any docs

Collapse
 
sanandmv7 profile image
Sanand