我如何调试android上的phonegap

时间:2016-12-12 06:52:23

标签: android cordova phonegap-desktop-app

我在phonegap上创建了一个小应用程序,它在phonegap模拟器(phonegap桌面应用程序)上无缝工作。没有任何错误,但是当我把它设为.apk并安装它时,它显示效果不好而且我的Android手机上丢失了一个动画。
我如何为Android手机调试它? 这是模拟器的服务器日志

starting app server...
listening on 192.168.8.103:3000
listening on 192.168.121.1:3000
listening on 192.168.184.1:3000
listening on 192.168.56.1:3000
starting app server...

listening on 192.168.8.103:3000
listening on 192.168.121.1:3000
listening on 192.168.184.1:3000
listening on 192.168.56.1:3000
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
200 /__api__/appzip
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmL8Z4
200 /socket.io/?EIO=3&transport=polling&t=LZmL8cP&sid=49VsFNOcZN7s0-iiAAAA
200 /socket.io/?EIO=3&transport=polling&t=LZmL8e5&sid=49VsFNOcZN7s0-iiAAAA
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmL9QX
200 /socket.io/?EIO=3&transport=polling&t=LZmL9S7&sid=1EoibSsG62mUHX_oAAAB
200 /socket.io/?EIO=3&transport=polling&t=LZmL9Td&sid=1EoibSsG62mUHX_oAAAB
 Player4 has <code>1st place</code>,Player2 has <code>2nd place</code>,Player1 has <code>3rd place</code>
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmLJet
200 /socket.io/?EIO=3&transport=polling&t=LZmLJhR&sid=nblpkBATxGXk29zHAAAC
200 /socket.io/?EIO=3&transport=polling&t=LZmLJiO&sid=nblpkBATxGXk29zHAAAC
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmLKT-
200 /socket.io/?EIO=3&transport=polling&t=LZmLKVV&sid=Rt1t6DXYQ3hJMlItAAAD
200 /socket.io/?EIO=3&transport=polling&t=LZmLKWS&sid=Rt1t6DXYQ3hJMlItAAAD
200 /socket.io/?EIO=3&transport=polling&t=LZmLfki
200 /socket.io/?EIO=3&transport=polling&t=LZmLfl6&sid=Gwyy1HNxMQUIcelzAAAE
200 /socket.io/?EIO=3&transport=polling&t=LZmLflH&sid=Gwyy1HNxMQUIcelzAAAE
200 /socket.io/?EIO=3&transport=polling&t=LZmL_qv
200 /socket.io/?EIO=3&transport=polling&t=LZmL_rN&sid=Q3pidD_igEW1NLL7AAAF
200 /socket.io/?EIO=3&transport=polling&t=LZmL_rX&sid=Q3pidD_igEW1NLL7AAAF
200 /socket.io/?EIO=3&transport=polling&t=LZmMK-6
200 /socket.io/?EIO=3&transport=polling&t=LZmML0H&sid=vQCzE3JlaQlHzVacAAAG
200 /socket.io/?EIO=3&transport=polling&t=LZmML0d&sid=vQCzE3JlaQlHzVacAAAG
200 /socket.io/?EIO=3&transport=polling&t=LZmMg8A
200 /socket.io/?EIO=3&transport=polling&t=LZmMg8l&sid=E_Nsc0xVr1cBjOtNAAAH
200 /socket.io/?EIO=3&transport=polling&t=LZmMg8y&sid=E_Nsc0xVr1cBjOtNAAAH
200 /socket.io/?EIO=3&transport=polling&t=LZmOEmt
200 /socket.io/?EIO=3&transport=polling&t=LZmOEtO&sid=Ugk1tWlvHpgRV74FAAAI
200 /socket.io/?EIO=3&transport=polling&t=LZmOEut&sid=Ugk1tWlvHpgRV74FAAAI
200 /socket.io/?EIO=3&transport=polling&t=LZmOFVZ
200 /socket.io/?EIO=3&transport=polling&t=LZmOFZF&sid=TQEOMBKqo8emwNqgAAAJ
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
200 /__api__/appzip
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmOK_O
200 /socket.io/?EIO=3&transport=polling&t=LZmOL77&sid=AMDD8Eaux5CpuNZRAAAK
200 /socket.io/?EIO=3&transport=polling&t=LZmOLAA&sid=AMDD8Eaux5CpuNZRAAAK
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmOLxB
200 /socket.io/?EIO=3&transport=polling&t=LZmOLyb&sid=8boLvjFtH_hGe20-AAAL
200 /socket.io/?EIO=3&transport=polling&t=LZmOLzW&sid=8boLvjFtH_hGe20-AAAL
  has <code>1st place</code>
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmOSl5
200 /socket.io/?EIO=3&transport=polling&t=LZmOStg&sid=cntD6D0xi4MpPFyDAAAM
200 /socket.io/?EIO=3&transport=polling&t=LZmOSuk&sid=cntD6D0xi4MpPFyDAAAM
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmOTe_
200 /socket.io/?EIO=3&transport=polling&t=LZmOTh4&sid=j_VdXHH9UjQUJ-OlAAAN
200 /socket.io/?EIO=3&transport=polling&t=LZmOTj6&sid=j_VdXHH9UjQUJ-OlAAAN
 Shehbaz has <code>1st place</code>
200 /socket.io/?EIO=3&transport=polling&t=LZmPgFw
200 /socket.io/?EIO=3&transport=polling&t=LZmPgJF&sid=PLIgYIBl0_a-bkl3AAAO
200 /socket.io/?EIO=3&transport=polling&t=LZmPgNT&sid=PLIgYIBl0_a-bkl3AAAO
200 /socket.io/?EIO=3&transport=polling&t=LZmPgev
200 /socket.io/?EIO=3&transport=polling&t=LZmPghr
200 /socket.io/?EIO=3&transport=polling&t=LZmPgj_&sid=MwrWSa7VyAmjMGwrAAAQ
200 /socket.io/?EIO=3&transport=polling&t=LZmPglr&sid=MwrWSa7VyAmjMGwrAAAQ
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmPhXf
200 /socket.io/?EIO=3&transport=polling&t=LZmPhaE&sid=tTx1_VUbzViTOB7pAAAR
200 /socket.io/?EIO=3&transport=polling&t=LZmPheT&sid=tTx1_VUbzViTOB7pAAAR
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
200 /__api__/appzip
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmPl0U
200 /socket.io/?EIO=3&transport=polling&t=LZmPl6e&sid=3G45N2HHMXEQOOhaAAAS
200 /socket.io/?EIO=3&transport=polling&t=LZmPl7Z&sid=3G45N2HHMXEQOOhaAAAS
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmPlx1
200 /socket.io/?EIO=3&transport=polling&t=LZmPlyp&sid=Z9PQRjhD0E6A6vqKAAAT
200 /socket.io/?EIO=3&transport=polling&t=LZmPlzb&sid=Z9PQRjhD0E6A6vqKAAAT
 Eniwy has <code>3rd place</code>,Ali bhai has <code>1st place</code>,Shejbaz has <code>2nd place</code>
file changed D:\app\Randomize Players\www\players.html
file changed D:\app\Randomize Players\www\players.html
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
200 /__api__/update
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmT3FY
200 /socket.io/?EIO=3&transport=polling&t=LZmT3HE&sid=yke9xFWFQc1nYsKsAAAU
200 /socket.io/?EIO=3&transport=polling&t=LZmT3ID&sid=yke9xFWFQc1nYsKsAAAU
file changed D:\app\Randomize Players\www\css\player.css
200 /__api__/update
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmTAAr
200 /socket.io/?EIO=3&transport=polling&t=LZmTAD9&sid=EoGv5KocutVoOfKQAAAV
200 /socket.io/?EIO=3&transport=polling&t=LZmTAFQ&sid=EoGv5KocutVoOfKQAAAV
200 /socket.io/?EIO=3&transport=polling&t=LZmTbII
200 /socket.io/?EIO=3&transport=polling&t=LZmTbJd&sid=4tC_0gV5WS0bdzyqAAAW
200 /socket.io/?EIO=3&transport=polling&t=LZmTbJw&sid=4tC_0gV5WS0bdzyqAAAW
200 /socket.io/?EIO=3&transport=polling&t=LZmW8et
200 /socket.io/?EIO=3&transport=polling&t=LZmW8fN&sid=wtFpbTobK6iDZDf2AAAX
200 /socket.io/?EIO=3&transport=polling&t=LZmW8fb&sid=wtFpbTobK6iDZDf2AAAX
200 /socket.io/?EIO=3&transport=polling&t=LZmYFWK
200 /socket.io/?EIO=3&transport=polling&t=LZmYFaY&sid=8dUO2qsny-Ewi3eCAAAY
200 /socket.io/?EIO=3&transport=polling&t=LZmYFbW&sid=8dUO2qsny-Ewi3eCAAAY
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmYGL6
200 /socket.io/?EIO=3&transport=polling&t=LZmYGMz&sid=r6Naa-sIYhBCC4VnAAAZ
200 /socket.io/?EIO=3&transport=polling&t=LZmYGNo&sid=r6Naa-sIYhBCC4VnAAAZ
 One more has <code>1st place</code>,Anyother has <code>3rd place</code>,Any name has <code>2nd place</code>
file changed D:\app\Randomize Players\www\players.html
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
200 /__api__/update
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmYh1O
200 /socket.io/?EIO=3&transport=polling&t=LZmYh3U&sid=uU7gkj0-hxD998GjAAAa
200 /socket.io/?EIO=3&transport=polling&t=LZmYh4c&sid=uU7gkj0-hxD998GjAAAa
 New name has <code>1st place</code>
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmYm_E
200 /socket.io/?EIO=3&transport=polling&t=LZmYn1t&sid=qYVSLu5LJrNsliJjAAAb
200 /socket.io/?EIO=3&transport=polling&t=LZmYn2i&sid=qYVSLu5LJrNsliJjAAAb
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmYnop
200 /socket.io/?EIO=3&transport=polling&t=LZmYnq3&sid=OxWGIrSgi8YYB7LIAAAc
200 /socket.io/?EIO=3&transport=polling&t=LZmYns5&sid=OxWGIrSgi8YYB7LIAAAc
200 /socket.io/?EIO=3&transport=polling&t=LZmYoCd
200 /socket.io/?EIO=3&transport=polling&t=LZmYoF3&sid=6VIBd6HSaPhWAlZeAAAd
200 /socket.io/?EIO=3&transport=polling&t=LZmYoJp&sid=6VIBd6HSaPhWAlZeAAAd
200 /socket.io/?EIO=3&transport=polling&t=LZmYoeB
200 /socket.io/?EIO=3&transport=polling&t=LZmYoiG&sid=IGprTGDDIX8L2DgIAAAe
200 /socket.io/?EIO=3&transport=polling&t=LZmYoky
200 /socket.io/?EIO=3&transport=polling&t=LZmYon4&sid=XJy_pulahSOeiJssAAAf
200 /socket.io/?EIO=3&transport=polling&t=LZmYoo0&sid=XJy_pulahSOeiJssAAAf
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmYpZa
200 /socket.io/?EIO=3&transport=polling&t=LZmYpdr&sid=Gi6EqQno1SlhkBNjAAAg
200 /socket.io/?EIO=3&transport=polling&t=LZmYpe_&sid=Gi6EqQno1SlhkBNjAAAg
200 /socket.io/?EIO=3&transport=polling&t=LZma4VJ
200 /socket.io/?EIO=3&transport=polling&t=LZma4Vv&sid=rI3ci1_ki03zWLG9AAAh
200 /socket.io/?EIO=3&transport=polling&t=LZma4W6&sid=rI3ci1_ki03zWLG9AAAh
200 /socket.io/?EIO=3&transport=polling&t=LZma7fU
file changed D:\app\Randomize Players\www\players.html
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
200 /__api__/appzip
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmcAN_
200 /socket.io/?EIO=3&transport=polling&t=LZmcAVp&sid=2Ys3LAl_42hhHnNSAAAj
200 /socket.io/?EIO=3&transport=polling&t=LZmcAY_&sid=2Ys3LAl_42hhHnNSAAAj
304 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmcBIv
200 /socket.io/?EIO=3&transport=polling&t=LZmcBKU&sid=Ty0OIQEjR43fzdeWAAAk
200 /socket.io/?EIO=3&transport=polling&t=LZmcBN7&sid=Ty0OIQEjR43fzdeWAAAk
  has <code>1st place</code>
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
200 /__api__/update
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmcCO6
200 /socket.io/?EIO=3&transport=polling&t=LZmcCQd&sid=OsZ9o67YX-RuwXf6AAAl
200 /socket.io/?EIO=3&transport=polling&t=LZmcCUX&sid=OsZ9o67YX-RuwXf6AAAl
  has <code>1st place</code>
file changed D:\app\Randomize Players\www\players.html
undefined Content Security Policy has been added: <meta http-equiv="Content-Security-Policy" content="default-src * gap: ws: https://ssl.gstatic.com;img-src 'self' data: content:;style-src 'self' 'unsafe-inline' data: blob:;script-src * 'unsafe-inline' 'unsafe-eval' data: blob:;">
200 /__api__/update
file changed D:\app\Randomize Players\www\index.html
file changed D:\app\Randomize Players\www\index.html
file changed D:\app\Randomize Players\www\index.html
file changed D:\app\Randomize Players\www\index.html
200 /socket.io/socket.io.js
200 /socket.io/?EIO=3&transport=polling&t=LZmdpG2
200 /socket.io/?EIO=3&transport=polling&t=LZmdpRA&sid=p7aJn0LaM2XNueWEAAAm
200 /socket.io/?EIO=3&transport=polling&t=LZmdpRz&sid=p7aJn0LaM2XNueWEAAAm

这些是localserver的统计信息。这些是上传的.apk的日志

Build Date: 2016-12-12 01:21:40 +0000
--------------------------------------------------------------------------------
PLUGIN OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
COMPILE OUTPUT
--------------------------------------------------------------------------------
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:compileDebugAidl
:CordovaLib:generateDebugBuildConfig
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:processDebugManifest
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:prepareProjectCordovaLibUnspecifiedDebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:prePackageMarkerForDebug
:transformClassesWithDexForDebug
Merged dex #1 (86 defs/108.5KiB)
Merged dex #2 (7 defs/2.5KiB)
Result is 93 defs/131.4KiB. Took 0.0s
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
:validateDebugSigning
:packageDebug
:zipalignDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 2.166 secs
Built the following apk(s): 
    /project/build/outputs/apk/project-debug.apk

1 个答案:

答案 0 :(得分:0)

您可以使用adb logcat查看设备日志,也可以使用Chrome的远程设备工具调试您的应用。

相关问题