Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for Mac App Store submission #903

Closed
wants to merge 5 commits into from
Closed

Prepare for Mac App Store submission #903

wants to merge 5 commits into from

Conversation

samuelmeuli
Copy link

Hi @sindresorhus,

This PR should fix the issues you encountered when submitting the app to the Mac App Store (#88).

The reason the app crashed on launch is the following bug in Electron related to instance locks: electron/electron#15958. I've therefore disabled the instance lock for the MAS build.

I also added some missing configuration for electron-builder to the package.json file. The signed app now works as expected for me.

@sindresorhus
Copy link
Owner

After building this, I tried opening the mas app and got the crash like before:

Process:               Caprine [17537]
Path:                  /private/var/folders/*/Caprine.app/Contents/MacOS/Caprine
Identifier:            com.sindresorhus.caprine
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Caprine [17537]
User ID:               501

Date/Time:             2019-05-25 20:39:59.034 +0700
OS Version:            Mac OS X 10.14.5 (18F132)
Report Version:        12
Anonymous UUID:        E1F234A7-B61B-954B-2FF5-D9E0D1A6E14C

Sleep/Wake UUID:       9CCCD8B6-B259-40B4-8197-1112BB5B3878

Time Awake Since Boot: 280000 seconds
Time Since Wake:       1300 seconds

System Integrity Protection: enabled

Notes:                 Translocated Process

Crashed Thread:        0

Exception Type:        EXC_CRASH (Code Signature Invalid)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace CODESIGNING, Code 0x1

kernel messages:

VM Regions Near 0 (cr2):
--> 
    __TEXT                 000000010711d000-0000000107146000 [  164K] r-x/rwx SM=COW  

Thread 0 Crashed:
0                                 	0x00000001107eb000 _dyld_start + 0

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000000  rcx: 0x0000000000000000  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x0000000000000000  rbp: 0x0000000000000000  rsp: 0x00007ffee8ae2a98
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000000000000  r11: 0x0000000000000000
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x0000000000000000
  rip: 0x00000001107eb000  rfl: 0x0000000000000200  cr2: 0x0000000000000000
  
Logical CPU:     0
Error Code:      0x00000000
Trap Number:     0


Binary Images:
       0x10711d000 -        0x107145ff7 + (0) <3788637B-0A53-3737-B3B6-C827ABF3E314> 
       0x1107ea000 -        0x1108546ef + (655.1.1) <CE635DB2-D47E-3C05-A0A3-6BD982E7E750> 

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 3970532
    thread_create: 0
    thread_set_state: 3198

VM Region Summary:
ReadOnly portion of Libraries: Total=776K resident=0K(0%) swapped_out_or_unallocated=776K(100%)
Writable regions: Total=8404K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=8404K(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
STACK GUARD                       56.0M        1 
Stack                             8192K        1 
__DATA                             244K        4 
__LINKEDIT                         184K        2 
__TEXT                             592K        2 
shared memory                        8K        2 
===========                     =======  ======= 
TOTAL                             65.0M       12 

Model: MacBookPro11,3, BootROM 153.0.0.0.0, 4 processors, Intel Core i7, 2.3 GHz, 16 GB, SMC 2.19f12
Graphics: kHW_IntelIrisProItem, Intel Iris Pro, spdisplays_builtin
Graphics: kHW_NVidiaGeForceGTX750MItem, NVIDIA GeForce GT 750M, spdisplays_pcie_device, 2 GB
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x134), Broadcom BCM43xx 1.0 (7.77.61.2 AirPortDriverBrcmNIC-1305.8)
Bluetooth: Version 6.0.12f1, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0512F, 500.28 GB
USB Device: USB 3.0 Bus
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 17.1

@samuelmeuli
Copy link
Author

This is actually the expected behavior. When you sign your MAS app for production, you won't be able to open it locally.

You can test the MAS build by using a development provisioning profile and setting "type": "development" in the MAS configuration of electron-builder. I've written about this in a blog post a while back.

@sindresorhus
Copy link
Owner

Ah ok. Makes sense.

I tried uploading it to the App Store using Application Loader, but got an error:

ERROR ITMS-90287: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'com.apple.developer.team-identifier' in 'com.sindresorhus.caprine.pkg/Payload/Caprine.app/Contents/MacOS/Caprine'."

@samuelmeuli
Copy link
Author

Do you have a provisioning profile for distribution in the MAS in the project root?

@sindresorhus
Copy link
Owner

No, I have it in my keychain.

@samuelmeuli
Copy link
Author

I'm not sure if that's supported. From the electron-osx-sign GitHub page:

For distribution in the Mac App Store: Have the provisioning profile for distribution placed in the current working directory and the signing identity installed in the default keychain.

@sindresorhus
Copy link
Owner

That did it.

I submitted it to the App Store and it got rejected for:

Your app or its metadata appears to contain misleading content.
Specifically, your app includes content that resembles Facebook logo.

Do you know a way to use an alternative icon for the MAS target?

Here's the icon I'm gonna use:

Icon-mas

@samuelmeuli
Copy link
Author

Looks like you can have different icons per platform, but not only for the MAS build: https://www.electron.build/icons.html

@sindresorhus
Copy link
Owner

@samuelmeuli electron-builder has some hooks though, where you could do some custom logic to replace the icon.

@samuelmeuli
Copy link
Author

This might work, it's quite hacky though. You'll still need to add an IconMas.icns in the media directory.

@sindresorhus
Copy link
Owner

I'll have to close this. Sorry for the wasted time, @samuelmeuli... Apple rejected the submission in May. I sent them a well-written appeal, but they have still not responded, and it doesn't like like they ever will. They also published this today, so looks like they don't want web wrapping apps in the App Store.

@asharma327
Copy link

Looking for some guidance on this.

My app works totally fine as a .dmg but the .pkg I created to submit to the Mac App Store is not working.

I created the .pkg with the production provisioning profile, used App Uploader and it was submitted for review. However, the review was rejected because App could not be launched at startup.

I tried to test the app locally but it wouldn't work, which I read is expected behavior. So I created a testing provisioning profile by using a development provisioning profile and setting "type": "development" in the MAS configuration of electron-builder as suggested in this thread.

However, the mas app still does not open whereas the .dmg works great.

The crash report specifies code sign as the reason it's not working even in the test.

What can I look at to determine what's going wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants