Search code examples
androidiossimulatorapportable

Can you install an Android Device Simulator in xcode when using Apportable


Can you install an Android Device Simulator in Xcode when using Apportable to convert an iOS app to Android or do I need an Android device to compile and run the project? I dont have an android device and wanted to test this before I go buy one.

Thanks


Solution

  • Note that it is generally much easier to work with an Android device than the emulator, but it is possible to use the emulator:

    ~/.apportable/SDK/toolchain/macosx/android-sdk/tools/android will launch the android tool which can create AVD's.

    Make sure to install the ARM EABI v7a System Image, then create an AVD with a Target of API level 17, CPU/ABI of ARM (armeabi-v7a), the SD card size of around 500 MiB, I usually choose a builtin skin of WVGA800, select the Hardware features of Abstracted LCD density of 240, Max VM application heap of 48 and Device ram size of at least 512, internal storage should be at least 500 MiB. And most of all make sure to check the box for Use Host GPU.

    to run the emulator:

    DYLD_LIBRARY_PATH=~/.apportable/SDK/toolchain/macosx/android-sdk/tools/lib/ ~/.apportable/SDK/toolchain/macosx/android-sdk/tools/emulator-arm -avd emulator -gpu on

    This will launch the android emulator (note: this will take a bit to launch) and you can use the emulator to run apps with and debug provided that when invoking the apportable tool specify ROOTED=yes e.g.

    ROOTED=yes MTP=no apportable debug

    here is emulator configuration ~/.android/avd/emulator.avd/config.ini:

    avd.ini.encoding=ISO-8859-1
    hw.dPad=no
    hw.lcd.density=320
    sdcard.size=500M
    hw.cpu.arch=arm
    hw.device.hash=-708107041
    hw.camera.back=none
    disk.dataPartition.size=500M
    hw.gpu.enabled=yes
    skin.dynamic=yes
    skin.path=720x1280
    hw.keyboard=yes
    hw.cpu.model=cortex-a8
    hw.ramSize=1024
    hw.device.manufacturer=Google
    hw.sdCard=yes
    hw.mainKeys=no
    hw.accelerometer=yes
    skin.name=720x1280
    abi.type=armeabi-v7a
    hw.trackBall=no
    hw.device.name=Galaxy Nexus
    hw.battery=yes
    hw.sensors.proximity=yes
    image.sysdir.1=system-images/android-17/armeabi-v7a/
    hw.sensors.orientation=yes
    hw.audioInput=yes
    hw.camera.front=none
    hw.gps=yes
    vm.heapSize=200