Show App in real device


#1

Hi all, I got this error when I type in command line and try to view my application no my real device: ionic run android, this ERROR : failed to install apk to device: pkg: /data/local/tmp/cordovaApp-debug.apk, Anyone can share the solution?


#2

if you have other cordova projects on your device try to uninstall them.


#3

Hi @Matangub, I don’t have any project yet on my device.


#4

you opened the developer options in your android device ?


#5

Yes I have done it thanks @ItamarCohen


#6

you added the paths of Android SDK folder tools and platform-tools and java to system PATH variable then restarting the device ?


#7

Hi, can you please explain that further?
I have the same problem. What do you mean with Android SDK paths etc? Couldn’t find anything about that in http://ionicframework.com/docs/guide/.


#8

which os do you use?


#9

Thanks for your reply.
Mac OSX Yosemite.


#10

you download the android sdk?
if not u need to download from android website
look in your home directory for .bash_profile. Create the .bash_profile file if you don’t have one.

MacBook-Pro:~  touch .bash_profile

after u need to edit the file with any editor u use.

you can use nano with commend

MacBook-Pro: sudo nano .bash_profile

and add to the file

export ANDROID_HOME=/path/to/android/sdk/folder
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

then you need to save the file in nano you can parss ctrl x and enter.
then run the commend

MacBook-Pro:  source ~/.bash_profile

#11

Thanks a lot for your help, I really appreciate it.
Did everything you suggested (for future reference: Installing the Android Studio as advised in http://ionicframework.com/docs/ionic-cli-faq/#android-sdk in combination with this http://stackoverflow.com/questions/16581752/android-studio-how-to-change-android-sdk-path helped me to make sure my path is correct).

Unfortunately it still doesn’t work:

/Users/ched/healthcare/platforms/android/cordova/node_modules/q/q.js:126
                throw e;
                      ^
ERROR: Failed to launch application on device: ERROR: Failed to install apk to device: 	pkg: /data/local/tmp/CordovaApp-debug.apk
Failure [INSTALL_FAILED_INVALID_APK]
rm failed for -f, No such file or directory

Could it be related to the Android version? The phone has Android 4.1.2, but I also that version in Android Studio’s SDK version (among others).


#12

tell me you opened the developer options and enabling USB debugging ??


#13

I’m usually a candidate for mistakes like that, but I actually did enable that…


#14

hi,
i found this forum and maybe its a permission error try what they recommend
http://forum.xda-developers.com/galaxy-s3/general/root-installation-failed-due-to-invalid-t2115402


#15

This error has crossed my path a couple of times. Removing the platform (cordova platform remove android) and adding it again fixed the issue for me every time.

DO CHECK that you’re working solely on the www and cordova root levels and did not alter the platforms/android project before doing this.


#16

HI.
when I run ionic run android in terminal to run app in real device, I get the following error::

Running command: “C:\Program Files (x86)\nodejs\node.exe” D:\wamp\www\pars-app\pars-app\hooks\after_prepare\010_add_platform_class.js D:\wamp\www\pars-app\pars-app

add to body class: platform-android

ANDROID_HOME=D:\Sdk\android-sdk

JAVA_HOME=C:\Program Files\java\jdk1.8.0_45

No target specified, deploying to emulator

ERROR running one or more of the platforms: No emulator images (avds) found. 1. Download desired System Image by running: “D:\Sdk\android-sdk\tools\android.bat” sdk 2. Create an AVD by running: “D:\Sdk\android-sdk\tools\android.bat” avd HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver

You may not have the required environment or OS to run this project

I am using windows 8 and Huawei with Android 4.2.2

Help Me Please.