Recent

Author Topic: Running LAMW apk on linux (avdmanager, command line tool)  (Read 1298 times)

cpicanco

  • Sr. Member
  • ****
  • Posts: 458
    • My Portfolio
Running LAMW apk on linux (avdmanager, command line tool)
« on: October 07, 2018, 09:26:00 pm »
About the recent LAMW's linux install instructions:

https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/linux/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

  • Sr. Member
  • ****
  • Posts: 458
    • My Portfolio
Re: Running LAMW apk on linux (avdmanager, command line tool)
« Reply #1 on: October 08, 2018, 12:09:13 am »
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

  • Sr. Member
  • ****
  • Posts: 458
    • My Portfolio
Re: Running LAMW apk on linux (avdmanager, command line tool)
« Reply #2 on: October 08, 2018, 12:59:29 am »
For some reason, LAMW is not finding my AVDs.... hummm


A.S.

  • Jr. Member
  • **
  • Posts: 72
Re: Running LAMW apk on linux (avdmanager, command line tool)
« Reply #4 on: October 09, 2018, 11:34:06 pm »
LAMW retrieves the AVDs list by the following command (LAMW/ide_tools/uformstartemulator.pas, TfrmStartEmulator.GetAVDList):
<sdk_path>/tools/android list avds
Check what this command returns for you.

The list of connected devices (including AVDs):
<sdk_path>/platform-tools/adb devices
(LAMW/ide_tools/apkbuild.pas, TApkBuilder.CheckAvailableDevices)

cpicanco

  • Sr. Member
  • ****
  • Posts: 458
    • My Portfolio
Re: Running LAMW apk on linux (avdmanager, command line tool)
« Reply #5 on: October 10, 2018, 01:19:55 am »
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

  • New member
  • *
  • Posts: 49
Re: Running LAMW apk on linux (avdmanager, command line tool)
« Reply #6 on: October 14, 2018, 05:56:08 pm »
About the recent LAMW's linux install instructions:
https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/linux/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