App installation failed: Could not write to the de

2020-05-24 18:55发布

In Xcode 6.3, I got this error when trying to run an iOS project written in Swift on a real device.

App installation failed

could not write to the device.

I tried to clean the project and run again, but the same error occurs.

How can I fix this error?

30条回答
时光不老,我们不散
2楼-- · 2020-05-24 19:21

If you are using a free developer account you may need to uninstall some other apps you have signed.

查看更多
我只想做你的唯一
3楼-- · 2020-05-24 19:21

This error has many potential root causes, as can be seen by the large variety of suggested answers. The best approach to troubleshooting app installation issues like this one is usually to inspect the console of the iOS device itself, as that'll often provide much more specific error messages. In Xcode open the 'Devices and Simulators' window and take a peek at the logs of the device where your app is being installed.

In my case, the "Could not write to the device" error was being caused by this:

Feb 27 10:54:58 iPhone-7-110 installd(MobileSystemServices)[46] : 0x16f92f000 -[MIBundle _validateWithError:]: 38: Failed to load Info.plist from bundle at path /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.ebmR6U/extracted/SampleApp.app/Frameworks/SomeFramework.framework

Which clearly hints at what's actually going on. I had forgotten to set an Info.plist file for my dynamic framework target (used by the app).

查看更多
相关推荐>>
4楼-- · 2020-05-24 19:22

I turned off the device and turned it on again after which I did not get such error.

查看更多
甜甜的少女心
5楼-- · 2020-05-24 19:23

Check the device date, my device time was set to a future date so I was facing this issue.

查看更多
祖国的老花朵
6楼-- · 2020-05-24 19:23

Nothing helped me. I followed the below steps,

  1. Clean derived data folder
  2. Quit Xcode and disconnect device
  3. Restart Macbook
  4. Restart Device
  5. Open Xcode
  6. Clean and run the project

Finally I got it working!!

查看更多
ゆ 、 Hurt°
7楼-- · 2020-05-24 19:25

For me the following did not work on iOS 11 beta 10, XCode 9 beta 6:

  • Restart the device
  • Deleting the app from the device
  • No symlinks were in the project
  • There was plenty of storage available

Deleted Derived Data and voilá, it worked again

查看更多
登录 后发表回答