Android: Difference between revisions

24.05 -> 24.11 changes
Locnide (talk | contribs)
m add missing trailing ; in android studio install snippet
 
(4 intermediate revisions by 3 users not shown)
Line 36: Line 36:
</syntaxhighlight>
</syntaxhighlight>


== adb setup ==
== ADB setup ==


To enable <code>adb</code> in NixOS for unprivileged users
To use <code>adb</code>, you can just [[Adding programs to PATH|run it from]] the <code>android-tools</code> package.
add these lines to your <code>configuration.nix</code>.
This is mandatory for all further interactions with your android device.


<syntaxhighlight lang=nix>
{{Note|1=Previously you would need use <code>programs.adb.enable = true;</code> and <code>users.users.<your-user>.extraGroups = [ "adbusers" ];</code> to add ADB to your PATH and configure access rules. This option is no longer needed as systemd 258 handles uaccess rules for ADB and fastboot automatically. See the Nixpkgs pull request {{pull|454366}}.}}
{
  programs.adb.enable = true;
  users.users.<your-user>.extraGroups = [ "adbusers" ];
}
</syntaxhighlight>
 
This will add [https://github.com/M0Rf30/android-udev-rules additional udev rules] for unprivileged access as well as add adb to your <code>$PATH</code>.
 
Alternatively, if you don't want to install adb globally but do want to configure the udev rules, you can:
 
<syntaxhighlight lang=nix>
{
  services.udev.packages = [
    pkgs.android-udev-rules
  ];
}
</syntaxhighlight>


=== Use Older Platform Version ===
=== Use Older Platform Version ===
Line 143: Line 124:
environment.systemPackages = [
environment.systemPackages = [
   pkgs.android-studio
   pkgs.android-studio
]
];
</syntaxhighlight>
</syntaxhighlight>


Line 286: Line 267:
# [https://github.com/mrVanDalo/LineagoOS-build LineageOS build setup using terranix and hcloud], based on the [https://gist.github.com/Nadrieril/d006c0d9784ba7eff0b092796d78eb2a shell.nix to build LineageOS]. Useful if you are in a rush and don't have to much CPU power on your hand.
# [https://github.com/mrVanDalo/LineagoOS-build LineageOS build setup using terranix and hcloud], based on the [https://gist.github.com/Nadrieril/d006c0d9784ba7eff0b092796d78eb2a shell.nix to build LineageOS]. Useful if you are in a rush and don't have to much CPU power on your hand.
# [https://wiki.archlinux.org/title/Android_Debug_Bridge Archlinux Wiki to Android_Debug_Bridge]
# [https://wiki.archlinux.org/title/Android_Debug_Bridge Archlinux Wiki to Android_Debug_Bridge]
[[Category:Development]]