Xcode 9: How do I re-associate a project with a workspace? - project

I am working on a workspace that contains my project and my CocoaPods. I keep the whole thing on iCloud and work on it from my desktop and laptop. Everything has been working fine until recently when the workspace shows my project files on my desktop but not on my laptop. All of the pods appear on both devices.
Importantly, all of the project files are still there on my laptop and continue to sync perfectly with my desktop over iCloud:
I know this problem was caused by using iCloud for syncing. The question is how do I re-associate the project with the workspace on my laptop so I can continue to work on my app from both devices.

I figured it out. It seemed risky at first but it worked. I am posting the solution here in case someone else has the same dilemma. Back up everything before you attempt.
On the laptop, in the navigator pane, I clicked on '+' and selected
'add files to ...'. Then I selected my project file within the
project folder and added it. This added the project back to my
laptop, but I ended up with 2 copies of the project on my desktop
computer associated with one workspace.
On the desktop computer, I deleted one of the projects and sent it
to trash. Both copies of the project disappeared in the project
navigator.
On the desktop computer, I opened my trash and dragged the project
file back into the project folder. The project then showed up in
the navigation pane.
Everything is now working perfectly on both computers and I can continue to use iCloud to work on my app from either device.

Related

Xcode 8 iOS 10 archiving/uploading to TestFlight takes very long

Since I updated to XCode 8, it takes a long time archiving/uploading an app to TestFlight. While preparing archive (right after I press "Upload to Appstore"and select the appropriate Apple account), it starts Codesigning all the frameworks included in the project (I am using Cocoapods).
Any help would be highly appreciated as I am managing around 10 different accounts and it wastes a lot of time.
You can use this method to create ipa file,
right click your Archive and select show in finder
Again right click on resulted file in finder and select show package content
from result open product folder --> Application folder --> and select ".app" file
Simply add this .app file under apps of iTunes software on mac
After completing adding process right click on app icon in iTunes and show in finder which will give you iPA file.

Xcode's default projects folder missing

I'm quite new in iOS development and right now I'm watching tutorial videos. In them I see that every time a new project is created, Xcode suggests /home/Xcode as root destination where you can store your project. This folder has even a special icon with the Xcode logo on it.
On my Mac this folder is missing. I still can save the project elsewhere but even after re-installing Xcode that folder is missing.
Any idea how I can fix that?
The /home/Xcode folder is not the default location to store Xcode projects. The home folder is hidden by default on macOS so I suggest choosing a different folder to store your projects.
It does not matter where you save your Xcode projects. Save them wherever you want on your computer.

iPhone - Can not find my application

I have a super weird issue. I'm developing an iOS-app and just recently I noticed that I can not find my app on my iPhone. It shows up in the list when searching for the app and when I try to build my app on Xcode it fails because of my app's Core Data model is different from the one I'm building in Xcode. So I need do delete my app from my iPhone but it's hard when I can't find the actual app at all.
I've tried restarting my iPhone to no avail and I have also browsed every screen in the springboard to find my app but it is just not there.
Xcode 4.5 and iOS 6.0.1
On iOS 6, when you search for an app in Springboard (the launcher), it shows the name of the folder containing the app (if the app is in a folder). That might help you find it.
But if you've installed the app using Xcode, there's an easier way to delete it. Choose Window > Organizer from the menu bar, then click the Devices tab in the Organizer window. Find your device in the list of devices and click the “Applications” row under your device. The Organizer will show you a list of all the apps you have installed on the device using Xcode. You can click on an app in the list, then press the delete key on your keyboard, or click the Delete button at the bottom of the window, to remove the app from the device.

Could not launch iOS app

I don't know what has happened to my Xcode, but since I deleted my app from the device, and tried to rerun it on my iPhone, I get this message coming from the top of the screen:
No such file or directory (/Users/spazm/Library/Developer/Xcode/DerivedData/newProject-cfjhjgezzcapwoadaivpptyywptu/Build/Products/Debug-iphoneos/proj.app/proj)
In addition, where you can select the "active scheme" (iPhone / iPhone Simulator / iPad Simulator), I used to have "iOS device", and right after plugging my device in, I would get my phone's name and everything would go sweet.
Now, I only see "iOS device" (after plugging in), and I need to select my phone manually, which seems like something went wrong here. I am not sure what.
In the xcode organizer delete "derived data"
Alternatively you can open "~/Library/Developer/Xcode/DerivedData" folder and delete derived data folders associated with your application. You also should make a clean/build.
For the second problem, again in the organizer window under devices find your device and click "use for development"
Edit: Today I have experienced again, deleting derived data did not solved the error this time. After deleting data, making a clean build, deleting the app from my device, I needed to close & reopen xcode, which finally fixed the error.
The problem was in the project file itself. Used my backup to load the old project, then manually added all the files from the bad-new-project.
Must have been some setting.
Try checking the Deployment Target for the app. I was getting this same error when trying to deploy an app that required iOS 6.0 to a device that had 5.1 installed.

Cannot Install into iPhone Simulator

I've got an Xcode project that I've been working on over the past few weeks.
I just made some changes to an embedded framework that I'm working on (recompiled, to be specific) now, however, I am unable to launch the application in the simulator.
The app hangs on "Attaching to [app name]," if I have a debugger on. If I don't have a debugger on, Xcode just says the app has finished running.
There is no icon installed on the device.
Here's what I've done so far:
Restarted
Reset simulator
Clean and build
Deleted derrived data
I cannot install onto a device either, but then I get an error:
Error launching remote program: No such file or directory (/Users/peter/Library/Developer/Xcode/DerivedData/x-gtwuuwmavjonyrcxjmpcletdpyjw/Build/Products/Debug-iphoneos/x.app/x).
Oddly enough, what worked was installing another app in the sim (just launched another project and ran it) and then launching the other app in the sim.
I'm not sure what the issue was, but I tried it on two computers and it was hanging on each, so it was related to the project rather than the simulator. There's an issue to think about...