Cheng Lin
Cheng Lin

Reputation: 143

Cant run app on simulator "The operation couldn’t be completed. (LaunchServicesError error 0.)"

I have an app on Xcode that was running just fine earlier. but all of the sudden it has stopped working when I try to run it. There was no code changed, and I don't know what happened. The error message is:

"The operation couldn’t be completed. (LaunchServicesError error 0.)"

When I look into the CoreSimulator log file I get this:

Jan 8 11:43:55 C02PG69EG3QD com.apple.dt.Xcode[7083] : Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed. (LaunchServicesError error 0.)" UserInfo=0x7fc597a59240 {Error=PackageExtractionFailed, ErrorDescription=Failed to copy file:///Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-eyozcttdojgdpgdstfspqjxsztrb/Build/Products/Debug-iphonesimulator/myApp.app/ to file:///Users/myUsername/Library/Developer/CoreSimulator/Devices/DAC0E72A-6F6A-42EA-A8CA-5F41E22F2CCC/data/Library/Caches/com.apple.mobile.installd.staging/temp.qtgx1Q/extracted/myApp.app/}

Basically it says that Xcode can't copy the file from one place to other. So I thought it might be a permissions issue. I did chmod with 777 to both folders, but that didn't work.

I also tried 'Reset content and setting' for simulator, it gave me permission error to remove certain files, so i did it manually. and this method didnt work either.

I have tried:

None of the above worked for me.

Note: one thing that was working, was if I run it through my iPhone via USB connection.

I guess to solve this problem, I will need to figure out the way for Xcode to be able to copy file to its destination. Does anyone have any clue for this?

Upvotes: 2

Views: 10412

Answers (6)

Jake
Jake

Reputation: 113

Usually stuff like that just requires you to delete DerivedData which is what I just had to do to fix it. I just use the following script in Automator:

do shell script "rm -frd '$(getconf DARWIN_USER_CACHE_DIR).org.llvm.clang/ModuleCache'"

do shell script "rm -frd ~/Library/Developer/Xcode/DerivedData/*"

do shell script "rm -frd ~/Library/Caches/com.apple.dt.Xcode/*"

Upvotes: 0

WasimSafdar
WasimSafdar

Reputation: 1132

I just deleted my "DerivedData" in Xcode for my application and everything starts working file. In finder Go-->GotoFolder-->"/Users/myUsername/Library/Developer/Xcode/DerivedData". Delete your app folder and run again.

Upvotes: 1

BatyrCan
BatyrCan

Reputation: 6983

just rename bundleIdentifier-->com.sample.myTest to anything like -->com.sample.myTests. It works on Xcode 8.2

Upvotes: 0

amisha.beladiya
amisha.beladiya

Reputation: 363

Just force quit the Simulator and restart again.Then run the source code.

Upvotes: 3

AnneTheAgile
AnneTheAgile

Reputation: 10250

I got this today. I have not changed anything, but I was opening a branch that was used by a user who had upgraded Xcode to 7.3, Monday's new version. Closing the simulator app fixed it for me.

Upvotes: 0

Nik Bhatt
Nik Bhatt

Reputation: 373

I ran into this today. I had just changed the bundle identifier on my app, which invalidated the app id and the provisioning profiles. As a result, the app couldn't installed (with that alert). Once I made new app id's and profiles, things worked fine.

Upvotes: 3

Related Questions