Device Setup
NOTE
In this guide you will learn how to test your app directly using an Android device connected via USB to your computer.
In your Android device, enable the developer options.
After you have enabled the developer options, enable USB debbuging.
Connect your Android device to your computer with a USB cable, and confirm in your Android device that you allow USB debugging from this computer.
In the root folder of your repository, run:
nix develop .#androidDev
This is a replacement command for the usual nix develop
, which includes Android Studio
, and all the necessary tooling that you need for Android development. Every time you want to test or build for the Android platform, you will need to enter the nix devShell this way and then your command from inside of it.
WARNING
The first time this is run, it will take some time. This is because nix has to download and build all the necessary Android tooling. After the first time, it will be almost instant.
- Inside your
androidDev
devShell, run:
adb devices
If all the previous steps were successful, you should see your device in the list of devices.
That's it! You can now take a look at developing for Android to know what commands to use when targeting Android.