Titanium Alloy with Android Emulator on Windows 10

假装没事ソ 提交于 2019-12-12 02:31:53

问题


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

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

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

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:

  • emulator off, device disconnected
  • emulator off, device connected
  • emulator on, device disconnected
  • emulator on, device connected

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, CLIv5.0.9).

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.

Here is a screenshot of ti setup check: link to image I 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...

Thanks for your help!

TLDNR: my Titanium Alloy installation has problems finding devices. It only works from time to time without any obvious pattern


回答1:


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

The project name is equal to the project folder name. After installing the APK, the application can be started manually in the emulator.

Nonetheless, there are still a lot of issues when developping on Windows 10... I think this forces me to switch to a MAC.



来源:https://stackoverflow.com/questions/38608803/titanium-alloy-with-android-emulator-on-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!