Skip to content

Instantly share code, notes, and snippets.

View BenFredjSkander's full-sized avatar
:octocat:

Skander Ben Fredj BenFredjSkander

:octocat:
  • 23:59 (UTC +01:00)
View GitHub Profile
@BenFredjSkander
BenFredjSkander / release-android-debuggable.md
Created February 6, 2023 21:36 — forked from nstarke/release-android-debuggable.md
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@BenFredjSkander
BenFredjSkander / spring_app_as_linux_service.gist
Created October 19, 2021 21:05 — forked from brandonjyee/spring_app_as_linux_service.gist
Deploying Spring Boot app as a Linux service
This method uses the modern systemd way to run a Java JAR (i.e. a Spring Boot app) as a daemon as opposed to using the older method of using init.d (SystemV). Using the "&" symbol to run the process in the background isn't sufficient b/c the process will be shut down when the terminal closes (or when you exit your SSH session if remoting in to the machine). Using the "nohup" command is another option, but that is like the "poor man's way" of running a service: doesn't restart on machine reboot; program ignores interrupts, quit signals, and hangups. For more info see: https://stackoverflow.com/questions/958249/whats-the-difference-between-nohup-and-a-daemon .
Anyways, to create a Linux daemon the systemd way:
Create a service file in /etc/systemd/system. Let's call it javaservice.service. Let the contents be:
[Unit]
Description=My Java Service
[Service]