_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_
_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[39m: 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
[36minfo[39m: Welcome to Appium v1.4.8 (REV c8179bd8352d3c62d98fa58b324491230df9342a)
[36minfo[39m: Appium REST http interface listener started on 127.0.0.1:4723
[36minfo[39m: [debug] Non-default server args: {"address":"127.0.0.1","noReset":true}
[36minfo[39m: Console LogLevel: debug
[36minfo[39m: [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m [90m{"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"}}[39m
[36minfo[39m: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
[36minfo[39m: [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
[36minfo[39m: [debug] Using local app from desired caps: /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk
[36minfo[39m: [debug] Creating new appium session fb0d13f8-0067-4fe0-8c36-af18228de11f
[36minfo[39m: Starting android appium
[36minfo[39m: [debug] Getting Java version
[36minfo[39m: Java version is: 1.8.0_60
[36minfo[39m: [debug] Checking whether adb is present
[36minfo[39m: [debug] Using adb from /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb
[36minfo[39m: [debug] Using fast reset? false
[36minfo[39m: [debug] Preparing device for session
[36minfo[39m: [debug] Checking whether app is actually present
[36minfo[39m: Retrieving device
[36minfo[39m: [debug] Trying to find a connected android device
[36minfo[39m: [debug] Getting connected devices...
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb devices
[36minfo[39m: [debug] 1 device(s) connected
[36minfo[39m: Found device 03157df33d91c039
[36minfo[39m: [debug] Setting device id to 03157df33d91c039
[36minfo[39m: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 wait-for-device
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "echo 'ready'"
[36minfo[39m: [debug] Starting logcat capture
[36minfo[39m: [debug] Getting device API level
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "getprop ro.build.version.sdk"
[36minfo[39m: [debug] Device is at API Level 22
[36minfo[39m: Device API level is: 22
[36minfo[39m: [debug] Extracting strings for language: default
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "getprop persist.sys.language"
[36minfo[39m: [debug] Current device persist.sys.language: en
[36minfo[39m: [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
[36minfo[39m: [debug] No strings.xml for language 'en', getting default strings.xml
[36minfo[39m: [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"
[36minfo[39m: [debug] Reading strings from converted strings.json
[36minfo[39m: [debug] Setting language to default
[36minfo[39m: [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
[36minfo[39m: [debug] Checking whether aapt is present
[36minfo[39m: [debug] Using aapt from /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/build-tools/android-4.2.2/aapt
[36minfo[39m: [debug] Retrieving process from manifest.
[36minfo[39m: [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
[36minfo[39m: [debug] Set app process to: com.weather.Weather
[36minfo[39m: [debug] Not uninstalling app since server not started with --full-reset
[36minfo[39m: [debug] Checking app cert for /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk.
[36minfo[39m: [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
[36minfo[39m: [debug] App already signed.
[36minfo[39m: [debug] Zip-aligning /Users/monocept/Documents/workspace_luna/com.android.logcat/APKFile/TWC_511000452_release.apk
[36minfo[39m: [debug] Checking whether zipalign is present
[36minfo[39m: [debug] Using zipalign from /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/tools/zipalign
[36minfo[39m: [debug] Zip-aligning apk.
[36minfo[39m: [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
[36minfo[39m: [debug] MD5 for app is a79422234f7f3ce0e667e5a6a11929cb
[36minfo[39m: [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"
[36minfo[39m: [debug] Getting install status for com.weather.Weather
[36minfo[39m: [debug] Getting device API level
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "getprop ro.build.version.sdk"
[36minfo[39m: [debug] Device is at API Level 22
[36minfo[39m: [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"
[36minfo[39m: [debug] App is installed
[36minfo[39m: [debug] Forwarding system:4724 to device:4724
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 forward tcp:4724 tcp:4724
[36minfo[39m: [debug] Pushing appium bootstrap to device...
[36minfo[39m: [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/
[36minfo[39m: [debug] Pushing settings apk to device...
[36minfo[39m: [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"
[36minfo[39m: [debug] Pushing unlock helper app to device...
[36minfo[39m: [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"
[36minfo[39m: [debug] Logcat terminated with code 0, signal null
[36minfo[39m: Starting App
[36minfo[39m: [debug] Attempting to kill all 'uiautomator' processes
[36minfo[39m: [debug] Getting all processes with 'uiautomator'
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "ps 'uiautomator'"
[36minfo[39m: [debug] No matching processes found
[36minfo[39m: [debug] Running bootstrap
[36minfo[39m: [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
[36minfo[39m: [debug] [90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1[39m
[36minfo[39m: [debug] [90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=[39m
[36minfo[39m: [debug] [90m[UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:[39m
[36minfo[39m: [debug] [90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner[39m
[36minfo[39m: [debug] [90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer[39m
[36minfo[39m: [debug] [90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap[39m
[36minfo[39m: [debug] [90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1[39m
[36minfo[39m: [debug] [90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1[39m
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Loading json...
[36minfo[39m: [debug] [BOOTSTRAP] [debug] json loading complete.
[31merror[39m: 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.]
[36minfo[39m: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
[36minfo[39m: [debug] UiAutomator exited
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "echo 'ping'"
[36minfo[39m: error sending command, reconnecting device and retrying: shell "echo 'ping'"
[36minfo[39m: [debug] Trying to find a connected android device
[36minfo[39m: [debug] Getting connected devices...
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 devices
[36minfo[39m: [debug] 1 device(s) connected
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 "shell \"echo 'ping'\""
[36minfo[39m: [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.
[36minfo[39m: [debug] Stopping logcat capture
[36minfo[39m: [debug] Logcat already stopped
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 kill-server
[36minfo[39m: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 wait-for-device
[36minfo[39m: [debug] executing cmd: /Users/monocept/Documents/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb -s 03157df33d91c039 shell "echo 'ready'"
[36minfo[39m: [debug] Starting logcat capture
[36minfo[39m: [debug] Attempting to uninstall app
[36minfo[39m: [debug] Not uninstalling app since server not started with --full-reset
[36minfo[39m: [debug] Cleaning up android objects
[31merror[39m: UiAutomator quit before it successfully launched
[36minfo[39m: [debug] Cleaning up appium session
[31merror[39m: Failed to start an Appium session, err was: Error: UiAutomator quit before it successfully launched
[36minfo[39m: [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)
[36minfo[39m: [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}
[36minfo[39m: [37m<-- POST /wd/hub/session [39m[31m500[39m[90m 24176.781 ms - 218[39m [90m[39m
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.