저는 간단한 console.log()
기능이있는 기본 Cordova 애플리케이션이 있습니다.Cordova에서 Android 앱을 실행할 때 console.log가 작동하지 않습니다.
<!DOCTYPE html>
<html>
<head>
...
</head>
<body>
...
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("Device is ready!");
}
</script>
</body>
</html>
을 당신이 기본적으로 하단에 자동으로 생성 된 일부 파일 console.log
스크립트와 동일합니다 볼 수 있듯이 다음과 같이
내 index.html 파일 보인다.
불행히도 cordova emulate android
을 사용하여 Android에서 앱을 실행하면 어디서나 console.log(..)
의 출력을 찾을 수없는 것 같습니다. 그러나, 그것은 브라우저에서 잘 작동합니다.
android studio를 사용하고 계십니까? – Akis
아니요 명령 줄을 사용하여 실행했습니다. 비록 당신이 안드로이드 스튜디오에서 프로젝트를 실행한다면 –
을 설치했습니다. logcat 윈도우에서 console.log를 찾을 수 있습니다. – Akis