android - 使用 Apportable 时可以在 xcode 中安装 Android 设备模拟器吗

标签 android ios simulator apportable

当使用 Apportable 将 iOS 应用程序转换为 Android 时,您能否在 Xcode 中安装 Android 设备模拟器,或者我是否需要 Android 设备来编译和运行该项目?我没有安卓设备,想在购买之前测试一下。

谢谢

最佳答案

请注意,使用 Android 设备通常比使用模拟器容易得多,但使用模拟器也是可能的:

~/.apportable/SDK/toolchain/macosx/android-sdk/tools/android 将启动可以创建 AVD 的 android 工具。

确保安装了 ARM EABI v7a System Image,然后创建一个 AVD,Target 为 API 级别 17,CPU/ABI 为 ARM (armeabi-v7a),SD 卡大小为 500 MiB 左右,我通常选择一个WVGA800 的内置皮肤,选择抽象 LCD 密度为 240、最大 VM 应用程序堆为 48 和设备内存大小至少为 512 的硬件特性,内部存储应至少为 500 MiB。最重要的是确保选中使用主机 GPU 复选框。

运行模拟器:

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

这将启动 android 模拟器(注意:这将需要一些时间才能启动)并且您可以使用模拟器运行应用程序并进行调试,前提是在调用适当的工具时指定 ROOTED=yes,例如

ROOTED=yes MTP=no apportable debug

这里是模拟器配置 ~/.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

关于android - 使用 Apportable 时可以在 xcode 中安装 Android 设备模拟器吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17971792/

相关文章:

ios - 更新到 iOS 9 错误 : i386 Unsupported architecture

iOS:如何在同一代码 xcode swift 中为设备和模拟器添加不同的框架?

android - MPAndroidChart如何隐藏左右边框?

android - 如何格式化要发送到 BLE 设备上的特征的字节数组?

ios - UITableViewCell 的高度不起作用

iphone - 在模拟器下运行的 iphone 应用程序的调试版本——以编程方式找到自己的项目文件?

javascript - WebView 出现问题,加载时卡住

java - Activity 是 MainFragmentListener 的实例,是真的吗?

ios - 如何修复 Swift 中的 Disappearing/Invisible/Empty UITableViewCells 问题?

ios - 如何以最短的迭代速度更快地与服务器联系人同步联系人?