LoginSignup
41
29

More than 5 years have passed since last update.

xcodeでアプリを実機で動かそうとすると"iPhone has denied the launch request."になってしまう原因をまとめる[2019.03.12~2019.03.20]

Last updated at Posted at 2019-03-15

Errorの内容

iPhone has denied the launch request.

Internal launch error: process launch failed: failed to get the task for process XXXX

回避策

自分の場合は、2019.03.20に解決しました。解決方法を書きます。ただし、必ずしもこの方法で解決できるとは限りませんので注意。

  1. ターゲット設定の[全般]タブで、Automatically manage signingオプションのチェックを外します。

  2. Xcodeを閉じます(プロジェクトだけでなく、完全に)。

  3. ~/Library/MobileDevice/Provisioning Profiles/*.mobileprovisionファイルを消去します

$ rm -rf ~/Library/MobileDevice/Provisioning Profiles/*
  1. キーチェーンアクセスで、以下を削除します。
$ open -a Keychain\ Access
  • iPhone Developer: xxx@xxx.xxx (xxxxxxxxx)

  • Developer ID Certification Authority

  • Apple Worldwide Developer Relations Certification Authority

  1. iOSデバイスからアプリを削除します

  2. MacとiOSデバイスを再起動します

  3. Xcodeをもう一度開きます

  4. Bundle Identifierを変更します。

  5. Automatically manage signingオプションを確認してください。以前選択していたアカウントを使います。

  6. USBを使ってiPhone/iPadを接続します。

  7. あなたのiOSデバイスで設定アプリ > 一般 > プロファイル(とデバイス管理)からデベロッパAPPを信頼します。

  8. Runを実行し、Debug > Simulate Background Fetchなどが実行できる状態か確認します。実行できる状態なら正常にDebugが機能すると思います。

参考 : https://stackoverflow.com/a/55244603/4700495

概要

私は、Apple Developer(Free)をApple IDから使い、開発アプリを実機(iPhone)で動かしています。

ここで、2019.03.12あたりからSigning > Automatically manage signing > Team > Accountに問題が発生するようになりました。現時点で回避策はありません。

検索すると様々なキーワードがヒットしますが、主に、Provisioning profile, entitlements, get-task-allow, Keychainあたりの問題かと思われます。新しい情報があれば追記して、通知します。

追記情報

Citation from the forum: "It seems like the reason causing this problem is the 'get-task-allow' flag of .mobileprovision file, which suppose to be set to true, but now is set to false instead. This 'false' flag causes Xcode losing the privilege to attach the target with debugger."

どうやら原因は、.mobileprovisionで'get-task-allow'にfalseが設定されていることのようです。無料アカウントでは、この値を変更することができないと書かれています。

Link

チャットルーム "iPhone has denied the launch request."問題のチャットルーム

Apple Developer Forums Provisioning profile doesn't include the application-identifier and keychain-access-groups entitlements

Apple Developer Forums Xcode 10: iPhone has denied the launch request.

stackoverflow Provisioning profile doesn't include the application-identifier and keychain-access-groups entitlements

Xcode Statusにエラーがついてしまいました。

iPhone has denied the launch request issue

iOSアプリが実機で動かない(動くものもある)

証明書の問題や認証の問題は一応、回避できますが、現時点ではDebugが正常に行えない状態です。完全な回避策はありません。

やったこと

  • Profileを削除して、もう一度登録し、iOS Developerを追加する。

  • Product > Scheme > Edit Scheme > 'Info' tab > Executable: "Ask on Launch" (Runは成功するが、これでは実機でアプリが正常に動作しない場合があります、特にDebug > Background Fetch)

  • Product > Scheme > Edit Scheme > 'Info' tab > Debug executable, チェックを外す (Runは成功するが、これでは実機でアプリが正常に動作しない場合があります、特にDebug > Background Fetch)

  • Build Settings > Signing > Code Signing Identity > iOS Developer を選択する

  • Releasesの項目を削除する

  • キーチェーンからApple Developer Certificateを削除する

  • ~/Library/MobileDevice/Provisioning Profiles~/Library/Developer/Xcode/DerivedDataにあるファイルを削除する

  • 新しいユーザーを作って、xcodeから実行する

  • xcodeをアップデートする

なにか情報がありましたら、コメントの方お願いします。

41
29
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
41
29