Xcode8 doesn't launch the last version of the app in device - ios

Since updated to Xcode 8 when I launch my app in the device (iPhone or iPad both with iOS 10), it launches a version not updated of the app.
But if I launch the app in the simulator, it launches the updated app...
Things that i tried: Clean the project, clean the build folder, uninstall the apps in the devices, reboot Xcode...
Any idea with this? It will go crazy!

Sadly I don't have time to know what it is happening here, so I created a new project and moved all the files from the older project. Now it is working.
I know it isn't the best solution but i can't spend more hours into this.
Thanks all for the responses!

Related

Xcode - Can't run app on simulators, or on phone

I was trying to run my project on Xcode, but I found that when I hit Command-R, Xcode would say the app had built, and was running, but after 3 minutes, it still hadn't appeared on the simulator. I ran it again, and it did the same thing, so I force-quit Xcode, and reloaded it. When I had reloaded Xcode, all the simulators had disappeared, and when I try to run the app on my phone, Xcode starts building, and then just stalls when processing one of the XIB files.
I have tried going to Windows->Devices to reinstall a simulator, but Xcode just freezes when I do this.
It seems I have royally screwed my developer environment by force-quitting while it was building. How can I fix this?
All help app-reciated.
Try to exit the simulator.
If this doesn't work try to restart the computer.
if none of them work you are screwed and should reinstall xcode
I fixes this by downloading the Xcode 7.2 beta. If you're viewing this question at a later date, download the newest beta of Xcode (or if you're using the beta, download the standard code). This version of Xcode is completely separate to the standard Xcode, allowing everything to run on normal settings.
First try and restart Xcode, then your computer. If this does not work, reinstall the newest version of Xcode from https://developer.apple.com/xcode/

Invalid Device State - Xcode/iOS Simulator error

Problem: I cannot simulate an Apple watch interface. Whenever I try and test my Apple watch app on the iPhone 6 simulator, Xcode successfully finishes and builds the app, attempts at opening simulator and fails with an error message which reads 'Invalid Device State'.
I believe simulator has a watch simulator that opens along with the compatible iPhone simulator models that can communicate with Apple watch (example: iPhone 6) Although I have yet to see it work. I have built a universal interface for iPad and iPhone and another for the watch, so it's not a matter of the app being for the wrong device. Whenever I test on my actual iPhone I can test the universal interface successfully.
I'm using Xcode 6.2 on iMac OS X 10.10.3
I have tried restarting Xcode/Computer. I can't seem to find any other mention of 'Invalid Device State' anywhere, hopefully due to it being an obvious thing to avoid/fix that I've overlooked. Any help would be appreciated.
Force Quit xCode and restart will resolve problem.
I had come across this issue after updating Xcode 6.4 to 7.1.
Below are fixes for this :
Clean project (cmd+shift+k) as well as clean build folder
(cmd+shift+k+option)
Quit simulator and run again
Quit Xcode and Simulator and run again
Restart your Mac.
Solution 3 worked for me!
I had the same issue. Generally it is because you just update Xcode or change its name in the Applications folder.
If you just restart your computer it will work correctly.
Hope it helps !
I observed this happening when more than one Xcode app installed.
To fix this,
Launch Xcode and click preference..,
Go to "Location" Tab, Select correct options from "Command Line Tools" dropdown
Quit Xcode and relaunch it.
Run your app.
First of all, just clean the project.
Quit your project.
Quit your Xcode.
Restart Xcode.
This happens to me when I have two different Xcode versions running at the same time. Hopefully this helps you.
No need to quit, restart or even re-install. Switch to another iOS Simulator device (6s if you were using 6s plus) and voila!
Nothing worked for me on XCode 7.3.1.
Had to reinstall it to make the simulator work.
Go to applications folder. Drag drop XCode to Dustbin.
Empty dustbin contents.
Go to App Store and install XCode.
Run XCode. The simulator should work now.
I have Xcode 7.3 and Xcode 8.0 Installed.
If a am working with Xcode7.3 and opens Xcode8.0 to get some code from Xcode8.0 project.
When i run my application on Xcode7.3 So it will give me same error.
Solution is simple ForceQuit or Quit all Xcode's and open the required one.
In my case, the simulator would show an indefinite black screen whether attempting to run a project, or running the simulator directly (which should bring you to the simulated home screen). This would happen even on a newly created simulated device.
After the existing suggestions failed, the following worked for me:
Delete the Simulator
Delete XCode
Delete the Developer folder
Reinstall XCode from the app store. This requires attempting to run XCode again so that Mac OS will realize it's no longer installed.
Jus clean the project and restart Xcode. This happens to me when I have two diffent xcode versions running at the same time.
Robust fix is Just Quit your xcode and run again, hope so it will help you. This heck work for me.
On M1 Mac I've found more than 3 open simulators can cause this error. Quit the simulator app to fix this error.
I am pretty sure that in my case the simulator was corrupt after a failed language change.
Following this answer to reset the simulator worked.

Xcode 6 doesnt build to device but says its running

I installed xcode 6 and was working on my app on simulator.
Now i have added push support it was time to start working on the device.
The problem is i cant get it to work. The device sits there and does nothing. Xcode says the app is running on the device but nothing happens.
When i click on "Running app on device" i can see its in the status of
"Validating Application "
The whole time...
I tried the solutions on SO but they are all for xcode 4 and some points about architechture and info.plist.
Checked both nothing wrong with it (testing on 5s, 7.1).
Tested other apps (got from github and so on), same problem cant run on device.
I think it has to do with xcode because all projects (big and small,old and new) don't work. I also tried on my ipad same problem.
So its not related to project or device.
Anyone has a solution ?
Removed xcode and installed it again. Works.
But to be honest since Xcode 4 this is the worst Xcode, allot of hangs and crashes. Need to force quit at least 6 times a day.

iPhone Simulator is running the wrong code

I cannot get the iPhone Simulator to run the current code. Instead it runs an old build. Does anyone know why?
The simulation starts and stops as usual, but somehow Xcode and Simulator have lost their connection. The Simulator ignores any changes in the code and Xcode ignores any breakpoints.
I have:
Deleted the app in the Simulator.
Reset content and settings in the Simulator.
Cleaned the project in Xcode.
Removed the project from Organizer.
Restarted Xcode and computer.
System info:
Xcode 6.0.1
iOS Simulator 8.0
OS X 10.10
If someone can tell me why this is happening I would be very thankful!
By the way, I can run the code on a device without problems.
Try to reset content and settings of the simulator. Like on the image:
Clean and rebuild the project also may help.
When I upgraded to Xcode 6.1 AND downloaded a new iOS 7.1 Simulator (available at Xcode/Preferences/Downloads) then it just started to work again. So, to upgrade or simply reinstall Xcode seems to solve this problem.
EDIT:
I recently got the same problem again, and I fixed it this time by going to Project Navigator/Targets/Build Settings/Build Locations. Changed the text of Build Products Path to something random, and changed it back again.
Sometimes, if you move your project folder around, it seems that Xcode loses track of its build folder. By doing this Xcode restore its build-path. So try this method first.

An Unknown Error occurred in Xcode

I'm trying to test out my app on my ipad and when I decide to run it on my ipad, Xcode says that it's successfully built. On the top, it says that it's runnning the app, but nothing happens for 2-3 minutes. Finally, I get two screens popping up saying "An unknown error occurred." I have tried running other apps through Xcode on my ipad and they work fine. I also decided to exit Xcode and restart everything, but the problem still exists. Does anyone know what the problem is?
Not sure if this will be useful but
Xcode Version: 5.1.1
Ipad Version: 7.0.4
Mac OS X 10.9
I found one approach:
Before this approach make sure that you have all certificates and other documentation updated.
I have faced same issue, now I have a way to fix this. I am using iPhone 5 with OS version 9.1
First, delete the app from your device and then restart the xcode by force quit and then again open it. Now clean your project and run the project in your device. Now it will be run without any issue.
Close your simulator or unplug and plug back in your device, and re-select the device target.
In my case . I cleaned the product and rebuild it and it worked.
Sometime is you forget to unlock your device.

Resources