제발 cordova 프레임 워크를 추가 할 반응 응용 프로그램 하이브리드 응용 프로그램이 있습니다. 나는 코드 로바 프로젝트를 추가하고 에뮬레이터에서 내 앱을 성공적으로 빌드, 릴리스, 에뮬레이션했습니다. cordova 프로젝트는 내 index.html에서 언급 한 내 응용 프로그램에 index.js를 추가했습니다.하이브리드 응용 프로그램에서 onDeviceReady를 디버깅하는 방법 - cordova
</head>
<body>
<div id="root" class="root app">
<div class="mobile-page">
<img class="spinner" src="img/symbol-logo.svg" />
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="index.js"></script>
<script src="boot.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,Promise,Array.from,Array.prototype.find,Array.prototype.includes,String.prototype.startsWith,String.prototype.includes,Math.sign,Intl.~locale.en,Intl.~locale.id,Intl.~locale.ru,Intl.~locale.fr&unknown=polyfill"></script>
<script async src="app.js"></script>
app.js
위 웹팩를 사용하여 구축하고 내 애플 JS 반응하여 개발된다. 내하는 index.js 이벤트가 전혀라고하면 내 문제가
var app = {
initialize: function() {
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
document.addEventListener('resume', this.onDeviceResume, false);
},
'receivedEvent'
onDeviceReady: function() {
app.receivedEvent('deviceready');
codePush.sync();
},
onDeviceResume: function() {
app.receivedEvent('resume');
codePush.sync();
},
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id);
},
};
app.initialize();
위 내하는 index.js, 나는 확실하지 않다. 위에서 onDeviceReady 이벤트가 호출되는지 테스트/디버그하고 싶습니다. 나는 간단한 콘솔 메시지를 인쇄하고 디버그 할 수 있기를 원한다. 제발 어떻게해야합니까?
Chrome Inspect Device를 사용하여 모바일 로그를 확인하십시오. 이 아이디어가 없다면 –
http://stackoverflow.com/a/10050508/3340702 참조 – lifeisfoo