Is there a bug with Xcode 9.3 affecting Cordova Run iOS (in simulator)? - xcode

My Cordova iOS builds had previously been running fine from the CLI, until I updated to macOS 10.13.4 and Xcode 9.3 (9E145). Now whenever I use
cordova run ios
The simulator will launch, but my app is not installed or run, and this message is displayed:
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.
After a minute or two, the process stops and the message then reads:
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "com.myapp.name" failed.
The request was denied by service delegate (SBMainWorkspace) for reason: NotFound ("Application "com.myapp.name" is unknown to FrontBoard").
Underlying error (domain=FBSOpenApplicationErrorDomain, code=4):
The operation couldn’t be completed. Application "com.myapp.name" is unknown to FrontBoard.
Application "com.myapp.name" is unknown to FrontBoard.
Has anyone encountered this message specifically after installing Xcode 9.3? I've uninstalled and reinstalled Cordova, I've tried 'erase settings' within the simulator, and I've removed and added the iOS platform from my project.
The project will successfully build and run if I open the Xcode project file directly within Xcode. So currently it just seems to be a fault from launching the simulator from the Cordova CLI.
Any other tips/tricks?

I’m having a similar issue.
seeing this after I update to XCode 9.3 and build through cli
Error Domain=IDEProfileLocatorErrorDomain Code=1 “No profiles for ‘org.oclc.digby’ were found” UserInfo={NSLocalizedDescription=No profiles for ‘org.oclc.digby’ were found, NSLocalizedRecoverySuggestion=Xcode couldn’t find any iOS Ad Hoc provisioning profiles matching ‘org.oclc.digby’. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}
When I bring the project up in XCode the signing is correct and not complaining.

Same issue, solved after install iOS 11.2 Simulator in Xcode preferences -> Components, then
ionic cordova run ios -l --target="iPhone-X"

Related

Xamarin error ios Simulator HE0046: Failed to install the app ... Failed to install the requested application

I changed name of my VS 2019 project running on Mac (from PrismApp1 to something else) and now I can't run on iOS simulator. Tried to run on different simulator phone too. I searched for PrismApp1 in folder and on machine can't find anything... delete bin and obj folders and did a Build All. any ideas?
error HE0046: Failed to install the app 'com.companyname.PrismApp1' on the device 'iOS 13.2 (17B102) - iPhone 11 Pro': Failed to install the requested application
Note: it works if i deploy to my physical iPhone...
I had a similar issue with iPhone 13 emulator and iOS 15, where I couldn't deploy my app on the simulator, but it worked on a real device.
The error I was getting was:
error HE0046: Failed to install the app 'ma.myapp.app' on the device 'iOS 15.0 (19A339) - iPhone 13 mini': “Myapp” Needs To Be Updated
This is how I solved the issue.
I had this weird error after app was successfully compiled and it was simply due to a null variable involved in a plist command executed post build.
Just try to close and reopen VS, it worked for me.

React native project not on present IOS simulator or on Xcode

this is the second part of a bigger problem where the first part was solved here React native project deleted on xcode, can't run "run-ios react-native".
I have deleted my project on Xcode may it be .xcworkspace or .xcodeproje.
Because of that, I had to delete IOS and android folders while downgrading, updating and re-upgrading my react version to re-install IOS and android folders.
Thanks to that the emulator is working but unfortunately the project isn't present in the emulator and is still absent with Xcode. One thing to point out is that the simulator only appears when ran in the integrated terminal and nor in general terminal after cd-ing in the project folder.
Can anyone please help re-integrating the project in the emulator and on Xcode please.
Here is the error when the emulator is running in a general terminal:
error Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Here is the error for building the project within emulator when ran from VS code integrated terminal:
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 project.xcodeproj
In Xcode, select Xcode menu, then Preferences, then Locations tab. Click on the advanced button, select legacy and exit Xcode.

Getting error while running flutter project in simulator in debug mode

Error comes after running flutter run
The Xcode project does not define target "Runner" which is needed by
Flutter
tooling.
Open Xcode to fix the problem:
open ios/Runner.xcworkspace
Encountered error while building for device.
Just make sure that your app target called "Runner". It seems that flutter tooling relies on this target name.
Example

Issues with starting an UITest after upgrade to Xamarin Studio version 6.3 (build 864)

After I have upgraded Xamarin Studio to version 6.3 (build 864) most of the UITests (which have been working fine) are failing. I get the following errors:
SetUp : System.Exception : Unable to contact test backend running in app. A common cause is that the app is not properly linked with Calabash. Please verify that it includes the Calabash component.
SetUp : Calabash.XDB.Core.Exceptions.DeviceAgentException : Failed to install DeviceAgent
ExitCode: 5
-a,--app-path <path/to/app-bundle.app or path/to/app.ipa> Path .app bundle or .ipa
-c,--codesign-identity <codesign-identity> [OPTIONAL] Identity used to codesign app bundle [device only]. Deprecated - should use profile path. DEFAULT=
-d,--device-id <device-identifier> [OPTIONAL] iOS Simulator GUIDs
-p,--profile-path <path/to/profile.mobileprovision> [OPTIONAL] Path to provisioning profile
-u,--update-app <true-or-false> [OPTIONAL] When true, will reinstall the app if the device contains an older version than the bundle specified DEFAULT=1
install <device_id> <app_id> <profile_path> <codesign_id> <resign_object>
Error checking if application is installed: Error Domain=com.facebook.FBSimulatorControl Code=0 "Application with bundle ID 'com.apple.test.DeviceAgent-Runner' is not installed" UserInfo={NSLocalizedDescription=Application with bundle ID 'com.apple.test.DeviceAgent-Runner' is not installed, NSUnderlyingError=0x7fc0d46a88a0 {Error Domain=NSMachErrorDomain Code=-308 "(ipc/mig) server died"}}
According to error 1: My app is properly linked with calabash, this because it has been working on other versions of Xamarin Studio.
According to error 2: I can see Xamarin has installed the deviceAgent app on the simulator, but for some reason the installation has failed.
Can anyone provide me a solution?
I have already seen the "Error checking if application is installed:". The issue appeared when iOS 12.0.1 went live because the Xamarin.UITest package needed an update (from Xamarin.UITest 2.2.6 to 2.2.7).
"Unable to connect to testing backend" error might be caused by build configurations, maybe you have some compilation constants(#IF DEBUG) and calabash is started only in Debug mode, while you're trying to run on Release, might be worth checking.
"Device Agent Failed to install/launch" is a random error that can happen from time to time, when I encounter this I usually fix it:
Deleting App and Device Agent and running again
Quit Simulator
Quit VS and Restart
MacBook Restart.
Hope this helps!

xcode build fails with error code 65 without indicative message

I'm experiencing weird behaviour with my iPhone CI job (running in TeamCity). Every once in a while our build fails without any indicative error in the build log. The build reaches the last stage of codesign validation and I get ** BUILD FAILED ** message immediately after.
These are the last lines of the log of a good and bad builds -
Bad Build
[15:00:56] : [CodeSign] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Library/TeamCity/buildAgent/work/dc055fa257f562be/DerivedData/MyProject/Build/Products/AdHoc-iphoneos/MyProject.app
[15:00:58]W: [Step 3/6] ** BUILD FAILED **
Good Build
[14:09:13] : [CodeSign] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Library/TeamCity/buildAgent/work/dc055fa257f562be/DerivedData/MyProject/Build/Products/AdHoc-iphoneos/MyProject.app
[14:09:13] : [Step 3/6] ** BUILD SUCCEEDED **
Because it's running in a CI I looked for user interaction problems (opening the keychain...etc') but usually xcodebuild spews the relevant errors.
Is there any other log I can dig into to find the cause of the build failures?
EDIT:
Seems I had the same problem like build failed jenkins iOS no error.
I also had a similar problem, in my case it was caused by the fact I'm using both Xcode 7.2 and Xcode 6.4 side by side. When the simulator of Xcode 6.4 is open (iOS Simulator 8.4) and I try to start a test from the commandline using Xcode 7.2 I get this 65 error.
Eg. when iOS Simulator 8.4 is open:
# sudo xcode-select -s "/Applications/Xcode 7.2.app/Contents/Developer"
# xcodebuild test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO -workspace "/path/to/MyWorkspace.xcworkspace" -scheme "MyProject" -destination "platform=iOS Simulator,name=iPhone 6,OS=9.2"
(cut)
** TEST FAILED **
# echo $?
65
Solution is to kill the simulator before starting the test:
# killall "iOS Simulator"
# killall "Simulator"
The process is called "iOS Simulator" for XCode 6.4 and earlier and called "Simulator" for later XCode versions.
Had the same problem as build failed jenkins iOS no error
tl;dr - CopyPNG failed because of two images with the same name.
You need to remove platform ios - cordova platform rm ios, and then add platform - cordova platform add ios. now build ios - cordova build ios
I hit this when updating to Xcode 8, in my case it was because I had set the PROVISIONING_PROFILE_SPECIFIER setting incorrectly
For Xcode version 13
The following is what worked for me, this is aimed at Xcode version 13, hoping to be helpful
My React native project was cloned, i was able to run the app in android, but while running on iOS it showed error code 65.
After trying most of the solutions and failing, i got it fixed finally. This is what worked for me, and could be useful for some people hopefully.
Clone the project again(not necessary, just telling you what was done)
npm install
pod install (in iOS directory)
If Xcode shows error code 65, if there is legacy deprecation issue --> go to Xcode -->file --> workspace settings --> Check the box at the end of the window saying "do not show diagnostic issue about build system deprecation
run the project again
This is what fixed it for me.
My issue came up after updating to the latest version of Xcode. To resolve, I performed the following steps.
Completely quit Xcode and the Simulator. I had a zombie Simulator process running that I found and closed through Activity Monitor. Be sure no processes for Xcode or Simulator are running.
In Xcode, open the project found in the ios folder of your react-native project.
Xcode may suggest some recommended updates to modules. I accepted their recommendations.
Close Xcode, relaunch your react-native app

Resources