scratch-mobile-app allows you to turn your Scratch projects into standalone mobile apps with ease! Experience your favorite Scratch creations on the go with offline functionality.
- Turn Scratch projects into offline mobile apps.
- Tested on Android but should work on iOS too.
Follow these instructions to package your Scratch project in scratch-mobile-app, turning your .sb3 Scratch file into a mobile app (e.g., an .apk for Android) that you can install on your phone and use just like any other app.
The instructions are for Android built on Ununtu Linux. However, the project is expected to work on iOS too due to the multiplatform nature of Flutter. Contribution is welcome!
Install Docker
-
Place your files to some directory, e.g.
~/my-cool-scratch-projectproject.sb3: Scratch projectproject.png: icon (optional)project.yaml: configuration of app name (optional)name: "My Scratch App"
-
Change to the directory
cd ~/my-cool-scratch-project- Verify the
project.sb3file is there:
petr@petr:~/my-cool-scratch-project$ ls
project.sb3- Run the docker
docker run --rm -e UID=$(id -u) -e GID=$(id -g) -v $(pwd):/workspace ghcr.io/petrkaderabek/scratch-mobile-app:latest- Verify the
project.apkand licence files were created:
petr@petr:~/my-cool-scratch-project$ ls
project.3rd_party_licenses.md project.apk project.sb3- Install
project.apkon your mobile device.
Upload project.apk to your Android phone and install it. You are ready to run your own mobile app!
If you just want to try this tool on the default SB3 file included within, follow these steps to get the APK:
- Change to a directory the results will be placed in
cd ~/Documents- Run the docker
docker run --rm -e "USE_DEFAULT_SB3=true" -e UID=$(id -u) -e GID=$(id -g) -v $(pwd):/workspace ghcr.io/petrkaderabek/scratch-mobile-app:latest- Verify the
project.apkand licence files were created:
petr@petr:~/Documents$ ls project.*
project.3rd_party_licenses.md project.apk- Install
project.apkon your mobile device.
Upload project.apk to your Android phone and install it.
Local installation is needed, if you want to change code of the repo. If you just need to build APK file from your Scratch project, the above-mentioned Docker way is much simpler.
- Node.js: Ensure you have Node.js v20 installed. NVM
- Flutter: Install Flutter with Android support. Flutter Installation Guide
- xmlstarlet: Command-line tool for reading/editing xml files (
apt install xmlstarlet)
-
Clone this repository:
git clone https://github.com/petrkaderabek/scratch-mobile-app.git
-
Navigate into the project directory:
cd scratch-mobile-app -
Replace default assets with your ones:
default_workspace/project.sb3: your own Scratch project,default_workspace/project.png: icon of your new mobile app.default_workspace/project.yaml: config of your new mobile app, currently contains app name only.
-
Build
scratch-mobile-app.apkmake all
-
Install
scratch-mobile-app.apkon your mobile device.
Upload scratch-mobile-app.apk to your phone and install it. You can run your app!
Contributions are welcome! Please submit a pull request or open an issue for any suggestions or bugs.
-
Fork the repository.
-
Create your feature branch:
git checkout -b feature/AmazingFeature
-
Commit your changes:
git commit -m 'Add some AmazingFeature' -
Push to the branch:
git push origin feature/AmazingFeature
-
Open a pull request.
This app has two main components:
- React.js app in the
react-appdir. - Flutter wrapper running the javascript from point 1.
If you want to debug the React part separately, perform the following steps:
- Ensure your project is already copied to
react-app/public/project.sb3(done byprocess_workspace.shif run before). - Run the React HTTP server with the app by
cd react-app npm start - Open the app in a browser at http://localhost:3000.

