Why isn't my Android app working when I test it on a real device?

送分小仙女□ 提交于 2019-12-12 04:19:08

问题


I'm building an Android app with Ionic Framework, and am trying to run it on a real device with USB debugging, like in these tutorials:

http://www.neilberry.com/how-to-run-your-ionic-app-on-real-devices/?s=2015-08-24-how-to-run-your-ionic-app-on-real-devices

http://junerockwell.com/how-to-run-ionic-on-real-devices/

Step-1

$ ionic platform add android

$ ionic build android

After adding the Android platform and building an APK with the above commands, it works correctly with no error. So, I try the next step:

Step-2

I connected device and PC via Debugging mode to run android devices. I ran the command ionic run android. I get the below error messageL

$ ionic run android

ANDROID_HOME=C:\Android\sdk JAVA_HOME=C:\Program Files\java\jdk1.8.0_25 WARNING : No target specified, deploying to emulator WARNING : no emulator specified, defaulting to Nexus_5_API_23_x86 Waiting for emulator... emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed!

How can I solve this problem?

List of my ionic info:

$ ionic info

Your system information: Cordova CLI: 5.4.1 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.0 Ionic Version: 1.2.4 Ionic CLI Version: 1.7.13 Ionic App Lib Version: 0.6.5 OS: Windows 8.1 Node Version: v4.2.4


回答1:


I don't use ionic, I use cordova. In cordova you call the emulator by:

cordova emulate android 

and to run the app on a device:

cordova run android --device

Maybe you try:

ionic run android --device



回答2:


Maybe you can try running adb start-server. I know I need to do this first before being able to see my device in chrome://inspect/#devices. You of course need adb which probably comes from the Android SDK.




回答3:


This error isn't related to ionic frameworks because HAXM installer isn't installed on Android SDK Manager.

This question already has an answer here: Error in launching AVD with AMD processor.



来源:https://stackoverflow.com/questions/34939279/why-isnt-my-android-app-working-when-i-test-it-on-a-real-device

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