简体   繁体   中英

Xcode Build Succeeded but not run on iPhone/Simulator

I am facing a little strange problem with Xcode, that is when I run my app is Xcode shows Succeeded but my app does not run automatically on iPhone or Simulator. I have to manually click on app icon then it runs. I have already tried all the solutions I could find. I have tried the following points:

  1. Adding in armv6
  2. Restarting xcode
  3. Restarting device/simulator
  4. Removing device from the organizer then adding it back.
  5. Restarting Mac Book Pro.
  6. Cleaning project and rebuilding
  7. Check plist
  8. Check target
  9. Check product>edit scheme > select run option (and info tab) ==> all is fine there

Please note I am using these frameworks via pods name are:

pod 'IQKeyboardManager'
pod 'GooglePlacePicker'
pod 'Firebase/Messaging'
pod 'Google'
pod 'Google/SignIn'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'

The app does not run automatically even after Xcode show Build succeeded on simulator/iPhone.

I had a very similar problem after adding Cocoapods to my project. I was also using the Swifter framework at the same time and somehow the new .xcworkspace had the wrong scheme selected.

Similar to how Ravi fixed his issue. I changed the scheme under Product > Scheme > Choose Scheme (Keyboard shortcut ^0 ) back to the original Scheme (basically the name of my project) and everything worked again.

There is one more possible problem that I can think of and that is, you're using a developer account on this project that is not trusted/verified on your iphone. After running your app for once on this device. Go to Settings > General > Device Management. Then select the developer account that you have used to build this app and finally tap "trust".

Did you set the initial view controller? step one. select the view controller you want to show. step two. select the attributes inspector. step three. check the is initial view controller.

I had a similar issue. The build would succeed but then XCode would show an alert "Unable to connect to XYZ's iPhone" (even though the phone was connected and unlocked and showing up as a valid build target). After checking Xcode -> Window -> Devices and Simulators the panel that appeared warned me there was an incompatibility between my iPhone model + iOS version and XCode. To fix the issue, I had to uninstall XCode and reinstall the version that it expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM