xcodebuild failed to launch '/Applications/Xcode.app/Contents/Developer/Tools/otest' via Jenkins - objective-c

error: failed to launch '/Applications/Xcode.app/Contents/Developer/Tools/otest' -- failed to get the task for process 34796
Hi,
When I run the command:
/usr/bin/xcodebuild -scheme my_scheme_name -configuration Debug build test
I get the following error:
error: failed to launch '/Applications/Xcode.app/Contents/Developer/Tools/otest' -- failed to get the task for process 34796
This only happens when the command is executed via Jenkins. Doesn't happen when I execute it from command line.
Has anyone else run into something like this?
The build itself builds an objective c library and the tests are SenTestCases. It's not an iOS app - it's an objective c library to be used in various apps

I used sudo DevToolsSecurity -enable to get past this problem.

Related

Karate Performance testing : Getting build failure with error "Unrecognized VM option 'UseBiasedLocking'

I am trying to reuse Karate tests for performance testing with Gatling and Scala.
I have configured everything as described in documentation. But then when I run the mvn command I am getting error "Unrecognized VM option 'UseBiasedLocking' Error: Could not create the Java Virtual Machine."
mvn command used to run tests: mvn test-compile gatling:test
Tried with looking at Env path variables and running the mvn command with different options. But still getting same error
Failed to execute goal io.gatling:gatling-maven-plugin:4.1.5:test (default-cli) on project PerformanceTesting: Gatling failed.: Process exited with an error: 1 (Exit value: 1)
Below is the POM file
Scala File
The issue is resolved after upgrading the gatling.plugin.version to 4.2.7 as my Java version 19 is not supporting old gatling plugin.
Below article helped to resolve
Unrecognized VM option 'UseBiasedLocking' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit

Android emulator tear down during tests run

guys!
I run my Android tests with Appium on Android emulator. Where I run my tests in sequence emulator sometimes tear down and remaining tests are ignored.
In Appium logs i see this error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\Username\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps' exited with code 20'; Stderr: 'cmd: Can't find service: settings'; Code: '20'
Is there anybody face with such problem?
You are trying to run an adb-shell command which is not allowed.
Appium has some in-secure commands that normally it will not allow them to be used.
You can see the commands here: Appium Insecure Features
The adb-shell commands (to change the system settings) is one of them.
Follow the link to how to prevent appium checking this.
How to resolve:
At the beginning of test setup, run this commnad: appium --relaxed-security with command line. Then the appium let you using the insecure feautures during the test.
for example in pyhton you should run os.system(appium --relaxed-security (while having appium directory in the system environment variables path.

RNC Slider lint FAILED on ./gradlew clean build and release apk crashes on app start

Before assembling release, I'm trying to make clean build but it throws error and fails the task. When I generate release apk (succesfully generates), after installing it on my LG G4 phone (also tried Samsung Galaxy J3), it is crashing and not starting.
My app succesfully works with react-native run-android on my phone.
Before assembling release build, I typed
cd android
./gradlew clean
./gradlew buildcache
./gradlew clean build
and the last command always gives errors.
After adding
android {
lintOptions {
abortOnError false
}
}
to RNC Slider's build.gradle file as the errors say, ./gradlew clean build succesfully finishes its task. But still I can't open the app after generating and installing release apk.
./gradlew clean build error:
...
> Task :#react-native-community_slider:lint FAILED
Ran lint on variant release: 3 issues found
Ran lint on variant debug: 3 issues found
Wrote HTML report to file:///D:/React/Pure%20RN/dassist/node_modules/#react-native-community/slider/android/build/reports/lint-results.html
Wrote XML report to file:///D:/React/Pure%20RN/dassist/node_modules/#react-native-community/slider/android/build/reports/lint-results.xml
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':#react-native-community_slider:lint'.
> Lint found errors in the project; aborting build.
Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
lintOptions {
abortOnError false
}
}
...
Errors found:
D:\React\Pure RN\dassist\node_modules\#react-native-community\slider\android\src\main\java\com\reactnativecommunity\slider\ReactSliderManager.java:68: Error: Value must be ? 0 (was -2) [Range]
ViewGroup.LayoutParams.WRAP_CONTENT,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BU¦LD FAILED in 35s
163 actionable tasks: 154 executed, 9 up-to-date
And this is a part of the xml report file (warnings excluded) mentioned in output logs:
<issues format="5" by="lint 3.3.1">
<issue
id="Range"
severity="Error"
message="Value must be ≥ 0 (was -2)"
category="Correctness"
priority="6"
summary="Outside Range"
explanation="Some parameters are required to in a particular numerical range; this check makes sure that arguments passed fall within the range. For arrays, Strings and collections this refers to the size or length."
errorLine1=" ViewGroup.LayoutParams.WRAP_CONTENT,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="D:\React\Pure RN\dassist\node_modules\#react-native-community\slider\android\src\main\java\com\reactnativecommunity\slider\ReactSliderManager.java"
line="68"
column="13"/>
</issue>
</issues>

xcodebuild builds test target but cannot run xctest

I run a command in terminal
sudo /usr/bin/xcodebuild -project awesome.xcodeproj -scheme "AwesomeTests"
-configuration Production test -derivedDataPath ~/Documents/buildData
-sdk "OS X 10.9"
last lines of output looks like
error: failed to launch '/Applications/Xcode.app/Contents/Developer/usr/bin/xctest'
-- error: Host::LaunchProcess (launch_info) => pid=0,
path='/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver'
err = Problems with launching via XPC. XPC error : Connection interrupted (0x00000005)
** TEST SUCCEEDED **
Before outputing these lines I'm prompted with: "xcodebuild is trying to take control of a root process. Type your password to allow this"
I'm using Xcode 5.0.2.
As #trojanfoe noted, the sudo was the cause of the error.
It seems like ~/Documents/buildData folder was created with root permissions and couldn't be accessed from xtest.

sencha build giving error stbuild exited with non-zero code : 7

I wanted to create .apk file of my sencha application so I executed below command
sencha package build packager.json
but when I executed above command,it generates error as given below.
'C:\Program' is not recognized as an internal or external command,operable program or batch file.
""D:/Android/AndroidSDKr15\tools\android" create project --target android-16 --name chartDemoApp --activity STActivity --path "../build/" --package triumphsys. mobility.chartDemoApp"
Could not run ant with error: 1
Failed to package application
[ERR] stbuild exited with non-zero code : 7
even I have attached my command prompt here and packager.json here.
please help me to resolve it.
I was able to solve the problem by uninstalling "C:\Program files\Sencha Cmd" and again re-installing it at "C:\Sencha" without any spaces in folder name. and it worked for me.