Skip to content

Onboarding:Linux:LLM

elbywan edited this page Oct 25, 2022 · 1 revision

Ledger Live Mobile

Android Studio

The easiest way to setup your Android environment is to install Android Studio

  • Download Android Studio : https://developer.android.com/studio
  • Unzip and launch the executable located in bin/studio.sh
  • Tip: In the welcome window of Android Studio, in the bottom left corner, you can click on the "Add entry" little button to add a desktop entry to your Linux so you can easily open it again after.
  • Open the ledger-mobile repository folder.

Android Studio SDK Manager

We will install all the Android necessary dependencies to build Ledger Live Mobile as well as additional tools.

In the top navigation bar, open the Tools->SDK Manager. In the SDK Platforms tab, be sure that at least one SDK is installed (Android 10 ? 11 ? As you wish). In the SDK Tools tab, be sure sure that these components are installed :

  • Android SDK Build-Tools
  • NDK
  • CMake
  • Android Emulator
  • Android SDK Platform-Tools

Android Studio Emulator

In this part, we will focus on the installation of the Android emulator, necessary for Android development without the use of a dedicated device.

In the top navigation bar, open the Tools->Device Manager

In the "Device Manager" section that just opened, click on the "Create device" button.

I recommend that you take a phone that does not have a large screen or the latest version of Android, to be in line with most Ledger Live users.

Linking it all together

You need to modify your $PATH, like you have done with Yarn, so that your setup detects the SDK and the emulator :

  • Open your .bashrc with your favorite editor, ex: nano ~/.bashrc
  • Add theses lines to the end of it :
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
  • Reload your environment using this command: source ~/.bashrc

(Not mandatory) Set up your phone

If you prefer to use your Android phone rather than the emulator, you need to enable USB debugging. To begin with, close any instance of the emulator you may have open.

Please follow this guide to enable it : https://www.embarcadero.com/starthere/xe5/mobdevsetup/android/en/enabling_usb_debugging_on_an_android_device.html

To verify that your phone is connected and recognized, you can launch this command : adb devices -l You should see a line at the bottom of "List of devices attached" containing the name of your phone. If you don't see anything, try to launch again the command or check again the guide above. If the command adb is not recognized, please verify that you have done every steps in the Android Studio SDK Manager (adb is contained in the Android SDK Platform-Tools module) and the Linking it all together chapters.

Launch

Launch these commands inside the ledger-live-mobile repository :

  • yarn to download the latest node packages
  • yarn start to start Metro, the bundler for React-native (More Info)

Since Metro is a watcher, open a new terminal and yarn android to build and install the development application to your device. It will launch the emulator if it's not started yet or if there is no physical device connected.

After a few minutes, you should see Ledger Live Mobile start screen. Congrats ! 🎉

Clone this wiki locally