2026년 9월 7일 월요일

Apple Code Signing, Explained with Three Cards

APPLE SIGNING · 01 / 12

Stop memorizing certificates, App IDs, and provisioning profiles as separate objects. Connect who may sign what, and where it may run, and Xcode's signing errors begin to make sense.

Code signing matches a trusted identity to an execution policy.

WHO
Signing certificate
Is this signer trusted?
WHAT
App ID
Which bundle and capabilities?
WHERE · WHEN · HOW
Scope and rights
Devices, dates, and entitlements

AUTHORIZATION
Provisioning Profile
Apple's signed authorization that binds these conditions

Why signing configuration feels confusing

A signing error rarely points to a single cause. The certificate may have expired, the bundle identifier may not match the profile, or the app may request an entitlement that the profile does not authorize.

The confusion starts when we memorize certificates and provisioning profiles as unrelated files. Apple's technical note frames a provisioning profile as an authorization mechanism for running third-party code—not merely a file you download for development.[1]

The one sentence to remember
A certificate proves who signed the code. A provisioning profile proves that this signer is authorized to run this app under these conditions.

Separate the three core pieces

CERTIFICATE

The signer's identity. An Apple Development certificate signs builds that run on development devices. An Apple Distribution certificate is used for distribution workflows, including submission to App Store Connect.[2] The actual signing operation also needs the matching private key stored in the Mac's Keychain.

APP ID

The app's identity and capability scope. A practical mental model is Team ID + Bundle ID. If the target's Bundle Identifier does not match the App ID authorized by the profile, Xcode cannot use that profile.

PROFILE

A bundle of execution conditions. It connects signing certificates, an App ID, allowed devices, an expiration date, and entitlement limits. You create it through the Apple Developer website or Xcode, and Apple signs it cryptographically.[1]

The five questions a profile answers

  1. Who? Was the app signed by an allowed development certificate?
  2. What? Does the application's identifier match the App ID?
  3. Where? For development or Ad Hoc, is this device registered?
  4. When? Is the profile still valid?
  5. How? Are the requested entitlements allowed?

Apple's TN3125 explains the structure in terms of who, what, where, when, and how.[1] This frame turns a vague signing failure into a much smaller search space.

MYTH
“The provisioning profile contains my private key.”
CORRECTION
The profile contains information about allowed certificates. The private key remains part of the signing identity in Keychain.

App Store distribution has one apparent exception. After validating the submitted signature and profile, the App Store re-signs the app. The final app downloaded by a customer therefore has no embedded provisioning profile.[1]

What Xcode does when automatic signing is on

After you select a Team, provide a unique Bundle ID, and enable Automatically manage signing, Xcode can manage device registration and development provisioning profiles for you.[3]

  1. Select a Team — choose the developer account and organization scope.
  2. Check the Bundle ID — provide the identifier connected to the App ID.
  3. Manage assets — let Xcode manage development devices and profiles.
  4. Apply at build time — select a compatible identity and profile.

Automatic signing does not remove the model. It asks Xcode to satisfy the same model on your behalf. When it fails, you still return to the Team, Bundle ID, certificate, device, and entitlements.

Inspect the state on your own Mac

1. List usable code-signing identities

security find-identity -v -p codesigning

If the list is empty—or the expected team's identity is missing—check the certificate and private-key pair before recreating profiles.

2. Inspect the signature applied to the app

codesign -dvvv --entitlements :- "/path/to/MyApp.app"

Inspect the Authority, TeamIdentifier, Identifier, and entitlement output. Reading the built app's actual signature is usually faster than arguing with an error message from memory.

3. Decode the embedded profile for inspection

security cms -D \
  -i "/path/to/MyApp.app/embedded.mobileprovision" \
  -o /tmp/profile.plist
plutil -p /tmp/profile.plist

Use this only for diagnosis. Apple warns that the exact internal format of a provisioning profile is not a documented contract and may change. Production logic should not depend on its private structure.[1]

Use this troubleshooting order

  1. Team — Did you select the correct personal or organization team?
  2. Bundle ID — Do the target, App ID, and profile identify the same app?
  3. Signing identity — Is the matching private key in Keychain, not just the certificate?
  4. Purpose — Are you mixing Development and Distribution assets?
  5. Device — For development or Ad Hoc distribution, is the device registered?
  6. Expiration — Are both the certificate and profile still valid?
  7. Entitlements — Does the App ID and profile authorize every capability the app requests?

What to take away

  • A certificate represents the signer's identity.
  • An App ID represents the app and its capability scope.
  • A provisioning profile binds who may run what, where, when, and with which entitlements.
  • Automatic signing preserves this relationship; Xcode merely manages it for you.

Official sources

  1. Apple TN3125: Inside Code Signing — Provisioning Profiles
  2. Apple Developer Account Help — Certificates overview
  3. Apple Developer Documentation — Running your app on simulated or physical devices

This article reorganizes the concepts and diagnostic workflow for readers rather than reproducing Apple's wording. Apple, Xcode, and App Store are trademarks of Apple Inc.

2016년 7월 30일 토요일

RPI is not good handling DHT11

Hello?

This is failure story about converting c code to python.

There is GPIO controlling library on Python such as RPI, wiringPI.

But they are not enough to controlling high frequency data.

some people already investigate about it.
http://codeandlife.com/2012/07/03/benchmarking-raspberry-pi-gpio-speed/


Follow code return wrong values because frequency.

So I should hybrid c++ and python codes.


2016년 7월 28일 목요일

Change whole things.

Hello?


I decide to renew whole devices.




Finally, there is a lego frame for raspberry pi.

This one has motion sensor, humid sensor, camera, IR receiver.

I will use Django, python for gathering daily logs.

Fun coding guys :)

2016년 5월 28일 토요일

Wii fit scale for activity application

Many people who bought Wii, they has a wii fit scale. 

I am one of them. I find a way to use it.

There is a developer who already connect wii fit scale board to android.

https://github.com/paulburton/fitscales

It seems that there is a FitBit, Runkeeper sync feature.

S Health will be a another sync option. because they also have a api to sync data 

Samsung health idk

http://developer.samsung.com/health#none

Anyway, I try to change the github code and try to add sync feature to it. 

Happy coding..

2015년 8월 28일 금요일

iPython...

I have meet the wall for analyse the data from sensors. If I have a lot of time it is possible to make whole code.

But I have a job and that job is so busy. I heard iPython, Numpy, and pandas from my Facebook friends.

That tool is seems very good!..

My project is postponed until study these tools.

I think I can make program with python.

be happy !



2015년 8월 19일 수요일

New power saving mode in android M.

Android M adds powerful battery managing modes. One is doze and the other is app stand by.

Today google Korea campus, there is conference about these two modes.
I write summary about the conference meeting.
Mr yang and many other company people are participated in.

Because M source code is not released yet, we just talk and sharing testing results about these two modes. So following question (other company people) and answer (Mr yang from google) may have wrong informations.

So, testing your application using adb commend. Some pending events will occurs malfunction to your applications.

Q&A

1. What is doze mode?
 - Doze mode aim is for saving battery when user does not move their device for a long time. For example, if user forget to charging the phone, and slept. The phone turn to doze mode until wake up at the morning.  In the doze mode, whole app does not working at all. (some hardware interrupt and google play service can working even it is doze mode.)

2. How to prevent to enter doze?
  - There is no way to prevent by coding level.
  - The only way is using white list in battery manager and condition on developer pages.

3.  Can I detects the doze?
  -  No

4. How to return from doze to inactive? (Android app state has active (screen on), inactive (screen off), idle_pending, sensing -> ( idle -> idle_maintenance), from 2015 google IO extended. )
  -  Screen on, battery charging, move device (walking)
  - It seems that when screen off, device uses significant moving sensor for changing mode.

5. How to testing?
  - In google developer page has some errors, so testing like this :
  a. adb shell dumpsys battery unplug
  b. adb shell dumpsys deviceidle step
  c. do "b" steps, until mode changes to idle.
  d. checking state changes using following commend.
     adb shell dumpsys deviceidle

 - doze seems pending all events likes alarm, intent.. etc while doze mode is on.

 6. What is app standby mode?
 - This mode aim is for saving battery when user does not using app for a long time. For example, application does not runs by user during 2 weeks. It prevent to access battery consumption jobs likes networking. It will block background application/services to use a lot of battery.

 7. How to prevent to enter app standby
 - User cannot prevent using code.
 - There is condition on the site (user interaction, foreground, generate notification, white list on setting)

 8. How to reset the app standby?
 -  4 prevent condition will reset the app standby.

 9. Can I detect the app standby?
 - No

 10.  How to testing?
 - In google developer page has some errors.
 a. adb shell dump sys battery unplug
 b. adb shell am set-inactive <packagename> true/false
 c. checking mode using following commend
     adb shell am get-inactive <packagename>

 - app standby seems to has ability to receive alarms and service sticky  restarting but networking is not working.
 - Widget affects this mode. It means when widget is registered, app standby mode is disabled. But it is not permenent.
 - See the notification of the program also disable this mode. It is permanent disable.  


* These two mode does not killing application at all.
* When change application behaviour or UX, be mind current behaviour is not final, just look concept. (current behaviour means get some result from testing application using adb commend.)
* Many people concerns their background services.
* Some behaviour is very critically harmed when the behaviour using networking, ble. Especially, periodic networking syncing will not goes on when enter these two mode.
* Even more application user cannot concern notification UX when entering these two modes, because there is no api or intent.

So.. I hope good luck with your application testing.  In my opinion, it was fortunate these two mode not killing application.

References
https://developer.android.com/preview/features/power-mgmt.html
https://www.youtube.com/watch?v=X8eQn2E6GKw

2015년 6월 14일 일요일

Progress

Done :
1. AWS mysql server
2. AWS webpage
3. raspberry pi code is ready
  - Degree, Humidity, Movement
  - Upload information to AWS mysql
4. Web page


Not yet
1. phone application for logging event.
2. analysis module.


After some month, if I have a time, I will add more information this project again.

Following code is web page code for data viewing and some snapshot.




2015년 2월 20일 금요일

Everyone likes Lego.

If we have no proper case, lego is always perfect choice.

I build house for my sensors.

Problem is the light, my baby turn off all light when she go to bed.  





2015년 2월 16일 월요일

Test DHT11 and SEN0018 raspberry

Actually I am not familiar with hardware, so I bought sensors which are already output the digital signal.

Follow pictures are DHT11 and SEN0018. The first one DHT11 can collect humanity and degree information. The second one SEN0018 can collect movement human body using ultra ray.

<Front of SEN0018>

<Back of SEN0018>

<Front of DHT11> 

<Back of DHT11>


I connect these sensor's signal line to GPIO G04 (DHT11) and G18(SEN0018).  DHT11 needs 3V input and SEN0017 needs 5V input. The connection is done like following pictures.

<Raspberry PI>

<Connection Setup>


Following is DHT11 test code which can easily getting from web site. For example "http://www.uugear.com/portfolio/dht11-humidity-temperature-sensor-module/".


And Following code for SEN0018 codes which is made by me. I cannot find any open source code for SEN0018. So I make the code.

Each of codes are works fine.

Data not good, skip
Humidity = 41.0 % Temperature = 25.0 *C (77.0 *F)
Data not good, skip
Data not good, skip
Humidity = 40.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 40.0 % Temperature = 25.0 *C (77.0 *F)
Data not good, skip
Data not good, skip
Data not good, skip
Data not good, skip
Humidity = 40.0 % Temperature = 25.0 *C (77.0 *F)
^Cpi@raspberrypi ~ $ 


pi@raspberrypi ~ $ sudo ./test.o 
Sensor start
state = 1
state = 0
state = 1


Next time I will merge these code and save the log data to db in raspberry PI.


2015년 2월 7일 토요일

2015 Project #1. Motion, Humanity, and Degree monitoring with Raspberry pi and Data analysis with baby cold symptom.

I have 2 years old baby. She take a cold very frequently.

So I decide to make the  monitoring tool in her sleeping room.

I will get motion, humid and degree information from raspberry pi and analysis it.

If I found some meaningful relationship, I will make a iPhone alert application for mother.

I will post

1. How to make a sensor logger with raspberry pi.
2. Logging policy and make an databases.
3. Analysis the logs.

Is it working?


2013년 12월 31일 화요일

Fix iOS 7 trust device problem on ubuntu 12.04

I think libimobiledevice's developer will give better solution than this guide, soon.
In developer homepage, easy way will be adopted  on 1.1.6.

This guide is just compile and update the newest version of the libimobiledevice and the ifuse.

So, I assume that a reader has a knowledge about using make, cmake, automake, git .. etc which are using widely on developing.

And I also do follow things on my ubuntu 12.04 before update binary.

  1. Install libimobiledeivce-1.1.5 and related libraries.
     http://www.libimobiledevice.org

  2. Disable automount on desktop.
     http://askubuntu.com/questions/89244/how-to-disable-automount-in-nautiluss-preferences
 
Before to do this guide, you must find your original binaries on your system. In my system, it was "/usr", so I add "--prefix=/usr" when configuration. 

Now, lets go.

1. update libimobiledevice
 - git clone https://github.com/libimobiledevice/libimobiledevice
 - cd libimobiledevice
 - autoreconfig
 - automake --add-missing
 - ./configure --prefix=/usr
 - sudo make install

2. update ifuse
 - git clone  http://cgit.sukimashita.com/ifuse.git
 - cd ifuse
 - ./autogen.sh
 - ./configure --prefix=/usr
 - sudo make install

 * I also manually update the libfuse as 2.9.3.

After finished, following command works fine.

- idevicepair pair
  -- success
- idevicepair validate
  -- paried deivce införmation
- ifuse /media/iphone --root
  -- it works fine

Trust message does not bother me after update.

Happy new year.


Apple Code Signing, Explained with Three Cards

APPLE SIGNING · 01 / 12 Stop memorizing certificates, App IDs, and provisioning profiles as separate objects. Connect who may sign wha...