Skip to content

Instantly share code, notes, and snippets.

@Iron-Wolf
Last active December 22, 2018 11:03
Show Gist options
  • Save Iron-Wolf/6f2ce25fb64a1f086ffe555f1a6a7add to your computer and use it in GitHub Desktop.
Save Iron-Wolf/6f2ce25fb64a1f086ffe555f1a6a7add to your computer and use it in GitHub Desktop.

Requirements

Platform setup

  • Download SDK tools : [Google Download]
  • JAVA_HOME environnement variable set to a valid JRE (or JDK).

Install SDK

Extract SDK tool and launch :

./sdkmanager "platforms;android-26"  

Accept licence and wait download to finish.

📌 The licenses and plateforms folders should appear in the root directory (alongside tool folder)

SDK directory structure :

SDK tools
└───tools
│   │   sdkmanager
│   │   ...
│   
└───licence
│   │   licence.txt
│
└───platform
    │   android-26
    │   ...

Configure IDE

Configure Intellij by adding SDK directory in the Project Structure.
Create the android project 👍

Verification

Android SDK > SDK Tools > Android SDK Platform-tools (contain adb utility)

Use hardware debuging with GNU/Linux :

apt-get install android-tools-adb # Community package with udev rules for all android device
sudo usermod -aG plugdev $LOGNAME # Add current user in the plugdev group

Firstly, you can see if your host detect your device with lsusb.
Then, you can see your device with adb devices.

If problem persist, disconnect and reconnect device and start/stop adb server.

adb kill-server
adb start-server

Disclaimer

You can't run multiple instance of adb on the same host. If you debug you app on a smartphone (throught Android Studio) make sure to kill any adb server running in the background.

You must also configure your device with :

  • debugging USB enabled
  • set USB mode to MTP (or PTP)

Ressources

IntelliJ for Android
Build tool not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment