Ubuntu 16.04下免费Apple开发者账号创建NativeScript iOS云构建证书
Alright, let's tackle this step by step—since you're on Ubuntu 16.04 with a free Apple Developer account and using NativeScript Sidekick for iOS cloud builds, here's exactly how to set up the certificates you need to get your app running on your iPhone:
- A valid free Apple ID (the one you use for App Store/iCloud)
- Your iPhone's UDID (unique device identifier—we’ll cover how to grab this below)
- NativeScript Sidekick installed and logged in with your account
- Ubuntu 16.04 terminal access for generating a certificate signing request (CSR)
Free Apple accounts require you to generate a CSR locally first. Open your terminal and run these commands:
# Generate a private key and CSR openssl req -new -newkey rsa:2048 -nodes -keyout ios-dev-key.key -out ios-dev-csr.csr
When prompted:
- Common Name: Enter the email address linked to your Apple ID
- Leave all other fields (Country, State, etc.) blank by pressing Enter—they’re optional for free accounts.
You’ll end up with two files: ios-dev-key.key (keep this safe—don’t share it!) and ios-dev-csr.csr (we’ll upload this to Apple).
Head to Apple’s Developer Portal and log in with your free Apple ID. Navigate to Certificates, Identifiers & Profiles.
3.1 Create a Development Certificate
- Go to Certificates > Development
- Click the "+" button to create a new certificate
- Select iOS App Development and click Continue
- Upload the
ios-dev-csr.csrfile you generated earlier, then click Continue - Download the resulting
.cerfile (it’ll be named something likeios_development.cer)
3.2 Register Your iPhone (So Apple Allows It to Run Your App)
Free accounts let you register up to 10 devices. To add yours:
- Go to Devices > All
- Click "+" and select Register a Device
- Enter a name for your iPhone (e.g., "My iPhone 13") and its UDID. To get the UDID:
Connect your iPhone to your Ubuntu machine via USB. Install the libimobiledevice tools first with
sudo apt-get install libimobiledevice-tools, then runidevice_id -lin the terminal—this will output your device’s UDID. - Click Register to add the device.
3.3 Create an Explicit App ID
- Go to Identifiers > App IDs
- Click "+" and select App
- Enter a name (e.g., "My NativeScript App") and an Explicit Bundle ID (this must match exactly what you have in your NativeScript project—e.g.,
com.yourname.yourapp) - Scroll down and make sure App Development is checked, then click Continue and Register.
3.4 Create a Development Provisioning Profile
- Go to Profiles > Development
- Click "+" and select iOS App Development
- Choose the App ID you just created, then select the development certificate you made earlier
- Select your registered iPhone from the list of devices
- Name the profile (e.g., "My App Dev Profile") and click Generate
- Download the
.mobileprovisionfile.
Open your project in Sidekick and navigate to the Build tab:
- Select iOS as the platform and Cloud Build as the build type
- Click on Certificates & Profiles (or similar—depending on your Sidekick version)
- Import the following files:
- Your private key (
ios-dev-key.key) - The Apple
.cercertificate - The
.mobileprovisionprofile
- Your private key (
- Double-check that the Bundle ID in Sidekick matches the Explicit App ID you created in Apple’s portal—this is critical to avoid build errors.
- Start the cloud build in Sidekick—once it’s complete, you’ll get an
.ipafile (you can download it from Sidekick’s build history) - To install it on your Ubuntu-connected iPhone:
- First, install the necessary deployment tools if you haven’t already:
sudo apt-get update && sudo apt-get install libimobiledevice-tools ideviceinstaller - Connect your iPhone to your Ubuntu machine via USB. On your iPhone, tap Trust when prompted to trust the computer (you’ll need to enter your passcode).
- Run this command in the terminal, replacing
path/to/your/app.ipawith the actual file path of your built IPA:ideviceinstaller -i path/to/your/app.ipa
- First, install the necessary deployment tools if you haven’t already:
- After a few seconds, your app should appear on your iPhone’s home screen. If it doesn’t show up immediately, wait a minute or restart your iPhone.
Important Notes for Free Apple Accounts
- Your development certificate and provisioning profile will expire after 1 year—you’ll need to renew them by repeating steps 2-4 when that happens.
- You can only register up to 10 devices with a free Apple Developer account.
- Free accounts don’t support publishing to the App Store or using TestFlight—this setup is only for testing on your registered devices.
内容的提问来源于stack exchange,提问作者Hemant Dugar

