Creating a build file with Shenzhen and Xcode 6 fails - ios

I'm trying to setup a Jenkins job which will allow me to automatically create and upload an .ipa file to Itunes Connect. I'm using Shenzhen for this but it fails and I get the following output:
xcodebuild build/workspace/Mobile-IOS/AdminPanel/AdminPanel.xcworkspace
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
** ARCHIVE FAILED **
The following build commands failed:
Check dependencies
(1 failure)
I use the following command in terminal:
$ ipa build --workspace build/workspace/Mobile-IOS/AdminPanel/AdminPanel.xcworkspace --scheme AdminPanel --config DEBUG
ps: I tried both debug and release configs.

I know this is not a direct answer to your question, however, I've had problems with Shenzhen in the past as well. I since switched over to the fastlane toolset. They have a tool called GYM. You should check it out. It's incredibly easy to use.

Related

Self Hosted Agent on macOS not working with Azure Pipeline

This is an issue I've been facing for the past week.
I have an M1 Mac Mini setup as a self-hosted agent to run iOS related builds/archives through Azure Pipelines.
I'm able to build/archive locally on the machine itself using terminal. Mobile provisioning and code signing are setup and working fine.
When I run the agent interactively using run.sh, I am able to run the pipeline successfully. When I try running the agent as a launchd service using ./svc.sh install -> ./svc.sh start, it always fails with the same error:
** ARCHIVE FAILED **
The following build commands failed:
ValidateEmbeddedBinary /Users/<user>/Library/Developer/Xcode/DerivedData/<project>/Build/Intermediates.noindex/ArchiveIntermediates/<app-name>/BuildProductsPath/Debug-iphoneos/<app-name>.app (in target '<app-name>' from project '<project>')
(1 failure)
##[error]Bash exited with code '65'.
The command I'm using to archive is
xcodebuild -workspace ~/repos/<project>/<project>.xcworkspace -scheme <app-name> -allowProvisioningUpdates clean archive -archivePath build/<app-name> -destination generic/platform=iOS
Again, this command works when I run it locally and when I run the agent interactively.
I removed app/project names for privacy reasons.
I've searched high and low as to why this error is occurring and I've tried virtually all suggestions to fix it. For the life of me I don't know why the command would work locally and when the agent is run interactively, but does not work when the agent is run as a launchd service.
Edit: I’ve noticed a pattern: the archive fails with that error after every successful run. In other words the command successfully archives but when I run it again, it fails. If I run it once more, it’s successful. This occurs when running it through Azure Pipelines and locally via terminal. I have no words!

react-native run-ios keeps on failing

after updating MacOS to Big Sur and since Legacy build is deprecated
react-native run-ios does not work anymore, I've tried so many solutions but no progress I've been suffering with this for around 3 days.
side note that build on xcode succeeded
versions:
react-native: 0.59.10
xcode: 12
and I'm using iPhone 11 simulator and I also tried a real iPhone 11 device
result of npx react-native run-ios
on simulator:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening myapp.xcworkspace
** BUILD FAILED **
The following build commands failed:
Ld /myapp/ios/build/Build/Products/Debug-iphonesimulator/myapp.app/PlugIns/myapp.xctest/myapp normal
(1 failure)
another one on the simulator:
info ** BUILD SUCCEEDED **
info Installing DerivedData/Build/Products/Debug-iphonesimulator/myapp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/myapp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
on device:
info ** BUILD SUCCEEDED **
info installing and launching your app on Menna’s iPhone...
info ** INSTALLATION SUCCEEDED **
but the application doesn't appear on the device and I don't know how is that even possible?!
any help would be appreciated
SOLVED
in xcode, go to Project Settings > change build system to new build system
click on Advanced, then choose Custom (Relative to workspace) and specify locations as following:
Products: build/Build/Products
Intermediates: build/Build/Intermediates.noindex
in vs code, open node_modules/#react-native-community/cli/build/commands/runIOS/runIOS.js
and change DerivedData/Build/Products/${configuration}-${device}/${appName}.app
to build/Build/Products/${configuration}-${device}/${appName}.app;
delete ios/build and DerivedData content
run react-native run-ios again
try:
sudo npm install -g ios-deploy --unsafe-perm
and next:
yarn ios --device "YOUR_DEVICE_NAME"

Failed to archive an app using xcodebuild

I am trying to archive an app using xcodebuild but it keeps on failing at the last step of certificate signing with no clear error message. All I am getting is
Validate /Users/ashraftawfeeq/Library/Developer/Xcode/DerivedData/<ProjectName>-ghodnwbxujykykezmtkiilwfkxrf/Build/Intermediates.noindex/ArchiveIntermediates/<APP>/InstallationBuildProductsLocation/Applications/<APP>.app (in target '<Target>' from project '<ProjectName>')
cd /Users/ashraftawfeeq/<ProjectRepo>
builtin-validationUtility /Users/ashraftawfeeq/Library/Developer/Xcode/DerivedData/<ProjectName>-ghodnwbxujykykezmtkiilwfkxrf/Build/Intermediates.noindex/ArchiveIntermediates/<APP>/InstallationBuildProductsLocation/Applications/<APP>.app
Touch /Users/ashraftawfeeq/Library/Developer/Xcode/DerivedData/<ProjectName>-ghodnwbxujykykezmtkiilwfkxrf/Build/Intermediates.noindex/ArchiveIntermediates/<APP>/InstallationBuildProductsLocation/Applications/<APP>.app (in target <TargetName> from project <ProjectName>)
cd /Users/ashraftawfeeq/<ProjectRepo>
/usr/bin/touch -c /Users/ashraftawfeeq/Library/Developer/Xcode/DerivedData/<ProjectName>-ghodnwbxujykykezmtkiilwfkxrf/Build/Intermediates.noindex/ArchiveIntermediates/<APP>/InstallationBuildProductsLocation/Applications/<APP>.app
** ARCHIVE FAILED **
When I try to archive using Xcode, it works as intended. Also when I try xcodebuild build it succeeds as well. Digging in the logs it seems like xcodebuild is not creating InstallationBuildProductsLocation/Application.
After a lot of searching and debugging, it turned out that I have a Perl script that wasn't producing errors but without a non zero exit. The process continues and the archive is created but the process was failing.
I removed 'arm64' from 'Excluded Architectures' (Target -> Build Settings).

running command "xcodebuild" exited with error code 65

I have written a project with react-native and it works on Android. Now I want to run it on ios. When I build my project in Xcode it is okay and I have the "Build succeed" message. But when I run the project in my IDE I have the following Error:
error Failed to build ios project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening MyProjectName.xcodeproj
** BUILD FAILED **
The following build commands failed:
myProjectDirectory/ios/build/MyProjectName/Build/Products/Debug-iphonesimulator/ReactNativeNavigationTests.xctest/ReactNativeNavigationTests normal x86_64
(1 failure)
....
I have tried bellow solutions, but none of them worked for me:
1- I removed the build folder from ios and rebuild the project again.
2- I ran "npm dedupe"
3- I built a simple new project and I could see "Welcome to React Native..." page on iphone.Then I installed wix v2 library in this project and I could see the page again. It means my problem is not about xcode version or wix installation steps.
4- I have clean and rebuild my project in xcode.
I searched a lot on the internet. But I couldn't find any helpful solution.
Any suggestion will be helpful.
It seems your tests are failing.
Try to run tests from Xcode and see if they are ok because my bet is they will fail.

Ionic run fail to deploy to device

I am using Mac OS X 10.11. I am trying to deploy build to device (iPhone 4) by running sudo ionic run ios --device and I get this error message:
Check dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/john/Desktop/Myproject/platforms/ios/cordova/build-debug.xcconfig,-project,Myproject.xcodeproj,ARCHS=armv7 armv7s arm64,-target,Myproject,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/john/Desktop/Myproject/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/john/Desktop/Myproject/platforms/ios/build/sharedpch
ERROR running one or more of the platforms: Error: /Users/john/Desktop/Myproject/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
I have no problem when running just only ionic run ios, which will deploy the app into emulator. How can I overcome the problem?
Another method will be
Go to your platform directory of your project /platforms/ios
Write in the console open . which will open your folder with Finder.
After that open YourProject.xcodeproj with XCode and select your device and click on run.
Good luck

Resources