-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
Athar Reza edited this page Nov 1, 2025
·
1 revision
Get up and running with AgriSense iOS development in just 5 minutes!
Before starting, ensure you have:
- โ macOS 13.0+ installed
- โ Xcode 15.0+ installed
- โ Git installed
- โ GitHub account (for cloning)
Don't have these? โ See Installation Guide
# Clone the repository
git clone https://github.com/Athar891/AgrisenseiOS.git
# Navigate to directory
cd AgrisenseiOS# Open project
open Agrisense.xcodeprojWait for Xcode to:
- Load project
- Index files
- Resolve Swift packages (automatic)
-
Get Firebase Config:
- Visit Firebase Console
- Use existing project or create new one
- Download
GoogleService-Info.plist
-
Add to Project:
# Copy to Agrisense folder cp ~/Downloads/GoogleService-Info.plist ./Agrisense/
-
Verify in Xcode:
- File should appear in Agrisense folder
- Target membership: Agrisense โ
Create Secrets.swift in Agrisense/Models/:
import Foundation
enum Secrets {
static let weatherAPIKey = "YOUR_KEY_HERE" // Get from openweathermap.org
static let geminiAPIKey = "YOUR_KEY_HERE" // Get from ai.google.dev
static let cloudinaryCloudName = "YOUR_CLOUD_NAME"
static let cloudinaryUploadPreset = "YOUR_PRESET"
}Quick API Keys (Optional for first run):
- Weather: openweathermap.org (Free tier)
- Gemini AI: ai.google.dev (Free tier)
- Cloudinary: cloudinary.com (Free tier)
- Select target: Agrisense
- Select device: iPhone 14 Pro (or any simulator)
- Press
โR(Command + R) - Wait for build... โณ
- App launches! ๐
- Splash Screen - AgriSense logo
- Welcome Screen - App introduction
- Sign In/Sign Up - Authentication screen
Email: test@agrisense.com
Password: TestPassword123!
Or use Google Sign-In for faster setup.
- Weather information
- Market prices
- Quick actions
- Tap microphone icon
- Say "Krishi AI" to activate
- Ask a question about farming
- Tap "Add Crop" button
- Fill in crop details
- View your crop portfolio
- Browse products
- Add to cart
- Checkout flow
# Create feature branch
git checkout -b feature/my-new-feature
# Make your changes in Xcode
# Build and test
โB # Build
โR # Run
โU # Test
# Commit changes
git add .
git commit -m "Add: my new feature"
# Push to GitHub
git push origin feature/my-new-feature# Run unit tests
โU
# Or via command line
xcodebuild test \
-project Agrisense.xcodeproj \
-scheme Agrisense \
-destination 'platform=iOS Simulator,name=iPhone 14 Pro'// Agrisense/Models/AppState.swift
@Published var isDarkMode = true // Change to true for dark mode// Agrisense/CoreKit/LocalizationManager.swift
@Published var currentLanguage = "hi" // "hi" for Hindi, "en" for English// Agrisense/Services/EnhancedTTSService.swift
utterance.rate = 0.6 // Speed (0.0 - 1.0)
utterance.pitchMultiplier = 1.2 // Pitch (0.5 - 2.0)-
Create SwiftUI View:
// Agrisense/Views/MyNewView.swift import SwiftUI struct MyNewView: View { var body: some View { Text("Hello, AgriSense!") } }
-
Add to Navigation:
// In parent view NavigationLink("Go to My View") { MyNewView() }
// Agrisense/Models/MyModel.swift
import Foundation
struct MyModel: Identifiable, Codable {
let id: String
var name: String
var createdAt: Date
}// Agrisense/Services/MyService.swift
import Foundation
class MyService: ObservableObject {
@Published var data: [MyModel] = []
func fetchData() async throws {
// Fetch logic here
}
}- Connect iPhone via USB
- Trust Computer (on device)
-
Enable Developer Mode:
- Settings โ Privacy & Security โ Developer Mode โ ON
- Select Device in Xcode
-
Build & Run (
โR)
- Xcode will register device automatically
- May need to verify in Settings โ General โ VPN & Device Management
# Clean build folder
โโงK
# Clear derived data
rm -rf ~/Library/Developer/Xcode/DerivedData/*
# Rebuild
โB# In Xcode menu
File โ Packages โ Reset Package Caches
File โ Packages โ Resolve Package Versions# Reset simulator
xcrun simctl erase all
# Restart simulator
killall Simulator- Check
GoogleService-Info.plistis present - Verify bundle ID matches Firebase config
- Check internet connection
- Look for errors in console
- Project Architecture - Understand the codebase
- Code Structure - File organization
- Design Patterns - Coding patterns used
- Live AI Assistant - Krishi AI deep dive
- Crop Management - Crop system details
- Marketplace - E-commerce implementation
- Contributing Guide - How to contribute
- Coding Standards - Code style guide
- Testing Guide - Writing tests
โB Build
โR Run
โ. Stop
โU Test
โโงK Clean
โโงY Show/Hide Console
โโงO Quick Open
โโฅJ Jump to Definition
โ/ Comment/Uncomment
po variableName Print object in console
p variableName Print value
expr variableName = value Modify at runtime
โK Toggle keyboard
โโ Rotate right
โโ Rotate left
โโงH Home button
โโงH (2x) App switcher
Time: ~10 minutes
Steps:
-
Open DashboardView.swift
# Quick open in Xcode โโงO โ Type "DashboardView" โ Enter
-
Add Banner at Top
var body: some View { VStack { // Add this Text("๐ Hello, Farmer!") .font(.largeTitle) .padding() .background(Color.green.opacity(0.2)) .cornerRadius(10) // Existing content... } }
-
Build & Run (
โR) -
See Your Changes! ๐
Bonus: Make it personalized:
Text("๐ Hello, \(userManager.currentUser?.name ?? "Farmer")!")- ๐ Full Documentation - Complete wiki
- ๐ Troubleshooting - Common issues
- โ FAQ - Frequently asked questions
- ๐ฌ GitHub Issues - Report bugs
- ๐ฌ Join discussions
- ๐ค Connect with contributors
- ๐ง Email: support@agrisense.app
Before moving forward, ensure:
- Project builds successfully
- App runs on simulator
- Firebase connected
- Can create test account
- All main tabs accessible
- No console errors (warnings OK)
Ready to dive deeper? โ Project Architecture
Want to contribute? โ Contributing Guide
Need setup help? โ Installation Guide
Happy Coding! ๐
Made with โค๏ธ for AgriSense