app won't run on device & meta - ios

I'm searched both here and at apple's devforums and followed all suggestions and am still stuck.
Basically, my app runs in the Simulator but won't run when switched to the device (an iPod touch). No errors - I get a 'finished running' message from Xcode.
The trick is that another of my apps does run on the device. Hmm.
Incidentally (this is the 'meta' part) this bug is very confusing. I haven't a clue where to look/what to read. It makes me think that there's a document somewhere that I've missed. Any ideas about solving these types of bugs in general?

Holy camoley I figured it out.
I switched the following entry in the plist:
Main storyboard file base name (iPhone)
to this:
Main storyboard file base name
That did it. I'm running on an iPod touch, but either way that seems like a bug as Xcode could just check that the plist entry matches the device being run on...

Related

How to Using Xcode, Appium to Test App on iPhone from MacBook

I have a question regarding the title above. I try surfing the internet for almost 2 weeks, but my issues were not solved.
I have an iPhone (iOS 15) and MacBook (macOS 13.6.1), want use XCode 13 to test the app. I got instructions from the Leapwork guy, to list how to do it. My colleague wants to test an app on iPhone, and she asks me to setup it up for her.
But I am facing a few errors which I don't know what are and how to solve because this is my first time playing it.
Here link to the document I manage success following the step from 1 to 8. I’m afraid to step 9 I did something wrong because it asked me to change a few things may I miss out.
iOS Instruction
The error that I have on XCode is
Building for iOS, but the linked and embedded framework 'RoutingHTTPServer.framework' was build for iOS + iOS Simulator
'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'
Double-quoted include "HTTPConnection.h" in framework header, expected angle-bracketed instead.
Could not build module 'RoutingHTTPServer'
I'm running Appium but not sure need to configure it or not.
I hope anyone knows about this or has been through a similar situation, please help and guide me on the correct path. I think I already lost. :(
Thanks.

Xcode Display Name and Danish Characters causes Xcode to fail

I'm developing an app with Swift + Spritekit with the project name as simple as "learningApp".
A good step and several hours into the development my team decided to name the app (with danish letters) "Lær Toner" (which in English means to learn tones).
However, when doing so - the entire project fails in Xcode. The .swift and .sks scene-files are not able to communicate and the console outputs this message:
2019-10-31 00:09:47.549357+0100 Lær Toner[18206:292858] Unable to load custom class 'LaunchScreen' from module '(null)'
Just to be clear, here's images:
So if I change the name to "Learn Tones" there are no issues at all and the app works as intended. As soon as I change it back to "Lær Toner" and run the app the console outputs the message above.
I tried to change it via "Build Settings" also - I also tried to reboot Xcode, clean the build folder, but nothing have helped so far.
I can see in the Danish App store that multiple applications have Danish letters like Æ, Ø and Å in the name, so that leads to think it's (hopefully) a minor thing I've missed.
I've searched the world wide web till the end, but I have not found anything close to a solution to this issue.
If anyone has any input, or knows how to deal with this, I'd be a happy developer.
Thanks in advance.
I found the same issue when i have changed the display name from the 'General' tab of my target settings.
The solution is;
Go back to the previous name by discarding the changes you have made, and make sure the app is running correctly.
Uninstall the app from your device or simulator.
Clean the project.
The important thing is to add a new key on your info.plist
<key>CFBundleDisplayName</key>
<string>Lær Toner</string>
And it will be ok.

Why Xcode shows "This app could not be installed at this time." pop-up?

When I run the project and add the app in simulator for the first time, everything is okay. But when I run it again, Xcode prompts this message as a pop-up window at the end of compilation:
This app could not be installed at this time.
I already checked the relevant question, and tried all the advised ways to solve this issue; checking mentioned logs, cleaning project, restarting simulator, changing it, erasing all content and settings in it. Nothing works. I must erase the app and recompile it every time to open the app. Did you get the same message before? Is there any way to detect problem and resolve it? Btw, I use Xcode 9.2 at High Sierra.
This error pop-up may come up for different reasons. There is no specific reason to see it for now. In my case, a JSON file that I added to Bundle in order to provide mock data triggered this issue. This file was containing a Turkish letter in one of the keys. After I fix it, the pop-up is gone. Interestingly, earlier simulators (<=9.1) work properly if JSON file contains Turkish letter but 9.2 simulators cannot tolerate it.
Worked for me when I rebuild the project after deleting the derived data folder.
I think I may have found a solution. This all started a short time after I let Xcode update my project settings. Specifically on my CocoaPod-Subproject. I removed the pods and reinstalled them and now I am no longer getting the pop-up.

Storyboard won't update in simulator

I have a working app in Xcode, however when I try to build and run it the simulator displays an older version of the storyboard I was working on. I had changed some of the design on the storyboard but this does not reflect in the simulator, nothing is updated.
Does anyone have any ideas?
Delete the App on the simulator.
Clean
List item
Build & Run
Use NSLog(#"") in your controller to check code execution.
I just spent at least 6 hours on this. I have a solution, but I also submitted a technical support ticket to apple to try to get more info on the cause and proper solution.
Simply remove the references to your storyboard files and add them back in the same file group.
This seems to include the storyboard files back into the app bundle generated during build(which can be seen in the
DerivedData/APPNAME/Build/Products/Debug-iphonesimultator/APPNAME.app
From here I can see my changes reflected from the storyboards as expected.
PS - Are you using localization at all? I was.
I lost 2 hours to this.
Solution was braindead simple: delete app, turn OFF the iPhone 5S (iOS 7.1.1), and turn it bavk on.
When you turn on localization,
xcode moves storyboard file in localization folder (ex. Base.lproj/name.storyboard). When you build and run project on simulator, xcode copy name.storyboard into "derivedData"/Base.lproj/name.storyboard, but previous, created before localization "derivedData"/name.storyboard still exists. In this case simulator uses the file which can be found easier, i.e simulator uses old file "derivedData"/name.storyboard to operate.
Solution: Just rename the storyboard file, in navigator and in targets/general.
This error happened to me for the first time when I had multiple copies of a project on my computer. For whatever reason, the fact that there were multiple copies were making it look as if the storyboard had not been updated between copies and in some cases the code was not updated. I thought I had forgotten to throw the right copy on my flash drive before going home, but it turned out it's an XCode error.
Delete any multiple copies using the same name, restart XCode and open your most recent copy. Extremely bizarre, but I will probably use BitBucket or GitHub from now on instead of throwing it on a flash drive.
Deleting
~/Library/Developer/Xcode/derivedData/
worked for me!
I just have the same problem after localizationMy solution is clicking Product, Clean build folder. Then it will be fine
The storyboard on the simulator was what it should have been. The storyboard on the device would not update. I had to delete the application from the iPhone and then re-run it on the device in order to get the Storyboard to update on the device. Fortunately for me it was only test data, but I was using Auto-Layout on one view and went back to manual. I think that's what caused the issue for me.
I find that removing and adding storyboard file back doesn't work in my case, also it has side effects like it will automatically add a main nib entry into App's plist file (which subsequently makes the App fails to launch in iPhone simulator).
I don't want to try to delete the application from the simulator since I have many files under the Document directory of the App.
At last I find another way that works well: simply delete the "/Users/$username/Library/Application Support/iPhone Simulator/7.1/Applications/$app/$yourapp.app" file. The files under Documents directory are untouched.
(I have localized my storyboard as well.)
I found this same thing happened with Xcode 6.1.1 if I happened to have copied a project; the new project run in the simulator was actually still reflecting the old, original project.
In my case the problem was with how the default area was set up for derived data (essentially the location where the binary files go for a build). Mine was set to legacy and the simulator was using the wrong project, even after a clean. The solution was to go to Preferences->Locations, press Advanced, and change the location from Legacy to Unique.
I get this too when using localized storyboards - Run in Xcode just refuses to install the latest version of the compiled storyboard. I think it is something to do with the way Run copies changed resources across to the device - it does it differently than other forms of on device app installation.
The quickest way to get past this without deleting the app and losing any data is to:
Generate an Archive build in Xcode
Export this for Adhoc deployment
Double-click on the generated IPA to add it to iTunes
From the device page in iTunes force an update to that app
In order for iTunes to see that you have a new version your app build number will need to be incremented (if you don't do that already), before generating the archive.
I find this method means you don't have to delete an app off the device, you're just forcing it to install the entire install package rather than a diff which is what I think Run is doing.
I'm not sure what causes this, if it is a localized resources bug or what, but this is still a problem in Xcode 7 for me.

Xcode 4.4 No such file found launching executable

Before anyone just assumes what I am saying here, please read what I have to say.
I have read the hundreds of posts on this topic and have tried pretty much all the suggested resolutions, in no particular order:
Quitting Xcode
Deleting the derived data folder
Cleaning the project
Hard resetting iPhone
Resetting Mac
Tried a second iPhone
Different USB port
All these in 'special' order
Checked code signing attributes
"Validate Settings" returns no problems
Validation returns no problems
I am stumped when it comes to this. The only thing I can think of is actually resetting my phone, but don't see how this could help when it doesn't work on the second phone either.
Are there any other suggestions, tips, ideas on what could be causing this rather annoying bug?
UPDATE: The exact error:
Error launching remote program: No such file or directory (/Users/Username/Library/Developer/Xcode/DerivedData/ProjectName-dnfacjtdklqktcazrpfyupofdryp/Build/Products/Debug-iphoneos/ProjectName.app/ProjectName).
To get the error, I do any combination of the listed steps above, then click Run on "My Device" (an iPhone 4). Application never installs to the phone and Xcode reports the application has finished running then shows the above error.
My problem was cause by me accidently changing the "Deployment Target" (ios version) to a version higher than what was on the phone I tried to run the code on.
Change the deployment target to below or equal to the ios software version on your phone.
(this answer wasn't on your list) :)

Resources