Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
280 views
in Technique[技术] by (71.8m points)

ios - 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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...