iPhone و iPad

CoShare على الآيفون والآيباد

CoShare لسا مش على App Store، فبتثبّته متل المطورين: من الماك، بحساب Apple تبعك، حتى لو مجاني. سطر واحد بالتيرمينال بيعمل كل شي، وهالصفحة بتشرح شو بيصير بكل خطوة.

بتحتاج: ماك · كابل للآيفون أو الآيباد · Apple ID (المجاني بيكفي) · iOS أو iPadOS 15 أو أحدث

سطر واحد. بيثبّت Xcode إذا ناقص، وبيتأكد من كل شي، وبيبني التطبيق وبيفتحه على جهازك.
بيصلّح لحاله. إذا في خطوة ناقصة بيقلّك شو تعمل بالزبط، وبيكمّل أول ما تخلّص.
بحسابك أنت. التطبيق بيتوقّع بـ Apple ID تبعك، وما بيمرق على حدا غيرك.
كود مفتوح. بيتبنى قدامك من نفس الكود اللي على GitHub، وفيك تقرا السكربت قبل ما تشغّله.

السطر الواحد

وصّل الآيفون أو الآيباد بالماك بالكابل، افتح Terminal (⌘ + مسافة واكتب Terminal)، الصق هالسطر واضغط Enter:

curl -fsSL https://devehab.github.io/coshare/install-ios.sh | bash

بيمشي على ٦ مراحل، وبكل وحدة بيطبعلك ✓ أو شو لازم تعمل:

  1. الماك: النظام والمساحة الفاضية.
  2. Xcode: إذا مش موجود بيفتحلك صفحته على App Store وبيستنى لحد ما يخلص التثبيت. وبيقبل رخصته ومكوّناته (بيطلب كلمة سر الماك مرة وحدة).
  3. الكود: بينزّل كود CoShare بمجلد ~/CoShare-iOS، أو بيحدّثه لآخر نسخة.
  4. حساب Apple: بيلاقي حسابك بـ Xcode لحاله. وإذا ما في حساب بيفتح Xcode وبيقلّك وين تضيفه.
  5. الجهاز: بيستنى لحد ما يكون موصول، ووثقت بالماك، ووضع المطور مفعّل.
  6. البناء والتثبيت: بيبني CoShare، وبيوقّعه بحسابك، وبيثبّته وبيفتحه. وإذا صار خطأ بيقرا السبب وبيصلّح اللي بيقدر عليه وبيرجع يحاول.

بدك تشوف شو بيعمل قبل ما تشغّله؟ اقرا السكربت. كله بيصير على جهازك: بينزّل الكود من GitHub و Xcode من Apple، وما في شي تاني.

قبل ما تبدأ

  • ماك عليه macOS بيشغّل Xcode حديث. نسخة Xcode اللي على App Store بتحتاج غالباً آخر نسختين من macOS. على ماك أقدم نزّل أحدث Xcode بيشتغل عليه (15 أو أحدث) من صفحة مطوري Apple.
  • مساحة: حوالي ٤٠ غيغا فاضية إذا Xcode مش منزّل، أو ١٥ غيغا إذا منزّل.
  • كابل بينقل بيانات (مش كابل شحن بس) للمرة الأولى.
  • آيفون أو آيباد عليه iOS أو iPadOS 15 أو أحدث.
  • Apple ID: المجاني بيكفي. الحساب المدفوع (Apple Developer Program) بيخلّي التطبيق شغّال سنة بدل ٧ أيام، وبيسمحلك تنشره على App Store.

خطوة بخطوة: شو رح تشوف وشو تعمل

١. إذا ما عندك Xcode

بيفتح App Store على صفحة Xcode: اضغط «الحصول» ثم «تثبيت»، وخلّي التيرمينال مفتوح. التنزيل بياخد عادة من ٢٠ لـ ٦٠ دقيقة، والسكربت بيكمّل لحاله أول ما يخلص. إذا طلب كلمة سر الماك لقبول رخصة Xcode اكتبها واضغط Enter. ما رح تبيّن وانت عم تكتبها، وهاد طبيعي.

٢. ضيف حساب Apple على Xcode (مرة وحدة)

إذا Xcode ما فيه حساب، بيفتحه السكربت. روح على Xcode ← Settings…‏ (⌘,) ← Accounts ← «+» ← Apple ID، وسجّل دخول وسكّر نافذة الإعدادات. السكربت بيلاحظ وبيكمّل.

٣. وصّل الجهاز ووثق بالماك

وصّل الآيفون أو الآيباد بالكابل وافتح قفله. بيطلعلك سؤال «الوثوق بهذا الكمبيوتر؟» (Trust This Computer?): اضغط «وثوق» وأدخل رمز الجهاز.

٤. شغّل وضع المطور (iOS 16 وأحدث)

على الجهاز: الإعدادات ← الخصوصية والأمن ← وضع المطور (Developer Mode) بآخر الصفحة ← شغّله ← إعادة التشغيل. بعد ما يرجع يشتغل اضغط «تشغيل» وأدخل الرمز. إذا ما لقيت الخيار، خلّي الجهاز موصول والسكربت شغّال، لأنه بيبيّن بعد ما Xcode يتعرّف على الجهاز. وعلى iOS 15 ما في وضع مطور، فما بتحتاج هالخطوة.

٥. البناء (٢–٥ دقايق أول مرة)

أول مرة ممكن Xcode «يجهّز الجهاز للتطوير»، يعني بينسخ ملفات من الجهاز. هالشي بياخد كم دقيقة وكم غيغا، وخلّي الجهاز موصول ومفتوح القفل خلاله.

٦. ثق بحسابك على الجهاز (أول مرة بس)

إذا طلعلك «مطوّر غير موثوق» (Untrusted Developer): الإعدادات ← عام ← VPN وإدارة الجهاز (VPN & Device Management) ← Apple Development: بريدك ← وثوق. السكربت بيفتح CoShare لحاله بعدها.

٧. أول ما يفتح CoShare

  • اسمح بـ «الشبكة المحلية» وبالإشعارات.
  • الإعدادات ← CoShare ← «اللصق من التطبيقات الأخرى» ← «السماح»، لتنبعت نسخك وهو بالخلفية.
  • أنشئ مجموعة، أو «انضمام لمجموعة» ← «مسح رمز QR» من جهازك التاني. وخلصت 🎉

بعد ٧ أيام (الحساب المجاني)

Apple بتخلّي التطبيقات اللي بتوقّعها بحساب مجاني تشتغل ٧ أيام. السكربت بيقلّك التاريخ بالزبط. قبله، أو حتى بعده، وصّل الجهاز وشغّل نفس السطر مرة تانية: بيحدّث الكود وبيعيد التوقيع بدقيقتين، ومجموعاتك وسجلّك بيضلّوا متل ما هنّي. بالحساب المدفوع المدة سنة كاملة.

الحساب المجاني بيسمح بـ ٣ تطبيقات موقّعة على الجهاز بنفس الوقت.

من Xcode مباشرة (للمطورين)

  1. git clone https://github.com/Devehab/coshare.git وافتح CoShare.xcodeproj.
  2. اختار الـ scheme CoShare iOS.
  3. Signing & Capabilities: بـ Team اختار حسابك، وغيّر Bundle Identifier لشي خاص فيك (مثلاً com.yourname.coshare).
  4. اختار جهازك من فوق، واضغط ⌘R.

الكود كله: iOS/ للآيفون والآيباد، وShared/ للمحرّك المشترك مع الماك. والبروتوكول موثّق بـ PROTOCOL.md.

بدك تنشره على App Store؟ أهلاً وسهلاً

CoShare مفتوح المصدر برخصة MIT، يعني من حقك تنشره على App Store بحساب المطور تبعك، بدون إذن من حدا. كل اللي بنتمناه:

  • خلّي ملاحظة حقوق النشر بالتطبيق (صفحة «حول» بتكفي).
  • استعمل Bundle ID واسم خاصين فيك. «CoShare by اسمك» كتير حلو.
  • شيل وضع الخلفية audio، لأن App Review ما بيقبل الصوت الصامت اللي بيخلّي التطبيق شغّال (iOS/BackgroundKeeper.swift).

ولما ينزل على المتجر خبّرنا، وبكل سرور منحط رابطه بالموقع لينزّله الناس بضغطة وحدة. رح نكون كتير مبسوطين 💛

مشاكل وحلولها

  • «No Accounts» أو مشكلة توقيع: تأكد إنه حسابك موجود ومسجّل دخول بـ Xcode ← Settings ← Accounts، وشغّل السطر مرة تانية.
  • ما في «وضع المطور» بالإعدادات: خلّي الجهاز موصول ومفتوح القفل، وافتح Xcode ← Window ← Devices and Simulators مرة. الخيار بيبيّن بعدها.
  • «maximum App ID limit»: الحساب المجاني بيعمل لحد ١٠ معرّفات تطبيقات جديدة بالأسبوع، و٣ تطبيقات على الجهاز. احذف تطبيق قديم ثبّتته من Xcode، أو استنى كم يوم.
  • انبنى بس ما انفتح: غالباً الجهاز كان مقفول. افتح قفله وافتح CoShare من الشاشة الرئيسية.
  • الماك أقدم من Xcode اللي على App Store: نزّل Xcode 15 أو أحدث بيشتغل على نظامك من developer.apple.com/download، وحطه بمجلد Applications.
  • غير هيك: السجل الكامل بـ ~/CoShare-iOS/build/install-ios.log. افتح مشكلة على GitHub وحطه معها، ومنساعدك.
iPhone & iPad

CoShare on iPhone and iPad

CoShare isn’t on the App Store yet, so you install it the way developers do: from your Mac, with your own Apple ID (a free one works). One line in Terminal does everything; this page explains what happens at each step.

You need: a Mac · a cable for the iPhone or iPad · an Apple ID (free is enough) · iOS or iPadOS 15 or later

One line. Installs Xcode if it’s missing, checks everything, builds the app and opens it on your device.
Fixes itself. When a step is missing it tells you exactly what to do, and continues as soon as you have.
Your own account. The app is signed with your Apple ID and goes through no one else.
Open source. Built in front of you from the same code that’s on GitHub. Read the script before you run it.

The one line

Plug the iPhone or iPad into your Mac, open Terminal (⌘ + Space, type Terminal), paste this line and press Return:

curl -fsSL https://devehab.github.io/coshare/install-ios.sh | bash

It goes through 6 stages and prints a ✓, or what you need to do, for each:

  1. This Mac: the system and the free space.
  2. Xcode: if it’s missing, it opens Xcode in the App Store and waits until it’s installed. Then it accepts the license and components (your Mac password, once).
  3. The code: downloads CoShare’s source to ~/CoShare-iOS, or updates it.
  4. Your Apple ID: finds your account in Xcode. If there’s none, it opens Xcode and shows where to add it.
  5. The device: waits until it’s connected, trusts this Mac and has Developer Mode on.
  6. Build and install: builds CoShare, signs it with your account, installs it and opens it. If something fails, it reads why, fixes what it can and tries again.

Want to see what it does before running it? Read the script. Everything happens on your Mac: the code comes from GitHub and Xcode from Apple, nothing else.

Before you start

  • A Mac whose macOS runs a recent Xcode. The App Store’s Xcode usually needs one of the last two macOS versions. On an older Mac, get the newest Xcode it runs (15 or later) from Apple’s developer downloads.
  • Space: about 40 GB free if Xcode isn’t installed, 15 GB if it is.
  • A data cable (not charge-only) for the first time.
  • An iPhone or iPad with iOS or iPadOS 15 or later.
  • An Apple ID: a free one is enough. A paid one (Apple Developer Program) keeps the app signed for a year instead of 7 days, and lets you publish it on the App Store.

Step by step: what you’ll see and do

1. If you don’t have Xcode

The App Store opens on Xcode: click Get, then Install, and leave Terminal open. The download usually takes 20 to 60 minutes; the script continues by itself when it’s done. If it asks for your Mac password to accept Xcode’s license, type it and press Return. Nothing shows while you type; that’s normal.

2. Add your Apple ID to Xcode (once)

If Xcode has no account, the script opens it. Go to Xcode → Settings… (⌘,) → Accounts → + → Apple ID, sign in and close the Settings window. The script notices and carries on.

3. Connect the device and trust the Mac

Plug in the iPhone or iPad and unlock it. On Trust This Computer?, tap Trust and enter the device passcode.

4. Turn on Developer Mode (iOS 16 and later)

On the device: Settings → Privacy & Security → Developer Mode (at the bottom) → on → Restart. When it’s back, tap Turn On and enter the passcode. Can’t find it? Keep the device connected while the script runs; it appears once Xcode has seen the device. iOS 15 has no Developer Mode, so skip this step.

5. The build (2–5 minutes the first time)

The first time, Xcode may need to “prepare the device for development”: it copies files from the device, which takes a few minutes and a few GB. Keep the device connected and unlocked meanwhile.

6. Trust your account on the device (first time only)

If you see Untrusted Developer: Settings → General → VPN & Device Management → Apple Development: your email → Trust. The script opens CoShare by itself right after.

7. When CoShare opens

  • Allow Local Network and notifications.
  • Settings → CoShare → Paste from Other Apps → Allow, so copies are sent from the background too.
  • Create a group, or Join → Scan QR code from your other device. Done 🎉

After 7 days (free Apple ID)

Apple lets apps you sign with a free account run for 7 days. The script tells you the exact date. Before then, or even after, plug the device in and run the same line again: it updates the code and signs it again in about two minutes, and your groups and history stay. With a paid account it’s a full year.

A free account can have 3 self-signed apps on a device at a time.

Straight from Xcode (for developers)

  1. git clone https://github.com/Devehab/coshare.git and open CoShare.xcodeproj.
  2. Pick the CoShare iOS scheme.
  3. Signing & Capabilities: choose your Team, and change the Bundle Identifier to one of your own (e.g. com.yourname.coshare).
  4. Pick your device in the toolbar and press ⌘R.

The code: iOS/ for iPhone and iPad, Shared/ for the engine it shares with the Mac. The protocol is documented in PROTOCOL.md.

Want to publish it on the App Store? Please do

CoShare is open source under the MIT license, so you’re free to publish it on the App Store under your own developer account, no permission needed. All we ask:

  • keep the copyright notice in the app (an About screen is enough),
  • use your own bundle ID and name. “CoShare by You” is great,
  • remove the audio background mode: App Review doesn’t accept the silent audio that keeps the app running (iOS/BackgroundKeeper.swift).

When it’s live, tell us and we’ll gladly link it from the website, so people can install it in one tap. It would make our day 💛

Troubleshooting

  • “No Accounts” or a signing error: make sure your account is in Xcode → Settings → Accounts and signed in, then run the line again.
  • No Developer Mode in Settings: keep the device connected and unlocked, and open Xcode → Window → Devices and Simulators once. The option appears after that.
  • “maximum App ID limit”: a free account can create 10 new app IDs a week and keep 3 apps on a device. Delete an older app you installed from Xcode, or wait a few days.
  • Built but didn’t open: the device was probably locked. Unlock it and open CoShare from the home screen.
  • Your Mac is older than the App Store’s Xcode: download Xcode 15 or later that runs on your macOS from developer.apple.com/download and put it in Applications.
  • Anything else: the full log is in ~/CoShare-iOS/build/install-ios.log. Open an issue on GitHub with it and we’ll help.