bazelbuild / rules_apple

Bazel rules to build apps for Apple platforms.
Apache License 2.0
509 stars 264 forks source link

[iOS Device] Unable to install the app #750

Open zh-se opened 4 years ago

zh-se commented 4 years ago

Hi guys!

I'm new in bazel and trying to use it.

I have an app:

ios_application(
    name = "App",
    app_icons = glob([":SupportingFiles/Assets.xcassets/**"]),
    launch_storyboard = ":Resources/Storyboards/LaunchScreen.storyboard",
    minimum_os_version = "11.0",
    bundle_id = <some_valid_id>,
    infoplists = [":SupportingFiles/Info.plist"],
    entitlements = ":SupportingFiles/dev.entitlements",
    entitlements_validation = entitlements_validation_mode.error,
    provisioning_profile = ":SupportingFiles/dev.mobileprovision",
    families = [
        "iphone",
    ],
    deps = [
        ":AppLib",
    ],
    strings = glob([
        "**/*.strings",
        "**/*.stringdict",
    ]),
    visibility = ["//visibility:public"],
)

I'm able to run the app on simulator. But I cannot run it on a real device.

I do the following:

But if I manually resign the ipa file then it works well.

Seems like something wrong with singing in bazel. Maybe I do something wrong.

Do you have any ideas what's wrong?

Thanks in advance for the help.

bazel: 3.0.0 rules_apple: 0.19.0

zh-se commented 4 years ago

Any clue? Something? From where can I start digging to nail the issue?

keith commented 4 years ago

You should update your rules to HEAD. These repos no longer do releases but newer versions of bazel expect the newest rules.

If that doesn't work you should start debugging by diffing the output of codesign -dvvv THE_IPA before and after your manual resigning

tinder-maxwellelliott commented 4 years ago

I am having the same issue, I have a valid mobileprovision file and I am seeing this:

Use --sandbox_debug to see verbose messages from the sandbox
security: unable to open "Infra/TestHarness/embedded.mobileprovision" for reading: No such file or directory 
themuzzleflare commented 3 years ago

I just figured out the solution. The entitlements file needs the application-identifier key, with the string value being "Team ID.App Bundle ID"

mcarrillowz commented 2 years ago

I just figured out the solution. The entitlements file needs the application-identifier key, with the string value being "Team ID.App Bundle ID"

Did you set it manually in your entitlements file or is there a way Bazel can do that?

themuzzleflare commented 2 years ago

I just figured out the solution. The entitlements file needs the application-identifier key, with the string value being "Team ID.App Bundle ID"

Did you set it manually in your entitlements file or is there a way Bazel can do that?

Bazel can't do it automatically for some reason, and I'm actually quite surprised they haven't fixed that by now