Is it possible to send an html email report through a monkey talk automation tool. If it is possible please provide any code or url.
Thanks,
Ramakrishna.
Use a CI (continuous Integration tool) with monkeytalk.
like jenkins+monkeytalk it is bit hard to configure it. but it can be done. use jenkins to automate the process of checkout code from repository and write a shell script to build the project and runtest cases with monkeytalk. after finish tests jenkins will email the reports to the given recipients.
jenkins: http://jenkins-ci.org/
More details...
first of all you need to download and deploy Jenkins. Downloadlink
to deploy in terminal
$ java -jar jenkins.war
open a browser http://localhost:8080 will take you to Jenkins dash board.
There is link for Jenkins settings on left side menu: from that page you can set an email account , password for Jenkins. and then provide recipient email addresses. so if a build faild Jenkins will email all console errors to the recipents. (try reading Jenkins documentation if it hard to install)
Then create a new job giving a name and details . add your repository URL and type add user credientials to it. and configure the rest in the end of the page you can give a build command as a shell script or ant file or there are many options.
then save the job and edit configurations start a build if it not checkout your code from repo and build correctly copy the errors from error console and search in google.
here is a sample code for build a Xcode project to a simulator
echo "Build Start"
/usr/bin/xcodebuild -target FuncTest CODE_SIGN_IDENTITY="iPhone Distribution: Leapset Inc." PROVISIONING_PROFILE="xxxxxxxx-1216-4E86-97D5-xxxxxxxxxxxx" OTHER_LDFLAGS="-lxml2 -all_load -lstdc++" DSTROOT="build" VALID_ARCHS="armv7 armv7s i386" -arch i386 -sdk iphonesimulator6.0 -configuration Release clean build install;
echo "Build End"
if you need to open iPhone simulator with the app use
# open app in simulator
echo "Start run app in simulator"
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication release-1.081/Leapset/build/Release-iphonesimulator/LeapsetFuncTest.app/FuncTest & disown;
echo "DONE run app in simulator"
run tests
echo "start run Test jobs"
######### Job 1 #########
echo
echo "TEST: SignInOut.mts"
echo "DISCRIPTION: sign in and out with user credintials"
#java -jar $$ROOTPATH/monkeytalk/LeapsetTest/libs/monkeytalk-runner-1.0.43.jar -agent IOS $ROOTPATH/monkeytalk/LeapsetTest/signinUser.mt
java -jar monkeytalk/LeapsetTest/libs/monkeytalk-runner-1.0.43.jar -agent IOS monkeytalk/LeapsetTest/SignInOut.mts
and monkey talk will generate reports. only thing you need to find is some way to attach those html reports to the Jenkins There are so many plugging available for Jenkins.
above commodes are working fine but you need to give the corrects paths to work it. like for above build command
Note: this command should run in terminal inside the project root directory(where the Xcode project file is)
Good luck
:)
xocdebuild command help
xcodebuild
[-project <projectname>]
[[-target <targetname>]...|-alltargets]
[-configuration <configurationname>]
[-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]]
[-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild
[-project <projectname>] -scheme <schemeName>
[-configuration <configurationname>]
[-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]]
[-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild
-workspace <workspacename> -scheme <schemeName>
[-configuration <configurationname>]
[-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]]
[-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]]
xcodebuild -showsdks
Related
After updating my Xcode to the latest version 14.0. I am facing this issue if anyone know how to resolve it please let me know
Click properties on the project, go to build phases and check the option "For install builds only"
Maybe the problem is with "Run script"
Ex: I did change firebase crashlytics from "pod" to "Packeges".
But I not change script.
I have tried all the solutions in
"https://stackoverflow.com/questions/53289524/xcode-10-2-1-command-phasescriptexecution-failed-with-a-nonzero-exit-code"
My solutions is change TARGETS -> Build Phases. In the script field
form
"${PODS_ROOT}/FirebaseCrashlytics/run"
to
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
In short the problem is your script, do it right
If Scrip is install builds only. U need
Targets -> Build Phases -> Run Scrip -> check "For install builds only"
Ex:
APP_PATH=“${TARGET_BUILD_DIR}/${WRAPPER_NAME}”
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find “$APP_PATH” -name ‘*.framework’ -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read “$FRAMEWORK/Info.plist” CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH=“$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME”
echo “Executable is $FRAMEWORK_EXECUTABLE_PATH”
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo “Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME”
lipo -extract “$ARCH” “$FRAMEWORK_EXECUTABLE_PATH” -o “$FRAMEWORK_EXECUTABLE_PATH-$ARCH”
EXTRACTED_ARCHS+=(“$FRAMEWORK_EXECUTABLE_PATH-$ARCH”)
done
echo “Merging extracted architectures: ${ARCHS}”
lipo -o “$FRAMEWORK_EXECUTABLE_PATH-merged” -create “${EXTRACTED_ARCHS[#]}”
rm “${EXTRACTED_ARCHS[#]}”
echo “Replacing original executable with thinned version”
rm “$FRAMEWORK_EXECUTABLE_PATH”
mv “$FRAMEWORK_EXECUTABLE_PATH-merged” “$FRAMEWORK_EXECUTABLE_PATH”
done
On my side this issue appeared when i change my computer and issue was caused by Apple Silicon processor. When i start to use m1 pro, i did not check the installation page i directly intalled flutter via Fvm. When i check the installation page i saw there are a few steps to install flutter on Apple Slicon. And these steps fixed the issue;
sudo softwareupdate --install-rosetta --agree-to-license
ref: https://docs.flutter.dev/get-started/install/macos
My Expect: # Build Successed # and # Test Failed #
Actual Result: only # Build Succeeded #
How do I get fail/success in command line? [iphone, objective-c, xcode4, OCUnit]
I'm newbe of OCUnit and Xcode4. I create project:
https://github.com/sanemat/HogeHoge
This is scafold code by xcode4. I run test in xcode gui, #Test Failed# appear in successfully. In commandline (I want to use jenkins),I use following command.
xcodebuild -target HogeHogeTests -configuration Debug -sdk iphonesimulator4.3 clean build
I see # Build Succeeded # and then completed. I want run test and get it's result. How?
Edited:
I found BPOCUnitXMLReporter. This is for MacOS. I forked and adjusted iOS.
I found BPOCUnitXMLReporter. This is for MacOS. I forked and adjusted iOS.
Try the Text Finder Plugin It allows you to search a log for a string, and set pass or fail based on that.
You can integrate a custom test logger with OCUnit. See my answer here:
How do I trap OCUnit test pass/failure messages/events
what you're looking for is this undocumented argument (you do need sdk and target too) to run your OCUnit Tests from the terminal
xcodebuild -target MyTarget -sdk iphonesimulator TEST_AFTER_BUILD=YES
I've used to build my project with
xcodebuild -proj MyProject.xcodeproj -target MyTarget - configuration Debug -sdk iphonesimulator4.3
this works(it builds fine) but when I hit run in xcode, it recompiles.
(with xcode3, there was no need to rebuild once I build using command line)
I suspect xcode build use workspace/scheme rather than project/target.
How do I find out the workspace name that my current xcode project is using?
Thank you
edit
Chetan's links gave me directions what to look for.
xcode4 stores build output in ~/Library/...
whereas xcodebuild -project .. saves build output in project's build directory.
(if you want the workspace capability, you can't use the build directory for build output)
I created a workspace containing my project and ran
xcodebuild -workspace myWorkSpace -scheme myScheme
this saves build output in ~/Library/...../Debug-iphoneos
whereas xcode4 run button from the same workspace and same scheme saves output in
~/Library/..../Debug-iphonesimulator
any guess on why xcodebuild command uses Debug-iphoneos? :(
edit2
xcodebuild -workspace myWorkSpace -scheme myScheme -sdk iphonesimulator4.3
specifying sdk solved it
I know it isn't strictly the answer to your question, but you can configure the output directory of your build using the CONFIGURATION_BUILD_DIR environment variable.
Source: http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/0-Introduction/introduction.html#//apple_ref/doc/uid/TP40003931-CH1-SW1
Following on from my question How to run an xcode project from bash?
I've found the built *.app in the build directory, but I'm trying to figure out how to get xcode to open it as it can't just be run as a Mac OS X program.
Any ideas?
thanks to chuan at this post: XCode Test Automation For IPhone
I'm stuck with the same problem trying to launch my debug output from building my xcode project. I just experimented with the following
open ./prog.app&
seems to do the trick.
I've solved my problem using a bash file that uses rsync to sync working directories and then AppleScript which builds and runs the project.
sync.sh:
#!/bin/bash
# script for moving development files into xcode for building
developmentDirectory="/"
xcodeDirectory="/"
echo 'Synchronising...'
rsync -r $developmentDirectory $xcodeDirectory \
--exclude='.DS_Store' --exclude='.*' --exclude='utils/' --exclude='photos'
echo 'Synchronising Done at:'
echo $(date)
buildandrun:
set projectName to "projectName"
# AppleScript uses : for / in directory paths
set projectDir to "Users:username:Documents:" & projectName & ":" & projectName & ".xcodeproj"
tell application "Xcode"
open projectDir
tell project projectName
clean
build
(* for some reasons, debug will hang even the debug process has completed.
The try block is created to suppress the AppleEvent timeout error
*)
try
debug
end try
end tell
quit
end tell
Then, finally, I'm using a shell script called run.sh aliased in my .bash_profile:
run.sh:
#!/bin/bash
bash utils/sync.sh
osascript utils/buildandrun
Can everything which is done through Xcode GUI be done through command line, like changing app name, changing provisional profile, distribution profile? If yes then how. May be it can be done through xcodebuild , but till now i am only able to compile through xcodebuild.
Yes. Building can be done through xcodebuild:
$ xcodebuild -help
Usage: xcodebuild [-project <projectname>] [-activetarget] [-alltargets] [-target <targetname>]... [-parallelizeTargets] [-activeconfiguration] [-configuration <configurationname>] [-sdk <sdkfullpath>|<sdkname>] [-xcconfig <filepath>] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild [-version [-sdk [<sdkfullpath>|<sdkname>] [<item>] ]
xcodebuild [-showsdks]
xcodebuild [-find <binary> -sdk <sdkfullpath>|<sdkname>]
xcodebuild [-list]
…but I see you already know that. The application name can be changed by simply editing the Info.plist file. And I think you can change the profiles by hacking the *.pbxproj file (it’s a regular text file). You can save a copy of the project file, change a profile through the IDE and then diff the new version and the saved copy to see the changes:
$ find . -name '*.pbxproj'
./Source/Foo.xcodeproj/project.pbxproj
$ cp Source/Foo.xcodeproj/project.pbxproj ~/Desktop
# …now changing the profile through IDE…
$ diff Source/Foo.xcodeproj/project.pbxproj ~/Desktop/project.pbxproj
517d516
< "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "…";
534d532
< "PROVISIONING_PROFILE[sdk=iphoneos*]" = "…";
But it depends on what you are trying to do. You could switch the profiles much easier by setting different profiles for different build modes (Debug/Distribution/Whatever).