xcodebuild failed with code 65 - selenium

When i try to launch App with Appium getting below error
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"xcodebuild\"|grep -i \"faea4372d3a65bdb23969752f0d5902ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
I've tried by adding Code_signing and team id with xcodeconfig capability but it is not working, could you please help me on this
Below are the capabilities set to
app: '/Users/arun/Documents/App/iOSAutomationTests/src/main/resources/test.ipa'
rotatable: true
newCommandTimeout: 120
realDeviceLogger: '/usr/local/lib/node_modules/deviceconsole'
platformVersion: '10.1.1'
automationName: 'XCUITest'
xcodeConfigFile: '/src/main/resources/myconfig.xcconfig'
platformName: 'iOS'
udid: 'faea4372d3a65bdb23969752f0d5902ca21c5571'
deviceName: 'faea4372d3a65bdb23969752f0d5902ca21c5571'
autoAcceptAlerts: true
Below is the log
XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"xcodebuild\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"/usr/local/lib/node_modules/deviceconsole\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"iproxy\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[XCUITest] Real device logger '/usr/local/lib/node_modules/deviceconsole' is a directory. Appending 'deviceconsole' executable
[debug] [XCUITest] Using real device logger '/usr/local/lib/node_modules/deviceconsole/deviceconsole'
[debug] [XCUITest] Using Xcode configuration file: '/src/main/resources/myconfig.xcconfig'
[debug] [XCUITest] Beginning test with command 'xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=faea4372d3a65bdbd7969752f0d5948ca21c5571 -configuration Debug -xcconfig /src/main/resources/myconfig.xcconfig' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log
[Xcode] 2017-02-03 14:27:41.093 xcodebuild[4292:81409] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log}
[Xcode]
Testing failed:
./Scripts/generate_modules.sh: line 15: Modules/module.modulemap: No such file or directory
** TEST FAILED **
The following build commands failed:
PhaseScriptExecution Generate\ modules /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Intermediates/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentLib.build/Script-AD35D0281CF1B37A00870A75.sh
[Xcode] (1 failure)

Make sure your current user has write permissions to the folder where Appium is currently installed.
You can find some help here to change permission: https://apple.stackexchange.com/questions/16180/xcode-problem-with-directory-permissions

This issue is solved with Appium 1.6.3.
if you still face any issues, you can find the solution here:
https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md

Code 65 is the issue with code_signing,
If xcode config is not working for you, try manually signing WebDriverAgent in Xcode, that should do the trick, however I would suggest upgrading to 1.6.4, in which this issue has been resolved:
Allow for the auto-generation of the Xcode config file used to configurable
WDA before launch. This includes two new desired capabilities
xcodeOrgId - the Apple developer team identifier string
xcodeSigningId - a string representing a signing certificate, defaulting to
"iPhone Developer"
Below is the link:
https://github.com/appium/appium/releases

Related

applesimutils --list returns empty list [] after MacOS Mojave and Xcode 11.3 update

Describe the bug
After upgrading my MacOS from High Sierra to Mojave and Xcode from 10.x to 11.3, I'm no longer able to run the Detox test.. It gives me this error below about not having iOS simulators.
**DetoxRuntimeError: Failed to find a device by UDID = "7C50BE35-0CDE-413A-A08D-784E98C61010" and by type = "iPhone 11 Pro"
HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone Xʀ" and avoid explicit search by OS version.
at SimulatorDriver._queryDevices (../node_modules/detox/src/devices/drivers/SimulatorDriver.js:224:13)**
So I ran applesimutils --list command and received empty list like below.
[
]
But if I run xcrun simctl list devices then I get the list of devices pertaining to iOS 13.3
To Reproduce
[Yes] I have tested this issue on the latest Detox release and it still reproduces
Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.
Upgrade MacOS from High Sierra to Mojave and Xcode from 10.x to 11.3 (latest)
Run "detox text"
Got this error
DetoxRuntimeError: Failed to find a device by UDID = "7C50BE35-0CDE-413A-A08D-784E98C61010" and by type = "iPhone 11 Pro"
HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone Xʀ" and avoid explicit search by OS version.
at SimulatorDriver._queryDevices (../node_modules/detox/src/devices/drivers/SimulatorDriver.js:224:13)
Ran applesimutils --list command. Received an empty list
[
]
But if I run xcrun simctl list devices then I get the list of devices pertaining to iOS 13.3. I even changed my package.json to reflect the latest migration guide link below and included the device object - https://github.com/wix/Detox/blob/master/docs/Guide.Migration.md
This is how my package.json looks like
"detox": {
"configurations": {
"ios.sim.debug": {
"type": "ios.simulator",
"binaryPath": "build/native/QuickSightiOS-2.0.2096.d.d.app",
"build": "xcodebuild -project ios/quicksight-react-native-mobile-tests.xcodeproj -scheme quicksight-react-native-mobile-tests -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"device": {
"type": "iPhone 11 Pro",
"id": "7C50BE35-0CDE-413A-A08D-784E98C61010"
}
}
},
"test-runner": "jest"
},`
I went to this website https://github.com/wix/AppleSimulatorUtils and reran the applesimutils commands again..
brew tap wix/brew
brew install applesimutils
After running the 2nd command above, i got this error
**4c32759b84a9:QuicksightReactNativeMobileTests kondurc$ brew install applesimutils
Updating Homebrew...
Error: applesimutils: /usr/local/Homebrew/Library/Taps/wix/homebrew-brew/applesimutils.rb:4: syntax error, unexpected <<, expecting end
<<<<<<< HEAD
^~
/usr/local/Homebrew/Library/Taps/wix/homebrew-brew/applesimutils.rb:18: syntax error, unexpected ===, expecting end
^~~
/usr/local/Homebrew/Library/Taps/wix/homebrew-brew/applesimutils.rb:24: syntax error, unexpected >>, expecting end
Detox Instruments 1.9.9...
^~
/usr/local/Homebrew/Library/Taps/wix/homebrew-brew/applesimutils.rb:24: unexpected fraction part after numeric literal
Detox Instruments 1.9.9876**
Expected behavior
I would expect applesimutils --list command to show the list of simulators supported and eventually my detox test to run successfully instead of complaining about failing to find the device type.
Environment (please complete the following information):
- Detox: 14.9.2
- React Native: 0.60.4
- Node: v10.15.1
- Device: iPhone 11 Pro (simulator)
- Xcode: 11.3
- iOS: 13.3
- macOS: Mojave
Device and Verbose Detox Logs
4c32759b84a9:QuicksightReactNativeMobileTests kondurc$ detox test --loglevel trace
detox[63893] INFO: [test.js] configuration="ios.sim.debug" loglevel="trace" reportSpecs=true DETOX_START_TIMESTAMP=1578349653101 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:android:).)*$' --maxWorkers 1 "e2e"
detox[63894] INFO: [DetoxServer.js] server listening on localhost:50258...
detox[63894] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:50258
detox[63894] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"6d94b773-5329-fab7-89ae-add64e14cdec","role":"tester"},"messageId":0}
detox[63894] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=6d94b773-5329-fab7-89ae-add64e14cdec
detox[63894] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=6d94b773-5329-fab7-89ae-add64e14cdec
detox[63894] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"6d94b773-5329-fab7-89ae-add64e14cdec","role":"tester"},"messageId":0}
detox[63894] DEBUG: [exec.js/EXEC_CMD, #0] applesimutils --list --byId 7C50BE35-0CDE-413A-A08D-784E98C61010 --byType "iPhone 11 Pro"
detox[63894] TRACE: [exec.js/EXEC_SUCCESS, #0] [
]
detox[63894] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
DetoxRuntimeError: Failed to find a device by UDID = "7C50BE35-0CDE-413A-A08D-784E98C61010" and by type = "iPhone 11 Pro"
HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone Xʀ" and avoid explicit search by OS version.
at SimulatorDriver._queryDevices (/Users/kondurc/Desktop/quicksightmobiletests/src/QuicksightReactNativeMobileTests/node_modules/detox/src/devices/drivers/SimulatorDriver.js:224:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
detox[63894] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onAfterAll()
detox[63894] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=6d94b773-5329-fab7-89ae-add64e14cdec
detox[63894] DEBUG: [DetoxServer.js/WS_CLOSE] Detox server connections terminated gracefully
FAIL e2e/specs/signinWithADUserTests.spec.js
Sign In using Enterprise AD User - Reader role
✕ Should verify app is launched and Sign In button is available (4ms)
✕ Should Sign In with valid AD user from a reader group (15ms)
✕ Should enter Settings View Page (2ms)
✕ Should Sign Out (1ms)
● Sign In using Enterprise AD User - Reader role › Should verify app is launched and Sign In button is available
DetoxRuntimeError: Failed to find a device by UDID = "7C50BE35-0CDE-413A-A08D-784E98C61010" and by type = "iPhone 11 Pro"
HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone Xʀ" and avoid explicit search by OS version.
at SimulatorDriver._queryDevices (../node_modules/detox/src/devices/drivers/SimulatorDriver.js:224:13)
● Sign In using Enterprise AD User - Reader role › Should verify app is launched and Sign In button is available
ReferenceError: device is not defined
7 | describe('Sign In using Enterprise AD User - Reader role', () => {
8 | beforeEach(async () => {
> 9 | await device.launchApp();
| ^
10 | });
11 |
12 | it('Should verify app is launched and Sign In button is available', async () => {
at device (specs/signinWithADUserTests.spec.js:9:11)
at tryCatch (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:97:21)
at tryCatch (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40)
at invoke (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:135:20)
at ../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:170:11
at callInvokeWithMethodAndArg (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:169:16)
at AsyncIterator.enqueue (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:192:13)
at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:97:21)
at Object.<anonymous>.exports.async (../node_modules/#babel/runtime/node_modules/regenerator-runtime/runtime.js:216:14)
at Object._callee (specs/signinWithADUserTests.spec.js:8:14)
As stated in the readme:
https://github.com/wix/AppleSimulatorUtils#troubleshooting
If Homebrew complains about a conflict in the wix/brew tap, run brew untap wix/brew && brew tap wix/brew and try installing again
Then upgrade applesimutils normally.

unable to start app from Appium Desktop app. Got an error during apksigner execution

An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate. Original error spawn ENOTDIR
I am trying to start an android app using Appium Desktop app. Appium server shows the following error log;
Starting '/home/santoshpc/Android/Sdk/build-tools/28.0.3/apksigner'
with args
'["sign","--key","/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8","--cert","/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem","/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk"]'
[ADB] Got an error during apksigner execution: Command
'/home/santoshpc/Android/Sdk/build-tools/28.0.3/apksigner sign --key
/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8
--cert /tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem
/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk'
exited with code 1 [ADB] apksigner stderr: Exception in thread "main"
java.nio.file.FileSystemException:
/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk:
Read-only file system [ADB] at
sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
[ADB] at
sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
[ADB] at
sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
[ADB] at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447) [ADB]
at
sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
[ADB] at java.nio.file.Files.move(Files.java:1395) [ADB] at
com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:342) [ADB]
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:89)
[ADB] [ADB] Cannot use apksigner tool for signing. Defaulting to
sign.jar. Original error: Command
'/home/santoshpc/Android/Sdk/build-tools/28.0.3/apksigner sign --key
/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8
--cert /tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem
/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk'
exited with code 1; StdErr: Exception in thread "main"
java.nio.file.FileSystemException:
/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk:
Read-only file system [ADB] at
sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
[ADB] at
sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
[ADB] at
sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
[ADB] at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447) [ADB]
at
sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
[ADB] at java.nio.file.Files.move(Files.java:1395) [ADB] at
com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:342) [ADB]
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:89)
[ADB] [ADB] Resigning apk. [UiAutomator2] Deleting UiAutomator2
session [UiAutomator2] Deleting UiAutomator2 server session [WD Proxy]
Matched '/' to command name 'deleteSession' [UiAutomator2] Did not get
confirmation UiAutomator2 deleteSession worked; Error was:
UnknownError: An unknown server-side error occurred while processing
the command. Original error: Trying to proxy a session command without
session id [ADB] Running
'/home/santoshpc/Android/Sdk/platform-tools/adb -P 5037 -s
0123456789ABCDEF shell am force-stop eu.niko.smart.naswi.main'
[Logcat] Stopping logcat capture [ADB] Removing forwarded port socket
connection: 8200 [ADB] Running
'/home/santoshpc/Android/Sdk/platform-tools/adb -P 5037 -s
0123456789ABCDEF forward --remove tcp:8200' [UiAutomator2] Unable to
remove port forward 'Error executing adbExec. Original error: 'Command
'/home/santoshpc/Android/Sdk/platform-tools/adb -P 5037 -s
0123456789ABCDEF forward --remove tcp:8200' exited with code 1';
Stderr: 'error: listener 'tcp:8200' not found'; Code: '1''
[BaseDriver] Event 'newSessionStarted' logged at 1552282079530
(11:12:59 GMT+0545 (+0545)) [MJSONWP] Encountered internal error
running command: Error: Could not sign with default certificate.
Original error spawn ENOTDIR [MJSONWP] at
ADB.apkSigningMethods.signWithDefaultCert
(/tmp/.mount_AppiumGDrtg1/resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:124:13)
[HTTP] <-- POST /wd/hub/session 500 9847 ms - 206 [HTTP] [HTTP] -->
DELETE /wd/hub/session [HTTP] {} [HTTP] No route found. Setting
content type to 'text/plain' [HTTP] <-- DELETE /wd/hub/session 404 5
ms - 57
I have added following DesiredCapabilities
{
"noReset": true,
"automationName": "uiautomator2",
"appPackage": "myapp package name",
"appActivity": "my app activity name",
"deviceName": "My device",
"platformName": "android"
}
Appium Desktop version: 1.11.1
OS - ubuntu
For me what worked is going to Appium Desktop configurations and changing the JAVA_HOME from
/usr/java/bin
to
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
This is a bug in the "apk-signing.js" file residing in location /usr/lib/node_modules/appium/node_modules/appium-adb/build/lib/tools.
Possible Solutions:
It can be permission issue. The appium is executed without root
privilege so it cannot make the changes to the apk. Executing appium
with root/admin privilege solves the problem. (works only if
apk-signing.js is bug free)
It's working fine for specific appium's versions as they don't have
bug free apk-signing.js like appium version 1.7.2.
This is final solution if above 2 will not work. You have to modify the file apk-signing.js
./node-v6.11.4-linux-armv7l/lib/node_modules/appium/node_modules/appium-adb/build/lib/tools/apk-signing.js
so it would return a true even if it looks not signed. Edit file as mentioned below.
287 case 20:
288 context$1$0.prev = 20;
289 context$1$0.t0 = context$1$0’catch’;
290
291 _loggerJs2[‘default’].debug(“App not signed with debug cert.”);
292 return context$1$0.abrupt(‘return’, true);
Please check this link for editing the file and for more details.
https://discuss.appium.io/t/appium-1-7-1-canot-singin-appium-uiautomator2-server-debug-androidtest-apk/19233/4
Hope it will help.

reavt native event.js 167 error //unknown error

BUILD SUCCESSFUL in 14s
28 actionable tasks: 1 executed, 27 up-to-date
Running adb -s 988ad833354d59594330 reverse tcp:8081 tcp:8081
Starting the app on 988ad833354d59594330 (adb -s 988ad833354d59594330 shell am start -n com.celebrations/com.celebrations.MainActivity)...
Starting: Intent { cmp=com.celebrations/.MainActivity }
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
i was building the code for the first time and getting this error while compiling.
any solutions for this error??
It means you already use port 8081, but you can run these commands:
sudo lsof -i :8081
kill -9 < PID >

Running a single Mocha test not working with IntelliJ and Typescript

I installed the NodeJS plugin for IntelliJ and running all mocha tests works.
When I try to run a single suite, Mocha generates a config for me like the following:
/usr/local/bin/node /usr/local/lib/node_modules/mocha/bin/_mocha \
--timeout 15000 \
--compilers ts:ts-node/register \
--ui bdd \
--reporter "/Users/Bersling/Library/Application Support/IntelliJIdea2017.1/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js" \
/Users/Bersling/Desktop/IT-Projects/typescript-mongo-express-angular-node-seed/backend/src/router/endpoints/login-router.test.ts \
--grep "LoginRouter "
However, that doesn't work for me. I get the errors on tests that should work fine. Here's part of the logs.
error: Error: Internal Server Error
at Test.Request.callback (/Users/Bersling/Desktop/IT-Projects/typescript-mongo-express-angular-node-seed/backend/node_modules/superagent/lib/node/index.js:626:17)
at IncomingMessage.<anonymous> (/Users/Bersling/Desktop/IT-Projects/typescript-mongo-express-angular-node-seed/backend/node_modules/superagent/lib/node/index.js:795:18)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
(node:90972) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): AssertionError: false == true
Error: Unknown authentication strategy "local"
at attempt (/Users/Bersling/Desktop/IT-Projects/typescript-mongo-express-angular-node-seed/backend/node_modules/passport/lib/middleware/authenticate.js:173:37)
What would work is the following:
/usr/local/bin/node /usr/local/lib/node_modules/mocha/bin/_mocha \
--timeout 15000 \
--compilers ts:ts-node/register \
--ui bdd \
--reporter "/Users/Bersling/Library/Application Support/IntelliJIdea2017.1/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js" \
**/*.test.ts \
--grep "LoginRouter "
Like this the test runs fine.
Does anyone know how I could get this to run?
Today I got the same error.
Try reinstalling mocha to another version then return previous version.
This works for me.

SessionNotCreatedException: A new session could not be created.INSTALL_FAILED_ALREADY_EXISTS:

info: [debug] Setting device id to ZY223DDMM8
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 wait-for-device
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\Windows\system32\cmd.exe /s /c "E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""
Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]
info: [debug] Error: Command failed: C:\Windows\system32\cmd.exe /s /c "E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""
Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]
at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]\r\n)","killed":false,"code":1,"signal":null,"cmd":"C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"","origValue":"Command failed: C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]\r\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 3251.479 ms - 1342
add --no-reset flag so that appium doesnt try to install the apk again or uninstall the apk before you run the test scripts