1 利用模拟器启动android
创建和启动模拟器
启动之前,需要创建AVD:
转载请注明出处 [By SELinux+]
[root@fc16 bin]# ./android list avd SWT folder '/root/android/out/host/linux-x86/framework/x86_64' does not exist. Please export ANDROID_SWT to point to the folder containing swt.jar for your platform.
解决方法:
export ANDROID_SWT=/root/android/out/host/linux-x86/framework
或者写到.bash_profile文件
[root@fc16 bin]# source /root/.bash_profile
创建设备
[root@fc16 bin]# ./android list avd Available Android Virtual Devices: 现实没有avd设备 创建avd设备
[root@fc16 android]# lunch sdk-eng ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=4.1.1 TARGET_PRODUCT=sdk TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a HOST_ARCH=x86 HOST_OS=linux HOST_OS_EXTRA=Linux-3.4.7-1.fc16.x86_64-x86_64-with-fedora-16-Verne HOST_BUILD_TYPE=release BUILD_ID=JRO03C OUT_DIR=out make sdk [root@fc16 android]# cd out/host/linux-x86/sdk/android-sdk_eng.root_linux-x86/ [root@fc16 android-sdk_eng.root_linux-x86]# ls add-ons extras RELEASE_NOTES.html tests docs platforms samples tools documentation.html platform-tools system-images [root@fc16 android-sdk_eng.root_linux-x86]# cd tools/ [root@fc16 tools]# ./android list avd Available Android Virtual Devices: [root@fc16 tools]# ./android create avd -n and1 -t 1 Auto-selecting single ABI armeabi-v7a Android 4.1.1 is a basic Android platform. Do you wish to create a custom hardware profile [no] Created AVD 'and1' based on Android 4.1.1, ARM (armeabi-v7a) processor, with the following hardware config: hw.lcd.density=240 vm.heapSize=48 hw.ramSize=512
查看avd列表
[root@fc16 tools]# ./android list avd Available Android Virtual Devices: Name: and1 Path: /root/.android/avd/and1.avd Target: Android 4.1.1 (API level 16) ABI: armeabi-v7a Skin: WVGA800
启动模拟器
[root@fc16 tools]# ./emulator -avd and1 SDL init failure, reason is: No available video device
Android模拟器错误:SDL init failure, reason is: No available video device原因和解决方法
Android应用开发过程中,使用模拟器执行程序是调试必不可少的一步.
错误:
很多人会遇到错误:SDL init failure, reason is: No available video device
系统环境:Fedora 16
原因:
这个出错主要是在64位的linux系统中,原因是android模拟器是使用了一些32位的软件包,通常64为的系统中安装包的时候不会把32位的包装上.
解决方法:
解决问题的方法就是安装所需的32位软件包.
执行以下命令安转相应32位的包即可:
yum install libXrandr.i686 libX11.i686
如果执行模拟还出现一些软件包找不到的错误,可以安装以下软件包
yum install glibc.i686 ncurses-libs.i686 compat-libstdc++-33.i686 libstdc++.i686 libzip.i686
Wow, this post is fastidious, my younger sister is analyzing such things, therefore I am going to let know her.