I had a project initially created in XCode 3 and used it successfully in XCode 4 Developer Preview version.
After upgrading to XCode 4 release, any time I try to run the project on the device, I get a "Argument Invalid" dialog. Except it doesn't tell me what argument.
How does one figure out what is wrong and why I can't run the app on my device any more?
Base SDK is set to 4.3
Deployment target set to: iOS 4.2
Ok, I have just managed to sort this out as I was having the same issue. This may not help you, but for me it was because I had a symlink inside a folder included in the project. I've removed this, and now it all works fine. Interestingly it works fine on the simulator in this case.
I've filed a bug with Apple on the issue (#9168893).
Just clean your producto
Menu>Product>Clean (Shift+Cmd+K)
I got the following message argument is invalid in response to some kind of USB weirdness. Sometimes it goes away if I unplug and replug the device, but what turns out to fix it more reliably is to start up iTunes. Usually, when I do this, the problematic device doesn't appear in the DEVICES list at first, but does after a few seconds, and once it does, the device and Xcode get along fine.
Related
Yesterday i was testing my app in the iOS simulator and everything was working fine. I then decided to run the app on my iPhone and i got the error unable to install application, Unknown error occurred this has happened before so I cleaned my build folder (as this has fixed this issue before) however, the same error occurred. I then ran the app in the iOS simulator again and now i get the error Unable to run app in Simulator, An error was encountered while running (Domain = LaunchServicesError, Code = 0). I find this very weird as i didn't change anything besides trying to run the app on my iPhone. I have tried every solution given on this post and still no luck.
I'm sorry if my question doesn't contain much detail but as I said I didn't change anything and it was building and running fine a minute before plugging in my iPhone and trying to run it on there.
Any help would be much appreciated.
edit
I tried running other projects (with and without extensions) and they are working on both simulator and iPhone, therefore the problem must be within my project. (my project does have a today extension)
In that kind of cases I usually :
Product > Clean
Close xCode
Delete the Derived Data (in ~/Library/Developer/Xcode/DerivedData subfolders)
Delete the app on the iPhone
Reboot the iPhone
Restart and rebuild
I had this problem. In my case, it was caused by the Build value being blank. After putting a value there, and resetting the simulator once more, the issue went away.
I had the same problem and checking the system log carefully helped me to identify a coliding library that was causing this error. You can also check this answer if you are using extensions.
Generally it means there is a problem with the build, it may be due to old cache (solved by a clean build) or a project definition error (missing library, bad definition in info.plist, etc).
In my case it happened only on iOS 8, turns out that my widget had the wrong bundle ID.
I'm trying to debug an application on my iphone. I was able to do it before I updated Facebook client library yesterday. After updating, something weird happened and now I got the "Xcode cannot run using the selected device" error.
Error can be seen from the screenshot. Note that in the upper middle it says "Finished running FacebookSDK on baysungur's iPhone", which is weird because my app's name is different.
I tried some things like adding architectures to build settings, decreasing minimum deployment target, etc. They did not work.
Anyone has any idea?
I'm using Mountain Lion and Xcode 4.4.1. I'm trying to connect to a iphone 4.
Note: I was able to connect to device before updating that facebook client.
edit: Well, a similar thing also happens for simulator. Now I basically can not debug my app in any way.
Facebook library had a file named Info.plist, which caused xcode's head to be confused.
Weird thing is that I was seeing correct settings in project's settings. I mean everything seemed correct in that UI but appearantly xcode was using wrong Info.plist in action.
Deleting that second Info.plist solved the issue.
Is device is connected in organizer? If yes then quit your xcode and also restart your device and choose valid provisioning profile and try again.
thanks
I have an app published in the store, which i want to change so much its internal working, that i decided to start over. I successfully finished the new version of my app, but when i install the previous version of the app, and run the new version from xcode to check if everything is compatible, i get "Could not change executable permissions on the application".
What i did was to change the bundle identifier of the new version of the app to match the old one, but i cant get it to run under the same name. Do I need to do something else? The app runs great if the old one isn't installed, but when I have the old one installed, and I want to run the new one, so it replaces the old one, i get the error i mentioned above.
Thanks
The problem I had was related with the use of unreleased iOS beta software. It is solved by testing my apps on a device running the last released OS (iOS 5.1.1 at the moment).
i think you should try to remove the app that have same bundle identifier in you iOS device ,
hope this can help you!
I just had this same issue which almost caused me a meltdown. I'm on xcode 5.1 and ios 6. My answer was to delete the app on my iPad by holding my figure over the app icon, then pressing the 'x' that appears next to it. Then I went back into xcode and built the project.
This problem is pretty ridiculous and I'm running out of ideas of what to try:
I have been successfully using Xcode to debug my game on my iOS device (iPhone) for the past couple of weeks, but now all it will do when I try to do a run with my iPhone set as target is successfully build the application and then Stop immediately. No Errors, nothing in console logs. The application doesn't even copy over to my device.
Xcode says: Building, Running, Finished Running....all within 2 seconds...
I'm using Xcode 4
iOS 4.3
I've tried the following:
Rebooting mac
Deleting application from iPhone and
rebooting iPhone (although my power
button no longer works on my iPhone,
so I had to run down the entire
battery to try this)
Cleaned project and rebuilt
Nothing seems to help.
The game compiles and runs successfully on the iOS Simulator within Xcode as well, and as I've said I've been able to copy my game over prior to yesterday, but for some reason it just stopped working...
UPDATE: Solved by setting the "accelerometer" from "NO" to "YES" in Info.plist.
I know you found your answer but I found a similar case when starting a project from XCode 4, the app plist contains a required device capabilities "armv7".
So even after adding armv6 to the build settings, the program didn't run on a 3G.
I deleted the required device capabilities "armv7" and it works.
Solved by setting the "accelerometer" from "NO" to "YES" in Info.plist.
If it helps anyone, the problem for me was a blank value in my plist under "Required Device Capabilities." Deleting the blank value fixed the issue.
My problem was "gps" value in plist under "Required Device Capabilities."
Deleting it fixed the issue for iPad2.
Today, after installing Xcode 4 with the 4.3 SDK, I attempted to launch my application. However, the application will build and the iOS Simulator will pop up, but I get a message in the window in Xcode that says "Attaching to YourApp" which stays there indefinitely. How can this problem be fixed?
I had the same problem, that is, when I launched my application in the simulator, Xcode was hung waiting for the simulator to start. The simulator showed a black screen - nothing at all.
Note this is a project that ran fine on Xcode 3 and is the exact set of files used to build the application that is currently for sale at the App Store.
Okay, so here's the underlying problem, and my solution:
My application name was "ultimateTimer.app", as seen in Xcode under the Products folder. However, this was NOT the name in the project file.
Here's how to found out:
Click on your project in Xcode (it's usually at the top, e.g. mine is called ultimateTimer.xcodeproj). Under "Build Settings" tab, look for the "Packaging" area and specifically for the "Product Name" variable. Under Product Name, I had three entries:
Debug
Distribution
Release
Under Debug, it had the value "TalkUltimateTimer" which was an old name of mine. When I changed this to "ultimateTimer" to match the "ultimateTimer.app" as above, I found the Xcode attached to the simulator correctly.
This happened for me for iPhone applications. I opened the simulator myself and switched the device to iPhone Retina Display and from then on it worked. I tried switching back, but it didn't work again, so I have had to keep it on the Retina Display simulator, and if I need to test non-Retina Display I'll use the iPad simulator.
I skimmed the post and these seem to be the two solutions thus far:
I think I figured out the problem:
I went to 'Edit Schemes', and for some reason, the scheme I was using was pointing at BumpDev.app as the executable instead of bumpdev.app. Changing this made things work. Perhaps there is an issue when converting from xc3 proj files?
Anyways, the app now boots in the simulator. Yay!
And the other solution in that post is:
Did your project by any chance have a folder reference with images in it?
For me the problem only happens when I have a folder reference in the project. When I remove the folder reference and instead add the folder as a group, clean the project, and hit launch things work fine. In the "Copy to Bundle" phase each image is then listed individually, whereas when I had a folder reference, the whole folder was listed.
This took me a really long time to figure out. It was quite frustrating, but I'm glad I have a workaround until the bug is fixed.
I had the same problem after swapping the mouse for a new one. restarting my iMac resolved the issue.
I just upgraded to Xcode 4.3.2 and had the same issue with new projects. After poking around and comparing projects, I found out that new projects were set to the LLDB dbugger and the projects that worked were using GDB.
After changing the debugger for the new project to GDB, it worked. I am yet to research what the differences are, but at least I can now run my new projects.
Ensure you are starting a proper scheme.
I. e. when using CocoaPods, running Pods scheme would not start emulator.
It's a known issue. Have a look at this thread in the official forum.
Hey, update Xcode to 4.0.2. Problem solved :)
I had the same problem, I tried every solution here, but no works. Finally, after I rebooted my computer, the problem was gone.
Restarting the simulator worked for me