Ionic-cli: bug: For your info: EACCESS on adding platform with 1.0.0 rc2

Created on 14 Apr 2015  路  22Comments  路  Source: ionic-team/ionic-cli

_From @bitflower on April 3, 2015 19:58_

Type: bug

Platform: all

Hi,

I had to chmod -R +x hooks to be able to add platforms (in my case ios).

Just in case anyone experiences similiar problems.

Cordova 4.3.0
IONIC cli 1.3.19

The error was:
Running command: .../hooks/after_prepare/010_add_platform_class.js
Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1155:11)
at Object.exports.spawn (child_process.js:988:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:114:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

_Copied from original issue: driftyco/ionic#3469_

All 22 comments

_From @jessamynsmith on April 5, 2015 0:42_

I am having the same issue.

_From @bunajim75 on April 5, 2015 4:35_

Same issue with me after updating to ionic CLI 1.3.19

_From @ronyrun on April 5, 2015 13:25_

Same issue. last CLI

running cordova platform add ios
Adding ios project...
iOS project created with [email protected]
Running command: /.../Ionic/todo/hooks/after_prepare/010_add_platform_class.js /Users/florian/Documents/Ionic/todo
Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1162:11)
at Object.exports.spawn (child_process.js:995:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:114:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

_From @fuzzyflop on April 5, 2015 13:28_

Installed ionic for first time, version 1.3.19.

Same issue as well, on OS X 10.10 and Ubuntu 14.10.

_From @ronyrun on April 5, 2015 13:30_

OK I solved th茅 issue with : chmod -R +rw 0777 hooks

_From @fuzzyflop on April 5, 2015 14:46_

chmod -R 0777 hooks

confirmed working.

_From @grillorafael on April 12, 2015 13:35_

I was having the same issue but I ran chmod +x and everything worked fine

_From @brodybits on April 13, 2015 9:35_

I just installed Ionic, ionic --version outputs 1.3.19, and I get the same issue when I run ionic platform add android. I discovered http://forum.ionicframework.com/t/how-to-fix-this-error-spawn-eacces/20490/5 which is the same issue. I find this very disturbing for someone just getting started. Can we please get this fixed ASAP?

This should be fixed in next release.

Thanks !!

Thank you for update about this issue. now ionic hooks add is my workaround solution.

I have the same problem on my mac since i updated the cli on version 1.3.19. I just updated the ionic version to 3.1.20 and i still have the same problem ...
Has anyone a suggestion howmto fix this? - i ve already tried the chmod commands mentioned above.

@iJorl try ionic hooks add before you add a platform. For example:

cd your-project-folder
ionic hooks add
ionic platform add android

it helps me, until the fixed one release.

It worked for me when trying ionic hooks add before. Need to add it to the doc

This should be fixed in 1.3.21. Thanks.

Hi,

I am still having the issue. I have tried everything and still I am not able to add neither android neither ios as platform. I tried all the chmod mentioned above as well.

The output error:

running cordova platform add android
Running command: /media/guilhermevrs/Data/Fontes/ionicApp/hooks/before_platform_add/init_directories.js /media/guilhermevrs/Data/Fontes/ionicApp
Adding android project...
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: com.ionicframework.ionicapp598773
    Name: ionicApp
    Activity: MainActivity
    Android target: android-22
Copying template files...
Android project created with [email protected]
Running command: /media/guilhermevrs/Data/Fontes/ionicApp/hooks/after_prepare/010_add_platform_class.js /media/guilhermevrs/Data/Fontes/ionicApp
Running command: /media/guilhermevrs/Data/Fontes/ionicApp/hooks/after_prepare/020_remove_sass_from_platforms.js /media/guilhermevrs/Data/Fontes/ionicApp
Installing "com.ionic.keyboard" for android
Failed to install 'com.ionic.keyboard':Error: /media/guilhermevrs/Data/Fontes/ionicApp/platforms/android/cordova/version: Command failed with exit code EACCES
    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:818:12)
Error: /media/guilhermevrs/Data/Fontes/ionicApp/platforms/android/cordova/version: Command failed with exit code EACCES
    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:818:12)

Here is my ionic info output

Your system information:

OS: Distributor ID: LinuxMint Description:  Linux Mint 17.1 Rebecca 
Node Version: v0.10.37
Cordova CLI: 5.0.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.3.22

Sorry, I was trying to run the project in a mounted partition, that's why the chmod under hooks was not working.

I changed the partition and it works

Getting this error with;

OS: Ubuntu 14.04.3 LTS
Node version: 0.12.7
Cordova version: 5.2.0
Ionic version: 1.6.4

Solved this by adding missing permissions as suggested here;
http://forum.ionicframework.com/t/how-to-fix-this-error-spawn-eacces/20490/6

Hi Teerasej (I'm testing the Android App, where i got the below error....)
-- I tried chmod -R 777 * but not fixed the issue
-- Also tried "ionic hooks add" command but shown the error on terminal like
"ravis-MacBook-Pro:~ monocept$ ionic hooks add
-bash: ionic: command not found"

i'm using APPIUM 1.4.8 and still the error like below when running the script with ANDROID app with MAC OS X(10.11 version) please check the brief and detailed error and help me out.

how to use the ionic hooks add command , when i ran the command in terminal saying ionic command not found......
============ Brief Error ======
31merror: Unhandled error: Error: connect ECONNREFUSED
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19) context: [POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk","appPackage":"com.weather.Weather","appActivity":"com.weather.Weather.app.]
[
====================Detailed Error Below=============
[TestNG] Running:
  /private/var/folders/6y/3w4t1jld3997y9q_6cvwswqr0000gn/T/testng-eclipse-363334535/testng-customsuite.xml

Stopping the ADB server
ADB Server is stopped
===================================
Stopping the appium server
Appium server is stopped
Starting the appium server
Appium server is started and running
info: Welcome to Appium v1.4.8 (REV c8179bd8352d3c62d98fa58b324491230df9342a)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {"address":"127.0.0.1","noReset":true}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk","appPackage":"com.weather.Weather","appActivity":"com.weather.Weather.app.SplashScreenActivity","appium-version":"1.0","platformVersion":"5.0.1 // 4.2.2   5.1.1    5.0.1","platformName":"Android","deviceName":"Samsung"}}
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appium-version
info: [debug] Using local app from desired caps: /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk
info: [debug] Creating new appium session fb0d13f8-0067-4fe0-8c36-af18228de11f
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_60
info: [debug] Checking whether adb is present
info: [debug] Using adb from /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb
info: [debug] Using fast reset? false
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb devices
info: [debug] 1 device(s) connected
info: Found device 03157df33d91c039
info: [debug] Setting device id to 03157df33d91c039
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 wait-for-device
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 22
info: Device API level is: 22
info: [debug] Extracting strings for language: default
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "getprop persist.sys.language"
info: [debug] Current device persist.sys.language: en
info: [debug] java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar" "stringsFromApk" "/Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk" "/tmp/com.weather.Weather" en
info: [debug] No strings.xml for language 'en', getting default strings.xml
info: [debug] java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar" "stringsFromApk" "/Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk" "/tmp/com.weather.Weather"
info: [debug] Reading strings from converted strings.json
info: [debug] Setting language to default
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 push "/tmp/com.weather.Weather/strings.json" /data/local/tmp
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/build-tools/android-4.2.2/aapt
info: [debug] Retrieving process from manifest.
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/build-tools/android-4.2.2/aapt dump xmltree /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk AndroidManifest.xml
info: [debug] Set app process to: com.weather.Weather
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk.
info: [debug] executing cmd: java -jar /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/verify.jar /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk
info: [debug] App already signed.
info: [debug] Zip-aligning /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/tools/zipalign
info: [debug] Zip-aligning apk.
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/tools/zipalign -f 4 /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk /var/folders/6y/3w4t1jld3997y9q_6cvwswqr0000gn/T/1151012-86700-apvgbq/appium.tmp
info: [debug] MD5 for app is a79422234f7f3ce0e667e5a6a11929cb
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "ls /data/local/tmp/a79422234f7f3ce0e667e5a6a11929cb.apk"
info: [debug] Getting install status for com.weather.Weather
info: [debug] Getting device API level
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 22
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "pm list packages -3 com.weather.Weather"
info: [debug] App is installed
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 push "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar" /data/local/tmp/
info: [debug] Pushing settings apk to device...
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 install "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/settings_apk/settings_apk-debug.apk"
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 install "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk"
info: [debug] Logcat terminated with code 0, signal null
info: Starting App
info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "ps 'uiautomator'"
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.weather.Weather -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json...
info: [debug] [BOOTSTRAP] [debug] json loading complete.
error: Unhandled error: Error: connect ECONNREFUSED
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19) context: [POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk","appPackage":"com.weather.Weather","appActivity":"com.weather.Weather.app.]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] UiAutomator exited
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "echo 'ping'"
info: error sending command, reconnecting device and retrying: shell "echo 'ping'"
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 devices
info: [debug] 1 device(s) connected
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 "shell \"echo 'ping'\""
info: [debug] Error: Command failed: /bin/sh -c /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 "shell \"echo 'ping'\""
Android Debug Bridge version 1.0.31

 -d                            - directs command to the only connected USB device
                                 returns an error if more than one USB device is present.
 -e                            - directs command to the only running emulator.
                                 returns an error if more than one emulator is running.
 -s <specific device>          - directs command to the device or emulator with the given
                                 serial number or qualifier. Overrides ANDROID_SERIAL
                                 environment variable.
 -p <product name or path>     - simple product name like 'sooner', or
                                 a relative/absolute path to a product
                                 out directory like 'out/target/product/sooner'.
                                 If -p is not specified, the ANDROID_PRODUCT_OUT
                                 environment variable is used, which must
                                 be an absolute path.
 devices [-l]                  - list all connected devices
                                 ('-l' will also list device qualifiers)
 connect <host>[:<port>]       - connect to a device via TCP/IP
                                 Port 5555 is used by default if no port number is specified.
 disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
                                 Port 5555 is used by default if no port number is specified.
                                 Using this command with no additional arguments
                                 will disconnect from all connected TCP/IP devices.

device commands:
  adb push <local> <remote>    - copy file/dir to device
  adb pull <remote> [<local>]  - copy file/dir from device
  adb sync [ <directory> ]     - copy host->device only if changed
                                 (-l means list but don't copy)
                                 (see 'adb help all')
  adb shell                    - run remote shell interactively
  adb shell <command>          - run remote shell command
  adb emu <command>            - run emulator console command
  adb logcat [ <filter-spec> ] - View device log
  adb forward <local> <remote> - forward socket connections
                                 forward specs are one of: 
                                   tcp:<port>
                                   localabstract:<unix domain socket name>
                                   localreserved:<unix domain socket name>
                                   localfilesystem:<unix domain socket name>
                                   dev:<character device name>
                                   jdwp:<process pid> (remote only)
  adb jdwp                     - list PIDs of processes hosting a JDWP transport
  adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
                               - push this package file to the device and install it
                                 ('-l' means forward-lock the app)
                                 ('-r' means reinstall the app, keeping its data)
                                 ('-s' means install on SD card instead of internal storage)
                                 ('--algo', '--key', and '--iv' mean the file is encrypted already)
  adb uninstall [-k] <package> - remove this app package from the device
                                 ('-k' means keep the data and cache directories)
  adb bugreport                - return all information from the device
                                 that should be included in a bug report.

  adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
                               - write an archive of the device's data to <file>.
                                 If no -f option is supplied then the data is written
                                 to "backup.ab" in the current directory.
                                 (-apk|-noapk enable/disable backup of the .apks themselves
                                    in the archive; the default is noapk.)
                                 (-shared|-noshared enable/disable backup of the device's
                                    shared storage / SD card contents; the default is noshared.)
                                 (-all means to back up all installed applications)
                                 (-system|-nosystem toggles whether -all automatically includes
                                    system applications; the default is to include system apps)
                                 (<packages...> is the list of applications to be backed up.  If
                                    the -all or -shared flags are passed, then the package
                                    list is optional.  Applications explicitly given on the
                                    command line will be included even if -nosystem would
                                    ordinarily cause them to be omitted.)

  adb restore <file>           - restore device contents from the <file> backup archive

  adb help                     - show this help message
  adb version                  - show version num

scripting:
  adb wait-for-device          - block until device is online
  adb start-server             - ensure that there is a server running
  adb kill-server              - kill the server if it is running
  adb get-state                - prints: offline | bootloader | device
  adb get-serialno             - prints: <serial-number>
  adb get-devpath              - prints: <device-path>
  adb status-window            - continuously print device status for a specified device
  adb remount                  - remounts the /system partition on the device read-write
  adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
  adb reboot-bootloader        - reboots the device into the bootloader
  adb root                     - restarts the adbd daemon with root permissions
  adb usb                      - restarts the adbd daemon listening on USB
  adb tcpip <port>             - restarts the adbd daemon listening on TCP on the specified port
networking:
  adb ppp <tty> [parameters]   - Run PPP over USB.
 Note: you should not automatically start a PPP connection.
 <tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
 [parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
  <localdir> can be interpreted in several ways:

  - If <directory> is not specified, both /system and /data partitions will be updated.

  - If it is "system" or "data", only the corresponding partition
    is updated.

environmental variables:
  ADB_TRACE                    - Print debug information. A comma separated list of the following values
                                 1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
  ANDROID_SERIAL               - The serial number to connect to. -s takes priority over this if given.
  ANDROID_LOG_TAGS             - When used with the logcat option, only these debug tags are printed.

info: [debug] Stopping logcat capture
info: [debug] Logcat already stopped
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 kill-server
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 wait-for-device
info: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Attempting to uninstall app
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Cleaning up android objects
error: UiAutomator quit before it successfully launched
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: UiAutomator quit before it successfully launched
info: [debug] Error: UiAutomator quit before it successfully launched
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android.js:205:23)
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-hybrid.js:249:5)
    at Object.async.eachSeries (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:142:20)
    at [object Object].androidHybrid.stopChromedriverProxies (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-hybrid.js:233:9)
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android.js:200:10)
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android.js:222:9)
    at [object Object].androidCommon.uninstallApp (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:478:5)
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android.js:220:12)
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android.js:245:15)
    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:251:17
    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:154:25
    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:248:21
    at [object Object].onLogcatStart (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:612:34)
    at [object Object].Logcat.onOutput (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/logcat.js:81:12)
    at [object Object].Logcat.onStdout (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/logcat.js:61:8)
    at Stream.stream.write (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/through/index.js:26:11)
    at Socket.ondata (_stream_readable.js:540:20)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at Pipe.onread (net.js:538:20)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: UiAutomator quit before it successfully launched)","origValue":"UiAutomator quit before it successfully launched"},"sessionId":null}
info: <-- POST /wd/hub/session 500 24176.781 ms - 218 
FAILED: Capabilites
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: UiAutomator quit before it successfully launched) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 24.45 seconds
Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44'
System info: host: 'ravis-MacBook-Pro.local', ip: '172.16.0.5', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11', java.version: '1.8.0_60'
Driver info: io.appium.java_client.android.AndroidDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
    at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
    at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
    at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:37)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:160)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:168)
    at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:69)
    at com.twc.appium.Capabilities_android.dcap(Capabilities_android.java:62)
    at com.twc.appium.Smoke_Test.Capabilites(Smoke_Test.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
    at org.testng.TestRunner.privateRun(TestRunner.java:771)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1032)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

@KSateesh if you're facing error: "Ionic command not found", it might caused from Ionic CLI's installation is unsuccessful. Please try reinstall it again and check with following command

ionic

if the installation is success. It should show you a list of Ionic command, yes, in nice green. :)

For another suspect, I don't sure, but If you use sudo npm install -g ionic and your computer is behind the proxy, that might cause the problem.

Still facing the issue with the following info:

Cordova CLI: 5.1.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.2.3
Ionic CLI Version: 2.0.0-alpha.23
Ionic App Lib Version: 2.0.0-alpha.22
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS
Node Version: v0.12.7

Steps to solve the problem:
1) ionic start test sidemenu
2) ionic hooks add
3) ionic platform add android

I had the same problem, started to happen when I moved the _android / sdk_ folder to a mounted disk.

To fix it, i moved the android's folder /home/myuser and everything returned to normal.

Of course, I needed to change the environmental variable $JAVA_HOME in .bashrc file.

Was this page helpful?
0 / 5 - 0 ratings