Skip to content

Crashlytics watchOS support #6262

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

Merged
merged 10 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/crashlytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

strategy:
matrix:
target: [ios, tvos, macos]
target: [ios, tvos, macos, watchos --skip-tests]
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
target: [ios, tvos, macos] # The macos and tvos tests can hang
target: [ios, tvos, macos, watchos --skip-tests] # The macos and tvos tests can hang
flags: [
'--use-modular-headers',
'--use-libraries'
Expand Down
2 changes: 2 additions & 0 deletions Crashlytics/Crashlytics/Components/FIRCLSApplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
return @"mac";
#elif TARGET_OS_TV
return @"tvos";
#elif TARGET_OS_WATCH
return @"ios"; // TODO: temporarily use iOS until Firebase can add watchos to the backend
#endif
}

Expand Down
5 changes: 5 additions & 0 deletions Crashlytics/Crashlytics/Components/FIRCLSProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@ bool FIRCLSProcessRecordAllThreads(FIRCLSProcess *process, FIRCLSFile *file) {

FIRCLSSDKLogInfo("recording thread %d data\n", i);
if (!FIRCLSProcessRecordThread(process, thread, file)) {
FIRCLSSDKLogError("Failed to record thread state. Closing threads JSON to prevent malformed crash report.");

FIRCLSFileWriteArrayEnd(file);

FIRCLSFileWriteSectionEnd(file);
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Crashlytics/generate_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ readonly DIR="$( git rev-parse --show-toplevel )"

"$DIR/Crashlytics/ProtoSupport/generate_crashlytics_protos.sh" || echo "Something went wrong generating protos.";

pod gen "${DIR}/FirebaseCrashlytics.podspec" --auto-open --gen-directory="${DIR}/gen" --local-sources="${DIR}" --platforms=ios,macos,tvos --clean
pod gen "${DIR}/FirebaseCrashlytics.podspec" --auto-open --gen-directory="${DIR}/gen" --local-sources="${DIR}" --platforms=ios,macos,tvos,watchos --clean
17 changes: 16 additions & 1 deletion FirebaseCrashlytics.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'

s.cocoapods_version = '>= 1.4.0'
s.static_framework = true
Expand Down Expand Up @@ -54,7 +55,10 @@ Pod::Spec.new do |s|
s.dependency 'nanopb', '~> 1.30905.0'

s.libraries = 'c++', 'z'
s.frameworks = 'Security', 'SystemConfiguration'
s.ios.frameworks = 'Security', 'SystemConfiguration'
s.macos.frameworks = 'Security', 'SystemConfiguration'
s.osx.frameworks = 'Security', 'SystemConfiguration'
s.watchos.frameworks = 'Security'

s.ios.pod_target_xcconfig = {
'GCC_C_LANGUAGE_STANDARD' => 'c99',
Expand Down Expand Up @@ -86,6 +90,17 @@ Pod::Spec.new do |s|
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"',
}

s.watchos.pod_target_xcconfig = {
'GCC_C_LANGUAGE_STANDARD' => 'c99',
'GCC_PREPROCESSOR_DEFINITIONS' =>
'DISPLAY_VERSION=' + s.version.to_s + ' ' +
'CLS_SDK_NAME="Crashlytics watchOS SDK" ' +
# For nanopb:
'PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1',
'OTHER_LD_FLAGS' => '$(inherited) -sectcreate __TEXT __info_plist',
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"',
}

s.test_spec 'unit' do |unit_tests|
unit_tests.source_files = 'Crashlytics/UnitTests/*.[mh]',
'Crashlytics/UnitTests/*/*.[mh]'
Expand Down