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

杀马特。学长 韩版系。学妹 提交于 2019-11-27 02:57:59

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/17971792/can-you-install-an-android-device-simulator-in-xcode-when-using-apportable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!