Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift Deploying to a Device Wrapping Up!

Etienne Sabatier
Etienne Sabatier
1,848 Points

App running on Simulator but "Could not inspect the application package." when trying to run it on my device

My app is renning successfully on the simulator but when I try running it on my device, it get an error after building (build successful) which says : "Could not inspect the application package."

I could not find the answer to this problem anywhere. Thanks for your help.

3 Answers

Enara L. Otaegi
Enara L. Otaegi
13,107 Points

You can try to clean the product by pressing Shift+Cmd+K. Also, here you have some more answers that may be useful. Hope that helps!

Etienne Sabatier
Etienne Sabatier
1,848 Points

Hi !

Thank you very much for your answer ! Unfortunatly I tried to clean, etc. I also read the page you mentionned but could not solve my problem with that. I even remade the whole app, code, etc. (very simple) and I get the exact same error.

Thank for your help again.

Etienne

Etienne Sabatier
Etienne Sabatier
1,848 Points

Below the solution I found.

When I first built the app on my iPhone I had the following error in the debugger :

dyld: Library not loaded: @rpath/libswiftCore.dylib

By looking at some forums, I thought I had to link the UIKit library framework etc. but that was wrong. So I undid that.

The issue comes from the certificates generated automatically by Xcode.

The solution is then :

  • Revoke certificates (
  • Got to developper.apple.com and follow instructions to generate new certificates
  • In Xcode in my project : go to Code Signing Identity and sign both Debug lines with the generated certificate
  • Both release lines are set to "iOS Developer"
  • Then project > clean
  • Build and run on Iphone

and it solves the issue. (The error message "Could not inspect the application package" does not appear anymore and the app runs well).

Enara L. Otaegi
Enara L. Otaegi
13,107 Points

I'm glad you found a solution, Thank you for sharing!