我正在使用 Ionic 开发跨平台应用程序,但最近我无法将应用程序部署到 Cordova 推出的 android 模拟器。
从 ionic 中提取并构建“ super ”示例应用程序后,我运行 cordova run android --verbose。这会产生以下输出:
No scripts found for hook "before_run".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /Users/samborick/ionic/super-test/platforms/android/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/assets/www
Wrote out android application name "Excalibur" to /Users/samborick/ionic/super-test/platforms/android/res/values/strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (0.0.1): 1
Wrote out Android package name "io.ionic.starter" to /Users/samborick/ionic/super-test/platforms/android/src/io/ionic/starter/MainActivity.java
Updating icons at platforms/android/res
Updating splash screens at platforms/android/res
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
ANDROID_HOME=/Users/samborick/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Subproject Path: CordovaLib
Running command: /Users/samborick/ionic/super-test/platforms/android/gradlew cdvBuildDebug -b /Users/samborick/ionic/super-test/platforms/android/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_2cqobl60hbcmb2dzjehzt5zko.run(/Users/samborick/ionic/super-test/platforms/android/build.gradle:141)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareOrgApacheCordovaCordovaLib630DebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac UP-TO-DATE
:compileDebugNdk UP-TO-DATE
:compileDebugSources UP-TO-DATE
:mergeDebugShaders UP-TO-DATE
:compileDebugShaders UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:transformClassesWithDexForDebug UP-TO-DATE
:mergeDebugJniLibFolders UP-TO-DATE
:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:validateSigningDebug
:packageDebug UP-TO-DATE
:assembleDebug UP-TO-DATE
:cdvBuildDebug UP-TO-DATE
BUILD SUCCESSFUL
Total time: 1.13 secs
Command finished with error code 0: /Users/samborick/ionic/super-test/platforms/android/gradlew cdvBuildDebug,-b,/Users/samborick/ionic/super-test/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
Built the following apk(s):
/Users/samborick/ionic/super-test/platforms/android/build/outputs/apk/android-debug.apk
No scripts found for hook "before_deploy".
ANDROID_HOME=/Users/samborick/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Running command: adb devices
Command finished with error code 0: adb devices
No target specified and no devices found, deploying to emulator
Running command: adb devices
Command finished with error code 0: adb devices
Running command: adb devices
Command finished with error code 0: adb devices
Running adb shell command "cat /proc/cpuinfo" on target emulator-5584...
Running command: adb -s emulator-5584 shell cat /proc/cpuinfo
Command finished with error code 0: adb -s,emulator-5584,shell,cat,/proc/cpuinfo
Skipping build...
Built the following apk(s):
/Users/samborick/ionic/super-test/platforms/android/build/outputs/apk/android-debug.apk
Running adb shell command "ps" on target emulator-5584...
Running command: adb -s emulator-5584 shell ps
Command finished with error code 0: adb -s,emulator-5584,shell,ps
.Running adb shell command "ps" on target emulator-5584...
Running command: adb -s emulator-5584 shell ps
Command finished with error code 0: adb -s,emulator-5584,shell,ps
输出循环,重复:
Running command: adb -s emulator-5584 shell ps
Command finished with error code 0: adb -s,emulator-5584,shell,ps
当我在运行模拟器的情况下运行 adb -s emulator-5584 shell ps 时,我得到以下输出:
USER PID PPID VSIZE RSS WCHAN PC NAME
root 1 0 8504 1532 SyS_epoll_ 00000000 S /init
root 2 0 0 0 kthreadd 00000000 S kthreadd
root 3 2 0 0 smpboot_th 00000000 S ksoftirqd/0
root 5 2 0 0 worker_thr 00000000 S kworker/0:0H
root 7 2 0 0 smpboot_th 00000000 S migration/0
root 8 2 0 0 rcu_gp_kth 00000000 S rcu_preempt
root 9 2 0 0 rcu_gp_kth 00000000 S rcu_bh
root 10 2 0 0 rcu_gp_kth 00000000 S rcu_sched
root 11 2 0 0 smpboot_th 00000000 S migration/1
root 12 2 0 0 smpboot_th 00000000 S ksoftirqd/1
root 14 2 0 0 worker_thr 00000000 S kworker/1:0H
root 15 2 0 0 smpboot_th 00000000 S migration/2
root 16 2 0 0 smpboot_th 00000000 S ksoftirqd/2
root 18 2 0 0 worker_thr 00000000 S kworker/2:0H
root 19 2 0 0 smpboot_th 00000000 S migration/3
root 20 2 0 0 smpboot_th 00000000 S ksoftirqd/3
root 22 2 0 0 worker_thr 00000000 S kworker/3:0H
root 23 2 0 0 rescuer_th 00000000 S khelper
root 24 2 0 0 rescuer_th 00000000 S netns
root 335 2 0 0 rescuer_th 00000000 S writeback
root 337 2 0 0 rescuer_th 00000000 S bioset
root 339 2 0 0 rescuer_th 00000000 S kblockd
root 435 2 0 0 rescuer_th 00000000 S ata_sff
root 446 2 0 0 hub_thread 00000000 S khubd
root 455 2 0 0 rescuer_th 00000000 S md
root 465 2 0 0 rescuer_th 00000000 S cfg80211
root 580 2 0 0 kswapd 00000000 S kswapd0
root 647 2 0 0 fsnotify_m 00000000 S fsnotify_mark
root 665 2 0 0 rescuer_th 00000000 S crypto
root 794 2 0 0 rescuer_th 00000000 S iscsi_eh
root 808 2 0 0 scsi_error 00000000 S scsi_eh_0
root 811 2 0 0 scsi_error 00000000 S scsi_eh_1
root 867 2 0 0 rescuer_th 00000000 S uether
root 888 2 0 0 rescuer_th 00000000 S dm_bufio_cache
root 920 2 0 0 rescuer_th 00000000 S binder
root 923 2 0 0 rescuer_th 00000000 S hd-audio0
root 944 2 0 0 rescuer_th 00000000 S deferwq
root 949 1 3588 972 poll_sched 00000000 S /sbin/ueventd
root 1274 2 0 0 worker_thr 00000000 S kworker/0:1H
root 1275 2 0 0 kjournald2 00000000 S jbd2/vda-8
root 1277 2 0 0 rescuer_th 00000000 S ext4-rsv-conver
root 1278 2 0 0 kjournald2 00000000 S jbd2/vdb-8
root 1279 2 0 0 rescuer_th 00000000 S ext4-rsv-conver
logd 1281 1 15572 4136 sigsuspend 00000000 S /system/bin/logd
root 1286 2 0 0 kauditd_th 00000000 S kauditd
root 1289 1 6968 1236 __skb_recv 00000000 S /system/bin/debuggerd
root 1290 1 15096 2056 hrtimer_na 00000000 S /system/bin/vold
root 1292 1289 6712 416 __skb_recv 00000000 S debuggerd:signaller
root 1329 1 3392 380 SyS_epoll_ 00000000 S /sbin/healthd
root 1332 1 5748 1244 SyS_epoll_ 00000000 S /system/bin/lmkd
system 1333 1 6312 1340 binder_thr 00000000 S /system/bin/servicemanager
system 1334 1 55760 3384 SyS_epoll_ 00000000 S /system/bin/surfaceflinger
shell 1335 1 4884 960 n_tty_read ad5e4424 S /system/bin/sh
shell 1337 1 211160 1096 poll_sched 00000000 S /sbin/adbd
root 1364 2 0 0 rescuer_th 00000000 S kdmflush
root 1368 2 0 0 rescuer_th 00000000 S bioset
root 1369 2 0 0 rescuer_th 00000000 S kcryptd_io
root 1371 2 0 0 rescuer_th 00000000 S kcryptd
root 1372 2 0 0 dmcrypt_wr 00000000 S dmcrypt_write
root 1373 2 0 0 rescuer_th 00000000 S bioset
root 1386 2 0 0 kjournald2 00000000 S jbd2/dm-0-8
root 1387 2 0 0 rescuer_th 00000000 S ext4-rsv-conver
root 1392 2 0 0 worker_thr 00000000 S kworker/3:1H
root 1395 1 1065832 28092 poll_sched 00000000 S zygote
audioserver 1396 1 133892 10736 binder_thr 00000000 S /system/bin/audioserver
cameraserver 1397 1 23212 3292 binder_thr 00000000 S /system/bin/cameraserver
drm 1398 1 18084 2076 binder_thr 00000000 S /system/bin/drmserver
root 1399 1 6868 1568 unix_strea 00000000 S /system/bin/installd
keystore 1400 1 9500 1568 binder_thr 00000000 S /system/bin/keystore
mediacodec 1401 1 25672 4684 binder_thr 00000000 S media.codec
media 1402 1 28472 3392 binder_thr 00000000 S /system/bin/mediadrmserver
mediaex 1403 1 45940 3132 binder_thr 00000000 S media.extractor
media 1404 1 47800 2916 binder_thr 00000000 S /system/bin/mediaserver
root 1405 1 24756 2120 binder_thr 00000000 S /system/bin/netd
radio 1406 1 11420 1332 hrtimer_na 00000000 S /system/bin/rild
system 1408 1 10212 1564 binder_thr 00000000 S /system/bin/fingerprintd
system 1409 1 9188 1476 binder_thr 00000000 S /system/bin/gatekeeperd
root 1432 1 5460 1144 hrtimer_na 00000000 S /system/xbin/perfprofd
root 1583 1 4884 968 poll_sched 00000000 S sh
root 1630 1 5072 912 poll_sched 00000000 S /system/bin/ipv6proxy
wifi 1648 1 7524 1456 poll_sched 00000000 S /system/bin/hostapd
nobody 1649 1 5228 1020 poll_sched 00000000 S /system/bin/dnsmasq
system 1705 1395 1293932 81744 SyS_epoll_ 00000000 S system_server
root 1716 2 0 0 worker_thr 00000000 S kworker/2:1H
u0_a55 1782 1395 1153520 29712 SyS_epoll_ 00000000 S com.android.inputmethod.latin
u0_a28 1798 1395 1214980 61056 SyS_epoll_ 00000000 S com.android.systemui
media_rw 1811 1290 9504 2028 inotify_re 00000000 S /system/bin/sdcard
media_rw 1879 1290 9496 2020 inotify_re 00000000 S /system/bin/sdcard
radio 1911 1395 1173076 38484 SyS_epoll_ 00000000 S com.android.phone
root 1958 2 0 0 worker_thr 00000000 S kworker/1:1H
wifi 1961 1 10424 1964 poll_sched 00000000 S /system/bin/wpa_supplicant
u0_a15 2076 1395 1138824 23724 SyS_epoll_ 00000000 S com.google.android.ext.services
u0_a14 2130 1395 1327300 63908 SyS_epoll_ 00000000 S com.google.android.gms.persistent
u0_a29 2155 1395 1227728 26492 SyS_epoll_ 00000000 S com.google.android.googlequicksearchbox:interactor
u0_a21 2181 1395 1177176 45284 SyS_epoll_ 00000000 S com.google.android.apps.nexuslauncher
u0_a29 2312 1395 1500172 59036 SyS_epoll_ 00000000 S com.google.android.googlequicksearchbox:search
u0_a14 2509 1395 1483596 67088 SyS_epoll_ 00000000 S com.google.android.gms
u0_a54 3005 1395 1362604 43716 SyS_epoll_ 00000000 S com.google.android.talk
root 7158 2 0 0 worker_thr 00000000 S kworker/3:0
root 9213 2 0 0 worker_thr 00000000 S kworker/2:2
u0_a100 10639 1395 1425040 71684 SyS_epoll_ 00000000 S com.datacomand.mobile
u0_a90 12368 1395 1423056 73764 SyS_epoll_ 00000000 S com.ionicframework.ionicmaps365894
root 16636 2 0 0 worker_thr 00000000 S kworker/2:1
root 16637 2 0 0 worker_thr 00000000 S kworker/3:2
root 18693 2 0 0 worker_thr 00000000 S kworker/0:1
root 18703 2 0 0 worker_thr 00000000 S kworker/1:1
u0_a120 19290 1395 1405172 144104 SyS_epoll_ 00000000 S com.hungerperks.mobile
root 19419 2 0 0 worker_thr 00000000 S kworker/u9:4
u0_a52 19505 1395 1207724 47480 SyS_epoll_ 00000000 S com.google.android.tts
u0_a14 19524 1395 1145508 36368 SyS_epoll_ 00000000 S com.google.process.gapps
u0_a91 19597 1395 1598420 196248 SyS_epoll_ 00000000 S host.exp.exponent
u0_a18 19718 1395 1159616 40952 SyS_epoll_ 00000000 S com.google.android.packageinstaller
u0_a86 20112 1395 1145024 34964 SyS_epoll_ 00000000 S com.example.hungerperks.notifier
root 20178 2 0 0 worker_thr 00000000 S kworker/1:0
root 20344 2 0 0 worker_thr 00000000 S kworker/u9:3
root 20468 2 0 0 worker_thr 00000000 S kworker/u8:1
root 21164 2 0 0 worker_thr 00000000 S kworker/u9:0
root 21273 2 0 0 worker_thr 00000000 S kworker/u9:1
root 21940 2 0 0 worker_thr 00000000 S kworker/u8:0
root 22043 2 0 0 worker_thr 00000000 S kworker/0:0
root 22376 2 0 0 worker_thr 00000000 S kworker/u8:2
shell 22478 1337 6268 1404 0 a9635424 R ps
据我了解,这表明 adb 实际上正在运行,并且 adb 能够连接到它。然而,在模拟器启动后,cordova 永远不会启动部署应用程序的下一步。
什么可能导致这个问题?
最佳答案
Ionic 已更新,此问题不再出现。
关于android - Cordova 未检测到已启动的 Android 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48994402/
是的,我知道最好使用webmock,但我想知道如何在RSpec中模拟此方法:defmethod_to_testurl=URI.parseurireq=Net::HTTP::Post.newurl.pathres=Net::HTTP.start(url.host,url.port)do|http|http.requestreq,foo:1endresend这是RSpec:let(:uri){'http://example.com'}specify'HTTPcall'dohttp=mock:httpNet::HTTP.stub!(:start).and_yieldhttphttp.shou
最近,当我启动我的Rails服务器时,我收到了一长串警告。虽然它不影响我的应用程序,但我想知道如何解决这些警告。我的估计是imagemagick以某种方式被调用了两次?当我在警告前后检查我的git日志时。我想知道如何解决这个问题。-bcrypt-ruby(3.1.2)-better_errors(1.0.1)+bcrypt(3.1.7)+bcrypt-ruby(3.1.5)-bcrypt(>=3.1.3)+better_errors(1.1.0)bcrypt和imagemagick有关系吗?/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ru
我收到这个错误:RuntimeError(自动加载常量Apps时检测到循环依赖当我使用多线程时。下面是我的代码。为什么会这样?我尝试多线程的原因是因为我正在编写一个HTML抓取应用程序。对Nokogiri::HTML(open())的调用是一个同步阻塞调用,需要1秒才能返回,我有100,000多个页面要访问,所以我试图运行多个线程来解决这个问题。有更好的方法吗?classToolsController0)app.website=array.join(',')putsapp.websiteelseapp.website="NONE"endapp.saveapps=Apps.order("
一、引擎主循环UE版本:4.27一、引擎主循环的位置:Launch.cpp:GuardedMain函数二、、GuardedMain函数执行逻辑:1、EnginePreInit:加载大多数模块int32ErrorLevel=EnginePreInit(CmdLine);PreInit模块加载顺序:模块加载过程:(1)注册模块中定义的UObject,同时为每个类构造一个类默认对象(CDO,记录类的默认状态,作为模板用于子类实例创建)(2)调用模块的StartUpModule方法2、FEngineLoop::Init()1、检查Engine的配置文件找出使用了哪一个GameEngine类(UGame
最近因为项目需要,需要将Android手机系统自带的某个系统软件反编译并更改里面某个资源,并重新打包,签名生成新的自定义的apk,下面我来介绍一下我的实现过程。APK修改,分为以下几步:反编译解包,修改,重打包,修改签名等步骤。安卓apk修改准备工作1.系统配置好JavaJDK环境变量2.需要root权限的手机(针对系统自带apk,其他软件免root)3.Auto-Sign签名工具4.apktool工具安卓apk修改开始反编译本文拿Android系统里面的Settings.apk做demo,具体如何将apk获取出来在此就不过多介绍了,直接进入主题:按键win+R输入cmd,打开命令窗口,并将路
假设我在Store的模型中有这个非常简单的方法:defgeocode_addressloc=Store.geocode(address)self.lat=loc.latself.lng=loc.lngend如果我想编写一些不受地理编码服务影响的测试脚本,这些脚本可能已关闭、有限制或取决于我的互联网连接,我该如何模拟地理编码服务?如果我可以将地理编码对象传递到该方法中,那将很容易,但我不知道在这种情况下该怎么做。谢谢!特里斯坦 最佳答案 使用内置模拟和stub的rspecs,你可以做这样的事情:setupdo@subject=MyCl
在ruby中,你可以这样做:classThingpublicdeff1puts"f1"endprivatedeff2puts"f2"endpublicdeff3puts"f3"endprivatedeff4puts"f4"endend现在f1和f3是公共(public)的,f2和f4是私有(private)的。内部发生了什么,允许您调用一个类方法,然后更改方法定义?我怎样才能实现相同的功能(表面上是创建我自己的java之类的注释)例如...classThingfundeff1puts"hey"endnotfundeff2puts"hey"endendfun和notfun将更改以下函数定
我有一个gem,它有一个根据Rails.env的不同行为的方法:defself.envifdefined?(Rails)Rails.envelsif...现在我想编写一个规范来测试这个代码路径。目前我是这样做的:Kernel.const_set(:Rails,nil)Rails.should_receive(:env).and_return('production')...没关系,只是感觉很丑。另一种方法是在spec_helper中声明:moduleRails;end而且效果也很好。但也许有更好的方法?理想情况下,这应该有效:rails=double('Rails')rails.sho
我想知道我的代码是否在rspec下运行。这可能吗?原因是我正在加载一些错误记录器,这些记录器在测试期间会被故意错误(expect{x}.toraise_error)弄得乱七八糟。我查看了我的ENV变量,没有(明显的)测试环境变量的迹象。 最佳答案 在spec_helper.rb的开头添加:ENV['RACK_ENV']='test'现在您可以在代码中检查RACK_ENV是否经过测试。 关于ruby-检测由RSpec、Ruby运行的代码,我们在StackOverflow上找到一个类似的问题
我正在使用rubydaemongem。想知道如何向停止操作添加一些额外的步骤?希望我能检测到停止被调用,并向其添加一些额外的代码。任何人都知道我如何才能做到这一点? 最佳答案 查看守护程序gem代码,它似乎没有用于此目的的明显扩展点。但是,我想知道(在守护进程中)您是否可以捕获守护进程在发生“停止”时发送的KILL/TERM信号...?trap("TERM")do#executeyourextracodehereend或者你可以安装一个at_exit钩子(Hook):-at_exitdo#executeyourextracodehe