当我尝试从android工具启动AVD时,只看到一个大黑屏,上面写有" ANDROID"。 没发生什么事。 可能是什么问题呢?
哇,事实证明,这需要花费很多时间。 问题已关闭:-)
是的,只需等待:p一旦启动了仿真器,就无需再次关闭它,只需继续将应用程序重新部署到它即可
如果您的下一个问题是如何加快速度,那就有个坏消息。 stackoverflow.com/questions/3210198/
因此,您没有等5分钟才能开始,然后才认为出了什么问题?
实际上,它花费了超过5分钟的时间:)
有时,AVD的首次启动可能会花费很长时间,因此后续启动会更快。 另外,请避免将其配置为具有较大的Flash SDCard,否则将花费大量时间将其中包含0的海量文件写入磁盘。
如果您想知道AVD模拟器是否正在挂起或正在度过美好的时光,请查看Eclipse中的Console和LogCat视图。 当您的应用程序在模拟器中启动时,您应该在LogCat中看到以下行:
04-04 16:49:51.475: INFO/ActivityManager(58): Displayed activity Your_packagename/.Your_App Name: 1191 ms (total 30764 ms)
04-04 16:49:51.475: INFO/ActivityManager(58): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 30766 ms (total 30766 ms)
控制台通常会说
[2011-04-04 16:48:58 - YourApp] ------------------------------
[2011-04-04 16:48:58 - YourApp] Android Launch!
[2011-04-04 16:48:58 - YourApp] adb is running normally.
[2011-04-04 16:48:58 - YourApp] Performing your application here activity launch
[2011-04-04 16:48:58 - YourApp] Automatic Target Mode: launching new emulator with compatible AVD 'AVD_2.2_L8'
[2011-04-04 16:48:58 - YourApp] Launching a new emulator with Virtual Device 'AVD_2.2_L8'
[2011-04-04 16:48:59 - YourApp] New emulator found: emulator-5554
[2011-04-04 16:48:59 - YourApp] Waiting for HOME ('android.process.acore') to be launched...
[2011-04-04 16:49:20 - YourApp] HOME is up on device 'emulator-5554'
[2011-04-04 16:49:20 - YourApp] Uploading YourApp.apk onto device 'emulator-5554'
[2011-04-04 16:49:20 - YourApp] Installing YourApp.apk...
[2011-04-04 16:49:48 - YourApp] Success!
[2011-04-04 16:49:48 - YourApp] Starting activity your_application on device emulator-5554
[2011-04-04 16:49:50 - YourApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=your_package/.your_app }
如果您在一分钟左右的时间内没有在各自的控制台中找到这些语句的结尾,那么您的模拟器可能已冻结。
就我而言,原因是系统内存不足。 当我关闭一些占用大量内存的应用程序时,AVD成功启动。
如果您没有安装英特尔的HAXM,但尝试使用它,则Android Studio将只等待模拟器永久启动,并且您将不会看到错误消息。 从命令行启动仿真器以查看任何错误消息:
C:\Users\.....\android-sdk\tools\emulator.exe -avd Nexus_4_API_21 -netspeed full -netdelay none