Running LAMW apk on linux (avdmanager, command line tool) lazarus / 43-Android ---------------------------------------------------------------------- cpicanco · 2018-10-07 19:26 About the recent LAMW's linux install instructions: https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/li nux/tutorial_by_waynesherman/howto%20- %20Android%20Development%20Environment%20on%20Linux.txt Everything is working just fine in my debian 9 based distro, with two exceptions: 1) the installation will not work if you use fpcupdeluxe v1.6.1n (I didn't test other versions). 2) no instructions on how setting up AVDs from command line (no gui). (important for setting up a functional emulator) Right now I am not sure what image I should use (or more generally, what devices are supported by LAMW). I was considering installing: ./sdkmanager 'system-images;android-23;google_apis;armeabi-v7a' ./sdkmanager 'system-images;android-23;google_apis;x86' ./sdkmanager 'system-images;android-26;google_apis;x86' Any information about that? Also, I am trying to find what are the necessary data to -n -d parameters in order to create the AVD: ./avdmanager create avd -c 100M -k 'system- images;android-23;google_apis;x86_64' -n NAME -d 'DEVICE_ID' ---------------------------------------------------------------------- cpicanco · 2018-10-07 22:09 Hi, I have found the data for the -n -c parameters. -n is a custom name, choose wisely - c is a device id or name from ./avdmanager  list device Here are my notes: Quote# how to create an android virtual device (AVD) from command line # navigate to your android sdk path cd $ANDROID_SDK_HOME/tools/bin/ # update sdk repository ./sdkmanager --update # list available target android platforms ./avdmanager list target # install target android platforms # notice that we already have android-26 - it was installed earlier with the following command: # ./sdkmanager 'platforms;android-26' 'build-tools;26.0.2' 'tools' 'ndk-bundle' 'extras;android;m2repository' # here we will install android-23 also, as recommended by castle game engine: ./sdkmanager --install 'platforms;android-23' 'extras;google;google_play_services' 'build-tools;23.0.2' 'extras;android;m2repository' # find the desired/corresponding image for your target platform ./sdkmanager --list # install the system image you want, for example: ./sdkmanager 'system-images;android-23;google_apis;armeabi-v7a' ./sdkmanager 'system-images;android-23;google_apis;x86' ./sdkmanager 'system-images;android-26;google_apis;x86' # ./sdkmanager 'system-images;android-26;google_apis;x86_64' # ./sdkmanager 'system-images;android-26;google_apis_playstore;x86' # use one of the available devices as the -d parameter ./avdmanager list device # here we create our avd using the "Nexus 6P" device ./avdmanager create avd -c 100M -k 'system- images;android-23;google_apis;x86_64' -n Nexus_6P_A23 -d 'Nexus 6P' ---------------------------------------------------------------------- cpicanco · 2018-10-07 22:59 For some reason, LAMW is not finding my AVDs.... hummm ---------------------------------------------------------------------- cpicanco · 2018-10-08 01:12 So, what should I do?? https://github.com/jmpessoa/lazandroidmodulewizard/blob/77d39fcf12271d 70baccd9f1977e49a85e19f125/ide_tools/uformstar]"]>Blockedlator.pas ---------------------------------------------------------------------- A.S. · 2018-10-09 21:34 LAMW retrieves the AVDs list by the following command (LAMW/ide_tools/uformstar]"]>Blockedlator.pas, TfrmStar]"]>Blockedlator.GetAVDList): /tools/android list avds Check what this command returns for you. The list of connected devices (including AVDs): /platform-tools/adb devices (LAMW/ide_tools/apkbuild.pas, TApkBuilder.CheckAvailableDevices) ---------------------------------------------------------------------- cpicanco · 2018-10-09 23:19 Quote~/android/sdk/tools$ ./android list avds ********************************************************************** *** The "android" command is deprecated. For manual SDK, AVD, and project management, please use Android Studio. For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager ********************************************************************** *** Invalid or unsupported command "list avds" Supported commands are: android list target android list avd android list device android create avd android move avd android delete avd android list sdk android update sdk and Quote~/android/sdk/tools$ ./android list avd ********************************************************************** *** The "android" command is deprecated. For manual SDK, AVD, and project management, please use Android Studio. For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager ********************************************************************** *** Running /home/cpicanco/android/sdk/tools/bin/avdmanager list avd Parsing /home/cpicanco/android/sdk/add-ons/addon-google_apis- google-23/package.xmlParsing /home/cpicanco/android/sdk/build- tools/23.0.2/package.xmlParsing /home/cpicanco/android/sdk/build- tools/26.0.2/package.xmlParsing /home/cpicanco/android/sdk/emulator/package.xmlParsing /home/cpicanco/ android/sdk/extras/android/m2repository/package.xmlParsing /home/cpicanco/android/sdk/ndk-bundle/package.xmlParsing /home/cpicanco/android/sdk/patcher/v4/package.xmlParsing /home/cpicanco/android/sdk/platform-tools/package.xmlParsing /home/cpicanco/android/sdk/platforms/android-23/package.xmlParsing /home/cpicanco/android/sdk/platforms/android-26/package.xmlParsing /home/cpicanco/android/sdk/sources/android-23/package.xmlParsing /home/cpicanco/android/sdk/sources/android-26/package.xmlParsing /home/cpicanco/android/sdk/system- images/android-23/google_apis/armeabi-v7a/package.xmlParsing /home/cpicanco/android/sdk/system- images/android-23/google_apis/x86/package.xmlParsing /home/cpicanco/android/sdk/system- images/android-26/google_apis/x86/package.xmlParsing /home/cpicanco/android/sdk/system- images/android-26/google_apis/x86_64/package.xmlParsing /home/cpicanco/android/sdk/system- images/android-26/google_apis_playstore/x86/package.xmlParsing /home/cpicanco/android/sdk/tools/package.xmlAvailable Android Virtual Devices:     Name: Nexus_6P_A23   Device: Nexus 6P (Google)     Path: /home/cpicanco/.android/avd/Nexus_6P_A23.avd   Target: Google APIs (Google Inc.)           Based on: Android 6.0 (Marshmallow) Tag/ABI: google_apis/x86   Sdcard: 100M ---------     Name: Nexus_6P_A26   Device: Nexus 6P (Google)     Path: /home/cpicanco/.android/avd/Nexus_6P_A26.avd   Target: Google APIs (Google Inc.)           Based on: Android 8.0 (Oreo) Tag/ABI: google_apis/x86   Sdcard: 100M So it should be using "tools/bin/sdkmanager" or "tools/bin/avdmanager" ---------------------------------------------------------------------- WayneSherman · 2018-10-14 15:56 Quote from: cpicanco on October 07, 2018, 09:26:00 pmAbout the recent LAMW's linux install instructions: https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/li nux/tutorial_by_waynesherman/howto%20- %20Android%20Development%20Environment%20on%20Linux.txt Everything is working just fine in my debian 9 based distro, with two exceptions: 1) the installation will not work if you use fpcupdeluxe v1.6.1n (I didn't test other versions). 2) no instructions on how setting up AVDs from command line (no gui). (important for setting up a functional emulator) More info is at the original forum post: http://forum.lazarus.freepascal.org/index.php/topic,40750.0.html See post #3 for info on running an emulator from the command line. See also here:  http://wiki.freepascal.org/LAMW_on_Linux