Xcode will run the Unity app on device, but when I run the built app, the black screen will appear - ios

environment:
Develop OS:macOS Catalina 10.15.5
Xcode:11.5
Device OS: iPhone 7 Plus (iOS 13.5.1)
Unity : 2019.3.9f
I built the iOS app with Unity.
When I play on the Running on device on Xcode, the app works normally.
However, when I turn off the Xcode and turn on the built app, the black screen comes out and stops.
If I run it on the simulator to check the log, the following log occurs.
Could not find and/or execute program specified by service: 86: Bad CPU type in executable: /Users/develop/Library/Developer/CoreSimulator/Devices/31985C61-CACF-40D6-8A48-A2BA2BAF0DDD/data/Containers/Bundle/Application/EC20344C-A067-4379-A9EA-CE0E42F3C106/make.app/make
Service setup event to handle failure and will not launch until it fires.
Service exited with abnormal code: 78
But when I play on the Running on device on Xcode, I can't understand the app running normally.
I tried the Unity version 2018 to figure out the problem, but it works well. However, when I upgraded the Unity version to 2019, the above problem occurs.
I want to know the causes and solutions of these problems in Unity 2019.

On Xcode
Go to Unity-iPhone - Build Phases - Link Binary with Libraries build section
Add UnityFramework.framework
This happens on Unity 2019/2020

Related

React Native Expo Managed App doesn't launch/start on iOS simulator

I've been having hard times with my old Windows laptop while developing React Native apps so I moved to MacOS laptop. I installed Android Studio and Xcode (including Xcode command line tools). Then I initialized a blank expo managed project. I started both on Android Emulator and iOS simulator. Android one worked out with an ádb´ error (or maybe warning). But on the other hand, iOS simulator did nothing. There's no Expo Go app installed on iOS device, so it can not launch my app using it. I don't get any error or warning related to this problem, so I can't trace the problem.
I have tried deleting global expo folder located at ´~/.expo/´, I also tried to give 777 (all permissions) on that folder to my current user.
I tried uninstalling and reinstalling expo package globally.
I made sure I have selected Xcode command line tools on ´Xcode -> Preferences -> Locations -> Xcode 13.2.1 (13C100)´
I tried to launch different iOS devices like (iPhone 6, 8, 13, iPod etc.)
I tried clearing cache and starting expo with ´sudo npm start --clear-cache´
I have been trying to solve this for at least 2 hours tried everything possibly related to my problem but none of them did work. There's one thing I don't understand though. Even though I used different iOS device simulators the Expo Metro Bundler showed this ´› Opening exp://10.42.33.15:19000 on iPhone 8´ output. I have tried iPhone 13, iPhone 6, iPod etc. but this was the same output for different devices. Here's some screenshot related to probem:
https://www.youtube.com/watch?v=dvuZn6gX_Q4
This tutorial video on YouTube helped me solve my problems. I think I was missing a few things:
I haven't granted required privacy permissions on my Mac for Xcode, Android Studio and VS Code. Open System Preferences > Security & Privacy > Go Privacy Tab > Give Full Disk Access to Xcode, VS Code, Android Studio, Terminal and Watchman (Watchman is not required, but I have also installed it for solving a problem before)
You should to launch both your Android and iOS simulators before starting your expo application. Simply go to Android Studio and launch your device. To launch iOS device use bash and type open -a simulator.
If you don't have Expo Go app installed on your iOS simulator then you should first install it before starting your expo app. To install it use expo client:install:ios command.
Start your app by using expo start command. Type i and a or click on Run on iOS simulator and Run on Android device/emulator buttons to launch your app on devices.
NOTE: If you app gets stuck at New update available, downloading... stage then you can start your expo app with cleaned cache using expo start -c command. It was helpful for me.
NOTE 2: You may need to use sudo command on some of the commands I've mentioned, I'm not sure which ones are required or not.
I run into the same issue every time when I tried to set it up on a new laptop.
Its fixed after the installation of xCode cli.
Take a look at this - https://docs.expo.dev/workflow/ios-simulator/
I fixed similar issue by hard restarting simulator
Top menu -> Device -> Erase All Content And Settings...

iOS - Flutter audioplayers plugin error on xcode (Not found) on Release mode

When I test it on iOS Simulator on debug mode, it works fine but when I try to run on release mode on XCode it give me the following error:
Module 'audioplayers' not found
I use audioplayers 0.18.3
I remove the Pods and reinstall but not effect in release mode. Don't have problem with archive the app so is very strange. Need take screenshots of the app (in release mode, without debug banner) and I don't have a physical iOS device, so the only solution for me is take screenshots from iOS Simulator in release mode, but have this problem
Error Screenshot
PD: I'm running the .xcworkspace file.
PD2: I'm running flutter build ios and open xcode (.xcworkspace file), and run 'clean build folder' but the error persist
PD3: Sorry my bad english
Thanks since now!

Xcode 9.2 Simulator Debugging Broken; Could not attach to process id

Xcode 9.2 debugging on an iOS Simulator has completely broken for me.
I worked on this for hours and tried a ton of suggestions short of completely wiping my hard drive and starting out with a fresh operating system install. I ended up filing a bug with Apple. Posting here in case anyone has encountered this problem and has any suggestions.
Summary:
When try to build and run in debug mode with a debug executable. The simulator only opens the application to a white screen and then Xcode pops up an error:
Could not attach to pid: "<a process id>"
Ensure "<app>" is not already running, and "<user>" has permission to debug it.
Steps to Reproduce:
Make any project and try to run on any simulator.
Expected Results:
Debugger successfully attaches to debugger.
Actual Results:
Debugger is never able to attach to the iOS simulator process/app for debugging.
Debugger CAN attach and build and run successfully on a physical device.
Version/Build:
- Xcode Version 9.2 (9C40b)
- macOS Sierra 10.12.6
- Any iOS project
- Any iOS simulator
Other notes:
- Xcode 9.2 was working fine until this problem randomly started. The error initially said:
Failed to initiate service connection to simulator
DTServiceHubClient failed to bless service hub for
simulator iPhone 8 Plus <simulator identifier>
- After rebooting computer, the error shifted to "Could not attached to pid..."
I tried dozens of suggested solutions short of completely wiping my computer including:
Resetting device contents and settings on simulators
Create a new device (even different device and OS combinations)
Try different Xcode projects, even simple one-off single view applications
Looking at the etc/hosts file and verifying localhost can be pinged
Restarting computer multiple times
Deleting out derived data (multiple times)
Let it build and run without attaching debugger, then try to attach debugger by "attach to process id"
Completely uninstalling Xcode and all simulators, and reinstalling.
Removing any invalid certificates in keychain
It turns out our security software was blocking the debugger. Running sudo sysdiagnose helped me find a log entry showing that it was being blocked. The software is Cb Defense (Carbon Black Defense). Apparently the only workaround is for your security team to whitelist by a hash, and that hash could change in the future.
There is a bug in Xcode 9.0-9.2 that causes this issue to appear after running for a while. If you log out and back in it should resolve it for you.

visual studio 2017 cordova ios debug in local device failed

This is link of the same problem I raised in Visual Studio Developer support portal.
https://developercommunity.visualstudio.com/content/problem/61875/visual-studio-2017-cordova-ios-debug-on-local-devi.html
I am trying to debug cordova app in iPhone 5s local device connected to my laptop.
visual studio 2017 cordova 7.0.1 xcode 8.3.1 ios 10.2.1
After build it is failing at deployment.
build successful but failing to deploy to IOS device.
it is bringing up itunes and then shows the app there and device is identified but says error occured continue or not? and fails.
Earlier I deployed and several times debugged directly with local device.
one error result states, version mismatch other says device may not be connected and awake.
I am using ipod 9.3 version ios and another one iphone 5s with 10.2.1 ios.
I am building apache cordova app in visual studio 2017 with macincloud remotebuild.
how to resolve this!? any hint is a big help!!
I am manually deploying but can't debug. now,
i am getting network error at xmlhttprequest in device and but same code working fine in simulator.
when press device button then and i restart app then it is dumping a big error message and showing exitapp though i am not using any of that plugin or code line.
how to debug on device is first priority which may help to resolve rest.
1>Time Elapsed 00:05:02.04 2>------ Deploy started: Project: BlankCordovaApp2, Configuration: Debug iOS ------ 2>Found iTunes version: 12.3.2.35 2>Uninstalling app ID: COM.appanem.appanem. 2>Successfully installed .ipa file: C:\Users\Ekambarrao\documents\visual studio 2017\Projects\BlankCordovaApp2\BlankCordovaApp2\bin\iOS\Debug\appanem.ipa. 2>Starting idevicedebugserverproxy.exe at port 3000. 2>Cannot find the app installed on the device. Check that the device is connected, awake, and unlocked. 2>Starting ios_webkit_debug_proxy.exe at port 9221. 2>Deployment failed.
Is everybody happily working with this latest releases of Cordova IOS xcode vs 2017 or everybody facing the same problem as I am?
Issue is resolved, I am able to debug after I built my own VM of IOS and then debug but not sure what really resolved this.
What I can make out is,
unlike earlier, (not sure correct or wrong because this I could not do when I was using macincloud),
now the provisional profile need to be tagged to even device for debugging which was earlier sufficient to just list the device uuid in store certificates and profiles section.

MonoDevelop not hitting breakpoints when attached to iOS device

I've built my solution in MonoDevelop, then created an Xcode project in Unity with the following settings
I have then successfully deployed the app to the iPhone, stopped the Xcode project, reopened the app on the iPhone and then attached the MonoDevelop debugger
The problem is that when I set breakpoints, they show as unreachable and don't get hit at all.
Can anyone point me in the right direction with this? The stress of it is killing me..
Thanks
Spec:
Macbook Air Early 2015 - El Capitan 10.11.6
iPod Touch (MGG72BT/A) - iOS 9.3.1
MonoDevelop 5.9.6
Unity 5.3.4f1
I had the issue on Linux and I noticed that it started happening after I manually built the project in MonoDevelop, which gave me a bunch of build errors that were due to the fact that the version of .NET unity was targeting was 3.5 but the one came with MD was 4.5. So after I changed the target FW to 4.5 the build errors (in MD) cleared BUT the breakpoints stopped working.
What I did was I restarted both MD and Unity, Cleaned project in MD BUT DID NOT BUILD THEM IN MD. Just saved and switched to Unity which uses its own build. After that I switched back to MD and attached to Unity process WITHOUT BUILDING.
After this the breakpoints started working again. Conclusion - do not build the project in MD, just use it for editing scripts only and let Unity do the building.

Resources