问题描述
我在Windows 10上遇到钛合金的巨大问题.我正在使用Atom编辑器来编写我的应用程序.每当执行ti build
时,最多输入10( !!! )次命令,直到找到Android设备为止.对于Android模拟器,我收到如下错误消息:
I'm having huge problems with Titanium Alloy on Windows 10. I am using the Atom editor to write my apps. Whenever I execute ti build
, enter the command up to 10(!!!) times until an Android device can be found.For the Android emulator I get an error message as follows:
[Error] Failed to install apk on "emulator-5554"
[Error] Error: device not found
我尝试了命令ti build -p android
,ti build -p android -T emulator
和ti build -p android -T emulator -C emulator-5554 --log-level info
.我还尝试从avd.exe
手动启动仿真器.我也删除了AVD
并创建了一个新的
I tried the commands ti build -p android
, ti build -p android -T emulator
and ti build -p android -T emulator -C emulator-5554 --log-level info
. I also tried starting the emulator manually from avd.exe
. I deleted the AVD
and created a new one, too
连接设备(已启用 USB调试)时,我尝试了ti build -p android -T device
和ti build -p android -T device -C XT1032
,其中XT1032
是设备的名称.我收到如下错误消息:
When a device (USB debugging enabled) is connected, i tried ti build -p android -T device
and ti build -p android -T device -C XT1032
, where XT1032
is the name of the device. I get an error message as follows:
[ERROR] Unable to find any devices
到目前为止,我还没有尝试过尝试再找到该设备.
执行命令时,我尝试了所有4种组合:
I didn't try so far if the device will be found after some more tries.
When executing the commands, I tried all 4 combinations:
- 模拟器关闭,设备已断开连接
- 模拟器关闭,设备已连接
- 模拟器已打开,设备已断开连接
- 模拟器已打开,设备已连接
我卸载了Titanium
,Android SDK
,NodeJS
和Java
,并删除了它们的所有文件夹.我也删除了所有注册表项.然后,我再次安装了所有内容,最后是Titanium
.同样的问题.
我正在使用Java
32位( v8.0.1020.14 ),NodeJS
v4.2.6 (也尝试过 v6 .3.0 ,但建议使用 v4.2.x ),Android SDK
(SDK Tools
v25.1.7 ,SDK Platform-tools
24.0. 1 和SDK Build-tools
21.1.2 .我也尝试了SDK Build-tools
24.0.1 ,但建议使用 21.xx )和Titanium
(SDK
v6.0.0.v20160719180254 ,CLI
v5.0.9 ).
I uninstalled Titanium
, Android SDK
, NodeJS
and Java
and deleted all folders of them. I removed all registry entries, too. Then I installed everything again, Titanium
at last. Same problem.
I am using Java
32 bit (v8.0.1020.14), NodeJS
v4.2.6 (also tried v6.3.0, but v4.2.x is recommend), Android SDK
(SDK Tools
v25.1.7, SDK Platform-tools
24.0.1 and SDK Build-tools
21.1.2. I also tried SDK Build-tools
24.0.1, but 21.x.x is recommend) and Titanium
(SDK
v6.0.0.v20160719180254, CLI
v5.0.9).
我修改了我的环境变量,如下所示:
路径: C:\android-sdk\tools;C:\android-sdk\platform-tools;C:\android-sdk\ndk-bundle;C:\Program Files (x86)\Java\jdk<version>\bin
JAVA_HOME: C:\Program Files (x86)\Java\jdk<version>
ANDROID_SDK_HOME: C:\android-sdk
我必须设置 ANDROID_SDK_HOME 和C:\android-sdk\ndk-bundle
,否则ti setup check
找不到NDK和AVD.
I modified my environment variables as follows:
PATH:C:\android-sdk\tools;C:\android-sdk\platform-tools;C:\android-sdk\ndk-bundle;C:\Program Files (x86)\Java\jdk<version>\bin
JAVA_HOME:C:\Program Files (x86)\Java\jdk<version>
ANDROID_SDK_HOME:C:\android-sdk
I had to set ANDROID_SDK_HOME and C:\android-sdk\ndk-bundle
, otherwise the NDK and the AVDs wouldn't be found by ti setup check
.
以下是ti setup check
的屏幕截图:链接到图像我不知道为什么 https://www.google.com 无法访问.此外,已安装Intel HAXM
.我什至没有重新安装它.以前安装的Titanium
可以找到它...
Here is a screenshot of ti setup check
: link to imageI don't know why https://www.google.com is unreachable. Furthermore, Intel HAXM
is installed. I even reinstalled it without success. The previous installation of Titanium
could find it...
感谢您的帮助!
TLDNR:我的钛合金装置在查找设备时遇到问题.它只会不时地运作,没有任何明显的模式
推荐答案
构建APK
文件后,该过程终止.如果仿真器正在运行,则可以手动安装APK
.在Command Line
中使用此命令:
The process terminates after building the APK
file. If the emulator is running, it is possible to manually install the APK
. Use this command in the Command Line
:
<Android SDK folder>\platform-tools\adb.exe -s emulator-5554 install -r -d <project path>\<project folder>\build\android\bin\<project name>.apk
项目名称与项目文件夹名称相同.安装APK
之后,可以在仿真器中手动启动该应用程序.
The project name is equal to the project folder name. After installing the APK
, the application can be started manually in the emulator.
尽管如此,在Windows 10上进行开发时仍然存在很多问题...我认为这迫使我切换到MAC.
Nonetheless, there are still a lot of issues when developping on Windows 10... I think this forces me to switch to a MAC.
这篇关于Windows 10上具有Android模拟器的钛合金的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!